[alt.msdos.programmer] Where's the bug?

doug@feedme.UUCP (Doug Salot) (07/06/89)

Hello, DOS fans.

Well, I haven't written a DOS program since about DOS 2.0, but recently
I was forced to do so, and (surprise!) I have a bug I can't kill:

For reasons I'd rather not go into, I need to allocate and use the
top 32K of DOS memory (9800:0 to 9800:ffff) in my program.  Fine,
DOS (3.3) let's me do this by changing it's allocation strategy
(INT 21H, function 58H) and allocating 32K (INT 21H, function 48H).
It gives me 32K and tells me it starts at 9800:0 just as I wanted.

BUT, my program also spawns a new COMMAND.COM if the user desires.
COMMAND.COM has a resident portion in low mem, and a transient
portion in high mem.  If the transient portion gets wiped by a program
(such as mine), COMMAND.COM reloads its transient portion ...
apparently right on top of my data.

I've let DOS know about my use of high mem through its own allocation
services; doesn't COMMAND.COM respect this allocation?  How can I
ensure the safety of my data?

Thanks in advance.
-- 
Doug Salot                                                        Be frivolous.
doug@feedme.UUCP || ...!{zardoz,dhw68k}!feedme!doug || doug%feedme@uunet.uu.net