[comp.sys.ibm.pc] TSR's

darrylo@hpsrli.HP.COM (Darryl Okahata) (07/28/88)

In comp.sys.ibm.pc, joseph@chromo.ucsc.edu (Joseph Reger) writes:

> Could someone help me to find some info on how to write TSR-s in general,
     [ ... ]
> Thanks,	Joseph			joseph@chromo.ucsc.edu
> 				reger@ucscc.BITNET

     Writing TSRs is not easy in general.  One of the best sources to
see how to write a TSR is Lane Ferris' STAYRES program.  This is a
(not-so-short) program, written in Turbo Pascal, that shows how a TSR is
written (sources are included).  You can find the sources on many BBSes
and commercial systems like CompuServe.  If you can't find a copy, I can
send one to you, but I only have Turbo Pascal V3.0 sources (not V4.0).
Please note that, while these sources are freely copyable, they cannot
be used for commercial purposes.

     -- Darryl Okahata
	{hplabs!hpccc!, hpfcla!} hpsrla!darrylo
	CompuServe: 75206,3074

Disclaimer: the above is the author's personal opinion and is not the
opinion or policy of his employer or of the little green men that
have been following him all day.

Ralf.Brown@B.GP.CS.CMU.EDU (07/29/88)

In article <665@ns.UUCP>, ddb@ns.UUCP (David Dyer-Bennet) writes:
}In article <250@westmark.UUCP>, dave@westmark.UUCP (Dave Levenson) writes:
}> What a `real device driver' can do is look like a disk file.  
}  I'd thought this was just a matter of getting into the name table, which
}is done automatically for device drivers.  Is there some reason a tsr couldn't
}put itself into the name table?  (Whatever the darned official name of the
}thing is).

Yes, it is possible, but undocumented.  For a character device (with a name, 
like CON or PRN), it is simply a matter of hooking into the device driver 
chain.  For a block device (which gets a drive letter), there are several 
other DOS data structures which have to be modified.  I'll let Walt Dixon go 
into the details there, since he's the expert on that subject.

The NUL device is always the first device in the driver chain, and can be 
found with the undocumented DOS call 52h (INT 21h/AH=52h).  On return, ES:BX
points to DOS's list of lists.  In DOS 2.x, the actual NUL device header 
starts at ES:[BX+17h], and in DOS 3.x it's ES:[BX+22h].

--
UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=-=-=- Voice: (412) 268-3053 (school)
ARPA: ralf@cs.cmu.edu  BIT: ralf%cs.cmu.edu@CMUCCVMA  FIDO: Ralf Brown 1:129/31
Disclaimer? I     |Ducharm's Axiom:  If you view your problem closely enough
claimed something?|   you will recognize yourself as part of the problem.

stratton@mrsvr.UUCP (Ninja Programmer) (06/28/89)

I need to find out some information about TSR's.
I was wondering if anyone out there can lead me
to a good source. I want to get the kind of 
information that will assist me in writing one,
as well as tell me a lot of the little gotchas
that need to be avoided. I do not have access to
anonymous ftp, so if you can mail the ref. I would
be grateful. If there is a need to, I will post a
summary of all information acquired.
-- 
  My address is stratton@mrsvr.uucp
				{uwvax, rutgers}uwmcsd1!mrsvr!stratton

			Thanx alot in advance         Greg S.

GU.MORRIS%SCIENCE.UTAH.EDU@wasatch.utah.edu (Richard Morris) (06/29/89)

An excellent discussion on TSR programming, including traps, potential problems,
etc. can be found in "The Waite Group's MS-DOS Developer's Guide" Second
Edition, published by Howard W. Sams & Company, 4300 West 62nd Street,
Indianapolis, Indiana  46268.

This is also an excellent reference for systems level or low-level applications
programming.

Heartily recommended.  I have found it an invaluable source of all kinds of
little known, yet extremely useful information about the MS-DOS operating
system.

ts@chyde.uwasa.fi (Timo Salmi LASK) (06/30/89)

In article <816@mrsvr.UUCP> stratton@mrsvr.UUCP (Ninja Programmer) writes:
>I need to find out some information about TSR's.
>I was wondering if anyone out there can lead me
>to a good source. I want to get the kind of 
>information that will assist me in writing one,

I have not (yet) programmed TSRs myself, but I have seen quite a lot
of information about them around.  A very recent source is a series
of two articles in Dr.  Dobb's Journal May and June 1989. 
Furthermore Stephen K O'Brien who writes very good Turbo Pascal
books, gives instructive code in his Turbo Pascal, The Complete
Reference, and in his Turbo Pascal Advanced Programmer's guide. 

...................................................................
Prof. Timo Salmi                                (Site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: vakk::salmi Bitnet: salmi@finfun