Mail Archives: djgpp/2006/02/09/11:10:04
Rod Pemberton wrote:
> Good luck. As soon as you add write() back in, you'll hit the reentrancy
> crash. Probably some simple logic isn't correct. Hopefully, it is an easy
> fix, since I think the INDOS/IDLE flags are now correct. But, if not, there
> is an alternative way to deal with DOS reentrancy. From DOS 4.0, you can
> save and restore the Swappable Data Area (SDA) using int 0x21, ax=5d06h or
> ax=5d0bh. The SDA's size is larger if INDOS and smaller if idle. I have no
> further information on how this works other than Andrew Schulman's
> "Undocumented DOS" has information. I mention this because you want
> "bullet-proof." If you find anything on the web on this, other than Ralph
> Brown's Interrupt list info, let me know.
This is a repost because it doesn't appear with my attachments, it made
the list, here is the body of the e-mail, attachments to follow
in next e-mail:
---
Ok, well, your code definitely worked, but you're right, as soon as you
introduce a write() anywhere, it bombs. Unfortunately, I need to do a
write (not to the screen, but to disk). So I've followed every
reference I can find, and I've attached what I've come up with. It's
a full test suite to turn certain options on and off, and provides
hooks to enable and disable wrapping each bios interrupt individually.
These are the command line arguments for my tsr test program
Usage: rmtsr.exe -dN -n -i[good|all|none|NN] -cNNNN -s -r -h
-dN debug level N=0-5 (DEFAULT 0)
-iXXXX hook bios interrupts to increment inbios flag for safety
[all] interrupts
[good] known good interupts (DEFAULT)
[none] dont hook bios interrupts
[NN] interrupt number, may be specified multiple
times. List: 05 09 0B 0C 0D 0E 10 13 14 16 17
-cNNNN number of calls to make before unloading (DEFAULT 1000)
-ffile location to write output file
-n do not monitor dosidle interrupt 0x28
-s clear ss and sp registers before performing a simulate_fcall_iret
as per the api docs, which will force it to create a small
temporary stack for the realmode call
-r restore ss and sp registers after simulate_fcall_iret, only
relevant if used with -s
-h help, this menu
I think I'm probably chaining the BIOS interrupts incorrectly
(possibly). From what I've read, I should be able to chain int 13,
and hold when it's active in memory, and just perform a sanity
check before entering the hook on the timer interrupt, if int 13
isn't in the middle of being called, I should be able to simply
disable interrupts, and write to disk.... but... alas ... it
doesn't work :/
Any help would be appreciated. I think what I've written is actually
a pretty nice test suite, but with no combination of options, can
I get it to work ... Anytime I specify -fmyfile.out it will
lock up hard as a rock... I hope it's something stupid and small,
and not 'impossible'.
I've had the most success with
rmtsr -d1 -c1000 -s -r
but that doesn't ever call 'write()'
(Note that the file appears to be created with the open from
within the tsr, but no data is ever written).
Thanks!
-Brad
- Raw text -