[net.micro.pc] Summary about DOS and Interrupts

janices@tekig5.UUCP (Janice Singer) (05/08/85)

In the replies to my queries about DOS and Interrupts, the following
appears to be true:

1)  You can use DOS function calls from within a user-defined interrupt
vector.  I have tried this myself by redefining INT 05H to output a
character to the screen (INT 21H - function 02H).  The catch is that
this only works when running an application.  IE if I am running Lotus
and I press Shift-PrtSc, a character is output, then I return to Lotus.
If I am at the command line (eg. A> ) and I press Shift-PrtSc, a
character is output to the screen, but I get lost in DOS hyperspace and
never return to the command line.  In fact I have to turn the machine 
off to continue.

2) It appears that there are no available listings of DOS.

3) The one consensus in all of my replies is that both IBM and MicroSoft
are reluctant to help users find answers to these types of questions.  I
have posted another article about a service called DIAL and hopefully
will get some replies.  One thing that I found out is that MicroSoft has
a service called TAR (Technical Assistance Request).  This service is in
conjunction with DIAL, but is FREE !!!!!  I am waiting for info, and if
it is worthwhile will post to the net.  It seems the best place to look
for technical assistance is the net.

To all who replied to me, THANKS

Janice Singer
Tektronix

tsc2597@acf4.UUCP (Sam Chin) (05/13/85)

<>
Regarding the question about calling interrupts from within interrupts:


Officially you can't because DOS keeps some local variables and is thus *not
reentrant*.  Even the bios is non reentrant (on the AT too so XENIX has to
completely bypass the BIOS).  Consider this bios example.  Two processes A
and B are doing access to the screen through interrupt 10h.  In order for
the bios to work, it must keep track of the current cursor position and
update the appropriate location in screen ram.  It must therefore have local
variables Row and Column indicating where the current cursor is.  If both
process A and B are updating the screen and are time sliced such that
process A loses control in the middle of a screen update, process B will
come along and clobber the Row and Column variables such that when process A
gains control it is no longer at the place it was supposed to be.  Another
example, you write an interupt routine that gets triggered whenever a
character is recieved on the serial port.  In the middle of a DOS interrupt,
DOS itself gets interrupted by a character arriving and your interrupt
routine gets control.  When DOS was interrupted it was in the middle of
doing some operations and was in the middle of updating some local variables
it keeps.  Now your interrupt routine issues the DOS interrupt again and
this clobbers those buffers which DOS was in the middle of processing.  When
you issue the IRET you get a branch back to where DOS was executing but its
local variables were clobbered so your original program may be in a strange
state.  If you are not dealing with hardware interrupts, it may be OK but
you cannot be guarenteed that it will work for sure.  The 8086/88
architechture allows for nested interrupts by saving return addresses on a
stack but the limitation is with MS-DOS and the BIOS.

Sam Chin
allegra!cmcl2!acf4!tsc2597
tsc2597.acf4@nyu