home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / c / 16285 < prev    next >
Encoding:
Internet Message Format  |  1992-11-10  |  2.0 KB

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