Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version nyu B notes v1.5 12/10/84; site acf4.UUCP Path: utzoo!linus!philabs!cmcl2!acf4!tsc2597 From: tsc2597@acf4.UUCP (Sam Chin) Newsgroups: net.micro.pc Subject: Re: Summary about DOS and Interrupts Message-ID: <1050033@acf4.UUCP> Date: Sun, 12-May-85 21:19:00 EDT Article-I.D.: acf4.1050033 Posted: Sun May 12 21:19:00 1985 Date-Received: Tue, 14-May-85 07:54:52 EDT References: <84@tekig5.UUCP> Organization: New York University Lines: 32 <> 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