home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 7897 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  2.2 KB

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!mcsun!sunic!ericom!etlxd10h!etljmme
  2. From: etljmme@etlxd30.ericsson.se (Jim)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: TSR Problem
  5. Message-ID: <1993Jan6.105050.5402@ericsson.se>
  6. Date: 6 Jan 93 10:50:50 GMT
  7. Sender: news@ericsson.se
  8. Organization: Ericsson
  9. Lines: 40
  10. Nntp-Posting-Host: etlxd10h.ericsson.se
  11.  
  12. In article 29739@physchem.ox.ac.uk, mark@physchem.ox.ac.uk (Mark) writes:
  13. >
  14. >The main thing to consider when writing TSRs, is that you must NOT call any dos
  15. >functions.  If you do and other software calls the same function you will lock it
  16. >up.  Dos functionf can only be called once at a time.
  17. >
  18. >
  19. >Mark
  20.  
  21. Hi all.
  22.  
  23. This is not true.  If it was then any useful TSR from PRINT.COM upwards wouldn't
  24. exist.  If you write a TSR solely consisting of, say, an INT handler and the
  25. Keep() function then yes, you'll lock up your PC but it is possible to write a 
  26. TSR that can call dos functions, the trick is that you mustn't do it at the
  27. same time that another process is using a dos function.  I think this is what
  28. Mark meant.
  29.  
  30. If memory serves, this is what you need to do:  (This is from memory, so it
  31. probably isn't complete/correct.  No doubt someone will fill in the blanks!).
  32.  
  33. Check the InDos flag (true if in dos function.  This is always true if you are
  34. at the dos prompt because command.com uses a dos function to get a command!)
  35. I think InDos is sometimes called DosBusy?  Anyone verify?
  36.  
  37. Use the GetPSP and SetPSP functions to swap from the current process to your
  38. TSR process.  Basically, what you aim to do is simulate re-entrance for your
  39. TSR (because DOS isn't!).  I've glossed over alot, here.  Partly because I
  40. can't remember off-hand and partly because I'd rather shuttup than give out
  41. misinformation.  Look out a copy of UNDOCUMENTED DOS; it gives extensive
  42. info on TSR's in chapter 5 and describes how to do the above (in C/ASM).
  43.  
  44. Maybe Timo has some TSR code in his garbo FTP archives?
  45.  
  46. Jim.
  47. __________________________________________________________________________
  48. Jim Moore.                                     etljmme@etlxd20.ericsson.se
  49.  
  50. My mail doesn't work because my sysadmin has buggered up the NFS mounts in
  51. /usr/spool/mail.  You'll have to abuse me here (or in alt.flame!)
  52.