Article View: alt.msdos.programmer
Article #298Re: file positioning with buffered/unbuffered I/O
From: Stokes Kevin
Date: Tue, 25 Aug 1992 18:29
Date: Tue, 25 Aug 1992 18:29
36 lines
2519 bytes
2519 bytes
(Christopher H Gregg) writes:
>The program is memory resident and it traps......
>The problem is that when I try to use either DOS function 13h (delete file)
>or DOS function 41h (which I would prefer), the program crashes.
You can't make DOS calls from within a TSR casually. DOS is not re-entrant,
meaning that if your TSR interrupts the computer while it happens to be in
a DOS routine, and then turn around and call a DOS routine yourself the system
will quickly crash.
The reason is that DOS uses static variables to save info when you make
a DOS call. Thus when you make your DOS call it messes up the variables that
were setup by the DOS call your TSR interrupted. Then when you try to
return control back, the machine immediately flies into lollyland.
To find out whether it is OK for your TSR to pop up requires checking the
DOS internal In-service flag. This is an undocumented location that you
find by making an undocumented system call.
Yuck. DOS is a piss-poor excuse for an operation system. My old Data
General minicomputer (circa 1972) had a really nice true multi-tasking OS
which fit in less than 16k. They should have just ported that. Of course,
there is a famous Bill Gates quote "Our goal is for user to not even know
there is an operating system there at all." (not exact)
In my opinion he has already achieved this with DOS. He has convinced the
whole world to use computers with no operation system, just a nice binary
loader!
-Kevin
--
------------------------------------------------------------------------------
| Kevin Stokes | Please direct all pointless |
| Pie in the Sky Software | flames to my mailbox, it's much |
| | more irritating. |
Technical Details
Message-ID:
<4855@news.duke.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!gatech!concert!duke!news.duke.edu!phy.duke.edu!kdsReferences:
<1992Aug8.111834.19417@klaava.Helsinki.FI> <1992Aug10.205740.4357@irscscm.UUCP> <1992Aug25.153322.13793@jhunix.hcf.jhu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!concert!duke!news.duke.edu!phy.duke.edu!kds From: kds@phy.duke.edu (Stokes Kevin) Newsgroups: alt.msdos.programmer,comp.lang.c,comp.os.msdos.programmer Subject: Re: file positioning with buffered/unbuffered I/O Message-ID: <4855@news.duke.edu> Date: 25 Aug 92 18:29:31 GMT References: <1992Aug8.111834.19417@klaava.Helsinki.FI> <1992Aug10.205740.4357@irscscm.UUCP> <1992Aug25.153322.13793@jhunix.hcf.jhu.edu> Sender: news@news.duke.edu Followup-To: alt.msdos.programmer Organization: Duke University Physics Dept.; Durham, N.C. Lines: 36 Nntp-Posting-Host: physics.phy.duke.edu