home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sunic!corax.udac.uu.se!corax.udac.uu.se!sverkerw
- From: sverkerw@csd.uu.se (Sverker Wiberg)
- Newsgroups: comp.lang.c
- Subject: Re: Zapping TSR's
- Date: 10 Nov 1992 10:50:25 GMT
- Organization: CS, University of Uppsala, Sweden
- Lines: 31
- Message-ID: <1do45hINN6i0@corax.udac.uu.se>
- References: <rbassadi.4.0@cs1.uct.ac.za>
- NNTP-Posting-Host: minsk.docs.uu.se
- In-reply-to: rbassadi@cs1.uct.ac.za's message of Mon, 9 Nov 1992 11:10:01 GMT
-
- rbassadi@cs1.uct.ac.za (R BASSADIEN) writes:
- >I need to know how to:
- >Enable my TSR to unload itself (command line or other).
- >Allow my TSR to detect that it has already been loaded.
-
- The idea is to use the Multiplex (int 2f (?)) to open a comm link between
- the loaded TSR and a normal program (a not-yet-resident instance of the TSR).
- This will easily let your TSR find resident instances before installing itself.
-
- Unloading cannot be done solely from within the TSR or from the
- command line (Interrupt chains woult mess up, leaving later TSRs in
- the lurch if you just restore the interrupts.) but must be a teamwork
- between the resident and a normal program instance. The idea is that
- the program tells the resident (thru Multiplex) that it is time to
- unload. The resident will then raise an internal wait_for_unload
- flag, and will then wait for later TSRs to unload. When the TSR is at
- the end of each grabbed interrupt, they can be restored and the TSR
- will truly unload.
-
- I can point you at the book "Undocumented DOS" from Addison-Wesley by
- by Shulman, Kyle etc. (I think, I have it back home) for the details.
-
- The acid test of a TSR is the release of redirection files.
- C:\FOO> TSR > nul
- will open a link to nul in the TSR end and in the COMMAND.COM end,
- then closing the TSR end, leaving the COMMAND.COM end open, effectively
- reducing 'FILES=' with one. A *good* TSR should find this out and close
- the COMMAND.COM end by hand. This is also in "Undocumented DOS".
- --
- Sverker Wiberg <sverkerw@student.docs.uu.se>
- o===[---- Klia din hund p} magen.
-