Job File Table
Encyclopedia
The Job File Table is a DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

 data structure in the Program Segment Prefix
Program Segment Prefix
The Program Segment Prefix is a data structure used in DOS systems to store the state of a program. It resembles the Zero Page in the CP/M operating system...

 (PSP). It starts at PSP offset 0x18 and is 20 bytes long. For each open file handle, DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

 stores the index into the System File Table (SFT). A file handle that is returned by open, _open and other similar functions is simply an index into the JFT where DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

stored the SFT entry index for the file or device that the program opened.

When a program starts, the first 5 entries in the JFT are preconnected to the standard devices. All other handles are marked as closed by setting the value of the entry to 0xFF.
The standard devices are initialised as follows
Handle Description
0 standard input
1 standard output
2 standard error
Handles 0-2 are connected to the console device. During program execution they can get modified (closed, redirected) like any other handle.

Because the size of the JFT in the PSP is limited to 20 bytes, you could originally only open 15 files (20-5 standard devices). As of MS-DOS 2.0 the Extended Job File Table was introduced, which allowed to open up to 254 files.

As of MS-DOS 3.30 the size of the JFT can be modified with a call to INT 21h, 67h.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK