Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!cs.utexas.edu!ico!nbires!maa From: maa@nbires.nbi.com (Mark Armbrust) Newsgroups: comp.sys.ibm.pc Subject: Re: Help from TSR Gurus requested Summary: PDB definition Keywords: TSR, PSP, Process, Allocation Message-ID: <426@nbires.nbi.com> Date: 14 Jul 89 20:40:28 GMT References: <536@cybaswan.UUCP> Reply-To: maa@nbires.UUCP (Mark Armbrust) Organization: NBI Inc, Boulder CO Lines: 45 In article <536@cybaswan.UUCP> iiit-sh@cybaswan.UUCP (Steve Hosgood) writes: > >Now the Question: Can the resident part of a TSR get away with using the area >below 5Ch? I would *think* that DOS has no further use for the PSP after the >program becomes resident, but of course the area may still figure >in some sort of linked-list internally in DOS. The first 5Ch bytes of the PSP are called the Process Data Block (PDB). The information in the PDB is used during program execution as well as program spawn and termination. The format of the DOS 3.3 PDB is: OFFSET SIZE CONTENTS ------ ---- -------- 00h 2 INT 20h instruction. 02h 2 Size of the process in paragraphs when it was started 04h 1 unused 05h 5 Far call to DOS -- Ancient CPM compatible OS call 0Ah 4 Far pointer to exit routine, normally points to instruction after spawn call in parent process. 0Eh 4 Far pointer to ^C interrupt routine. 12h 4 Far pointer to fatal error routine, normally points to code that gives you the "ABORT, RETRY, IGNORE?" message. 16h 2 Process ID (PID) of parent process 18h 20t Job File Number (JFN) table -- used to process's file handle into system file handles 2Ch 2 Segment address of process's environment variables 2Eh 4 Process stack pointer save area during system calls 32h 2 JFN table size 34h 4 Far pointer to JFN -- normally points to JFN table in PDB, but can be changed if the JFN table needs to be bigger. 38h 4 Pointer to next PDB in list -- I've never seen this to be any- thing other than 0FFFF:0FFFFh 3Ch 14h unused 50h 5 INT 21h; RETF; 0; 0 -- "Portable DOS call" interface 55h 7 unused As you can see, when a TSR is running on it's own PID (as it has to to do file operations), there are several things in the PDB that are still required. Hope this helps. -- Mark Armbrust maa@nbires.nbi.com maa@nbires.UUCP