On Wed, 3 Mar 2004 13:01:22 +0000 (GMT), Bart Oldeman wrote:

Yes we should care! This area is used by all sorts of TSRs and network
redirectors that live "under" DOS. These fixed locations cannot be changed
without breaking apps that rely on undocumented DOS in various ways.

I see. Do you mean that all our stacks must be from 300h to 780h?


theoretical perhaps.... Have a look at the stacks after DOS has booted to
see how much is left (you can see the high water mark by watching 90 90
...) -- 288 bytes is really not a lot and Tom and I have had to go through
some real trouble in the past to reduce stack usage.

My results:


Error Processing stack: 96 bytes left, 288 used
Disk Function Stack:    40 bytes left, 344 used
Char Function Stack:    87 bytes left, 297 used
Process 0 Stack (new): 296 bytes leff,  88 used

In view of the above, I think that we could reduce process 0 stack at least in half.

Most is described in books such as Undocumented DOS.
They describe the disk_api (int21/ah>0ch), char_api (int21/ah<=0ch) and
error stacks (for int24) that we have too.

Would be good to read, but not available here :-(


On top of that FreeDOS has private stacks for the builtin clock (sysclk.c)
and block (dsk.c) device drivers.

Where are they?


Of all these stacks need to be in the swappable data area, since if a
SDA-swapping TSR decides to reenter DOS it will need to restore the
stacks after finishing.

Some TSRs such as THELP however are called from int28 where DOS uses the
char_api stack. So THELP is free to call any DOS function on the disk_api
stack.

However the new stack you now have put in is not affected by any
re-entering so can stay out of the SDA.

OK, so where we can move it, knowing that we'd need no more than 192 bytes? What about 800h-8C0h?


Not at all. STACKS affects the (dynamically allocated) IRQ stacks used by
hardware interrupts (ints 8-f and 70-77) STACKS=0,0 causes 0 IRQ stacks
-- a side effect could be that the DOS stacks (or application stacks)
could overflow then.

I see. Thanks! Lucho


------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to