[comp.sys.ibm.pc.misc] Multitasking MSDOS

s71119@zeus.usq.edu.au (wolfe glen) (08/16/90)

Hi MSDOS gurus, TSR writers, MSDOS "Multitaskers" writers:

                             HELP
ACKGROUND

I am writing a process controller intended to run under MSDos on an 
PC XT compatible using TurboC V2.0.  The processes are all rather slow
and so processing each of them takes some time.

PROJECT

To enable changing setpoint values etc etc, I have redirected the keyboard
interrupt (int 0x9) to set a flag so that a command parser can be started
by the clock interrupt (int 0x8 rather than 0x1c for reentrancy problems).
This approach has been used to allow later modification to allow set
point control/interrogation by means of a COM: port.
I have treated the problem as a TSR without exiting the spawning program.

My references have primarily been:

Stevens, Al "TurboC - Memory-Resident Utilities, Screen I/O and
      Programming Techniques"

Hyman, Michael "Advanced DOS - Memory-Resident Utilities, Interrupts
   and Disk Management with MS and PC-DOS"

Simrin, Steven "The Waite Group's MS-DOS Bible 3rd Ed."

PROBLEM

The resultant program basically works but is intermittently unstable
(i.e. crashes, jumping off to all regions of memory). This degree of
stability has been achieved after hacking some of the TC-compiled assembler
code (to make it smaller, use RET 2 at the end of the disk interrupt
to preserve registers etc etc).

SOME THOUGHTS

Does anyone know of the reentrancy status of TurboC code/subroutines -
I mean more than whether DOS or BIOS routines are used? Are there any
sneaky stack swaps or something anywhere?

Are BIOS routines reentrant?


Any comments AAARRRGGGHHH!!!! (emotive cry of desparation), anything at
all, with regard to this problem, the references I have cited, something
I am likely to have missed etc. etc. etc. would be appreciated.
I suspect that further email discussion would be required/appropriate. 

Thanks for reading.