Hello Tom,

On Sun, 26 Aug 2018 at 13:03, Tom Ehlert <t...@drivesnapshot.de> wrote:
> I think I found the cause for command crashing:
>
> the size to swap out, and back in, is only calculated once  in
>    XMSinit() {
>    ...
>    mcb = MK_SEG_PTR (struct MCB, SEG2MCB (_psp));
>    xms_block_size = SwapTransientSize = mcb->mcb_size;
>
>
> now if the size of command.com in memory ever changes,
> to little is saved/restored.

I think it is related somewhere to MCB corruption but still not sure where.
Somehow it happens after the strings are copied back in from XMS. I`ll
still have to dig deeper.

As for size... this is possible with OW if the heap overflows:
For GCC and TC the stack is above the heap so if the heap overflows it
corrupts the stack but the legally accessible part of DS (ie. near
memory space) cannot grow because the top of the stack is fixed.

For OW the heap is beyond the stack. If sbrk() needs to grow the heap
it can indeed do so dynamically.
If you fix the heap size to be bigger to start with in build.bat
(build.sh for Linux cross compilation) then it won't need growing.
I already played a bit with that but so far no big change.

Btw for me a broken OW-compiled command.com boots metados fast and
leaves only 3 directories in g:\ because something odd happens with
DIR and its sort buffer as soon as the special string buffer is used.
A correct one boots slower and leaves 6 directories in g:\. It's all a
question of fairly time consuming narrowing down where odd behaviour
happens first and why.

Bart

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to