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