Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!soleil!mlb.semi.harris.com!trantor.harris-atd.com!charybdis!sonny From: sonny@charybdis.harris-atd.com (Bob Davis) Newsgroups: comp.os.msdos.programmer Subject: Re: Backgroup processing (Was Re: DOS idle interrupt (INT28)) Message-ID: <5187@trantor.harris-atd.com> Date: 5 Jan 91 14:25:24 GMT References: <5094@trantor.harris-atd.com> <1537@netmbx.UUCP> <1990Dec19.050307.16450@engin.umich.edu> <1991Jan5.043055.17637@bronze.ucs.indiana.edu> Sender: news@trantor.harris-atd.com Reply-To: sonny@trantor.harris-atd.com (Bob Davis) Distribution: comp Organization: Advanced Technology Dept., Harris ESS, Melbourne, FL Lines: 57 In article <1991Jan5.043055.17637@bronze.ucs.indiana.edu> yawei@bronze.ucs.indiana.edu (mr. yawei) writes: >I am not sure if I should advertise this, but in my opinion, the best >place to do background processing is the BIOS buffered keyboard >interrupt (Int 16H). Reasons: > [DELETIONS] >If you must use the timer interrupts, appending to int 8 is preferrable >than attaching to int 1Ch. > Could you please elaborate. Other things I have read (e.g. Dettmann's _DOS Programmer's Reference 2nd Edition_, page 417) recommend hooking to 1Ch in preference to 08. I confess that I do not understand a preference for EITHER over the other, since 1Ch is called by 08 and both block further hardware interrupts until done. >Keyboard interrupt (09h): this only happens when a key is struck. System >could also be in unstable conditions (for this reason, I don't recommend >doing anything useful(!) in the background by hooking to any hardware >generated interrupts). > Even if adequate safeguards against DOS re-entrancy are employed? Which you have to do - do you not? - even when hooked to INT16. [DELETIONS] >What's so good about int 16h? >- it's (almost) always there. Most of the time it is called even more > frequently than the timer interrupts. It's called whether of not a > key has been hit. The only times int 16h is inactive is when the Are you saying that DOS frequently calls this INT16 even though no INT09 (Key press hardware interrupt) has occurred? Why does it do that? > >You should still carefully check the DOS flags (InDOS flag and Critical >Error flag) and maybe even the interrupt controller status. Just as if you had triggered on INT09, for example? Doesn't this somewhat decreased the presumed advantage to hooking INT16? > Someone >could have carelessly issued an int 16h from inside a hardware >interrupt (the same risk with simulated int 28h's). > What is the bad thing about calling INT16 from inside a hardware interrupt handler? >Comments/discussions are welcome. > Thank you for your interesting posting. I stand to learn a great deal from it about the complex subject of background processing under DOS. _____________________________________________________________________________ Bob Davis, UofALA alum \\ INTERNET: sonny@trantor.harris-atd.com | _ _ | Harris Corporation, ESS \\ UUCP: ...!uunet!x102a!trantor!sonny |_| |_| | | Advanced Technology Dept.\\ AETHER: K4VNO |==============|_/\/\/\|_| PO Box 37, MS 3A/1912 \\ VOICE: (407) 727-5886 | I SPEAK ONLY | |_| |_| | Melbourne, FL 32902 \\ FAX: (407) 729-2537 | FOR MYSELF. |_________|