Article View: alt.msdos.programmer
Article #1284Re: ms-dos FILES=fd in config.sys parameter
From: walt dixon
Date: Sun, 04 Mar 1990 00:41
Date: Sun, 04 Mar 1990 00:41
56 lines
3343 bytes
3343 bytes
In a previous article Craig Curtin writes:
>i am having a problem using MS-DOS 4.01 with the number of file
>descriptors available. i changed config.sys to files=100 but cannot
>get ms-dos to exceed 20 (the pre-dos3.3 maximum).
[text deleted]
>is there a way for dos to tell me the current maximum number of
>file descriptors available? (while ms-dos is running?)
>(i know that you can "type c:\config.sys", but is there any other
>way to dump the max_index_length of the fd table?)
I can't say a whole lot about MS-DOS 4.01. I can explain what is
going on in the context of DOS 3.x, and I would be surprised if
things were done appreciably different in DOS 4.x. DOS maintains
a table in low memory called the System File Table (or SFT). This
table contains the current file position, the end of file position,
owner PSP, reference count, pointer to the device driver, status,
and some other information about every file/device opened by handle.
The files= config.sys entry specifies the maximum size of the SFT.
Within the PSP DOS maintains another table named the Job File Table
or JFT. (Actually the size and address of the JFT must be here;
the default table is also in the PSP). There is room in the default
JFT for 20 entries. Indexed by file handle this table contains an
index into the SFT. Since a program inherits some some handles from
COMMAND.COM, a program cannot open 20 new files without closing
stdin, stdout, etc.
Under DOS 3.3 there is an int 21h request to change the address of the
JFT. In previous DOS versions one could change the address and size
of the JFT in the PSP to increase the number of open files. In order
to have more than 20 open file handles, one must create a new JFT.
When working in a high level language such as C, there are other data
structures which may limit the number of open files. In particular
the C runtime library has a structure typically known as an iob for each
file descriptor. Depending on the implementation of the run time
library, you may have to do some work to increase the number of these
structures.
The ultimate limit on the number of open files in DOS 3.x was 255 because
the SFT index had to fit into a 1 byte JFT entry.
If you want a more complete description of what is going on, take a look
at Chapter 10 of "The MS-DOS Papers", (Howard Sams, 1988) and Chapter 4
of "The MS-DOS Developer's Guide, 2nd Edition", (Howard Sams, 1988).
BTW I am the author of those chapters. I get no royalties from book sales;
I'm just citing a good reference.
Walt Dixon {arpa: dixon@crd.ge.com }
{us mail: ge crd }
{ po box 8 }
{ schenectady, ny 12301 }
{phone: 518-387-5798 }
Walt Dixon dixon@crd.ge.com
Technical Details
Message-ID:
<5751@crdgw1.crd.ge.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!crdgw1!sagittarius!dixonReferences:
<13340@cbnewse.ATT.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!crdgw1!sagittarius!dixon From: dixon@sagittarius.crd.ge.com (walt dixon) Newsgroups: alt.msdos.programmer,comp.sys.ibm.pc Subject: Re: ms-dos FILES=fd in config.sys parameter Keywords: config FILES MS4.01 Message-ID: <5751@crdgw1.crd.ge.com> Date: 4 Mar 90 00:41:14 GMT References: <13340@cbnewse.ATT.COM> Sender: news@crdgw1.crd.ge.com Reply-To: dixon@sagittarius.crd.ge.com (walt dixon) Followup-To: alt.msdos.programmer Organization: General Electric Corp. R&D, Schenectady, NY Lines: 56