X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Message-ID: <43E8F9ED.1070208@mainstreetsoftworks.com> Date: Tue, 07 Feb 2006 14:50:05 -0500 From: Brad House User-Agent: Mail/News 1.5 (X11/20060131) MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: TSR issues (with code) References: <43E12016 DOT 2070308 AT mainstreetsoftworks DOT com> <7t88b3-d2q DOT ln1 AT news DOT infowest DOT com> <43E1863D DOT 8080308 AT mainstreetsoftworks DOT com> <43E216B4 DOT 70509 AT mainstreetsoftworks DOT com> <43E243F8 DOT 7060401 AT mainstreetsoftworks DOT com> <1o8ab3-2i71 DOT ln1 AT news DOT infowest DOT com> <43E2C6DA DOT 4080700 AT mainstreetsoftworks DOT com> <4mcbb3-q1f1 DOT ln1 AT news DOT infowest DOT com> <43E3884C DOT 8050308 AT mainstreetsoftworks DOT com> <0naeb3-s442 DOT ln1 AT news DOT infowest DOT com> <43E587DC DOT 6080801 AT mainstreetsoftworks DOT com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com 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