Content deleted Content added
Artoria2e5 (talk | contribs) No edit summary |
Matthiaspaul (talk | contribs) CE |
||
Line 5:
The FCB originates from [[CP/M]] and is also present in most variants of [[DOS]], though only as a backwards compatibility measure in [[MS-DOS]] versions 2.0 and later. A full FCB is 36 bytes long; in early versions of CP/M, it was 33 bytes. This fixed size, which could not be increased without breaking application compatibility, lead to the FCB's eventual demise as the standard method of accessing files.
The meanings of several of the fields in the FCB differ between CP/M and DOS, and also depending on what operation is being performed. The following fields have consistent meanings:<ref name="stanislavs"/>
{|class="wikitable"
|-
Line 47:
|align=right| 2 || Time of last modification.
|}
Further values were used by newer versions of DOS until new information could no longer fit in these 20 bytes. Some preceeding "negative offset" bytes were squeezed from reserved spaces in CP/M Zero Page and DOS [[Program Segment Prefix]] for storing file attributes.<ref name=stanislavs>{{cite web |title=FCB - Standard DOS File Control Block|work=HelpPC Reference Library|url=http://stanislavs.org/helppc/fcb.html}}</ref>▼
▲Further values were used by newer versions of DOS until new information could no longer fit in these 20 bytes. Some preceeding "negative offset" bytes were squeezed from reserved spaces in CP/M Zero Page and DOS [[Program Segment Prefix]] for storing file attributes.<ref name="stanislavs
==Usage==▼
▲==Usage==
In CP/M, [[86-DOS]] and [[PC DOS]] 1.x/MS-DOS 1.xx, the FCB was the only method of accessing files. Under DOS a few INT 21h subfunctions provided the interface to operate on files using the FCB.<ref name="stanislavs"/><ref name="Duncan_1988_MS-DOS_Encyclopedia"/><ref name="Chappell_1994_DOS-Internals"/> When, with MS-DOS 2, preparations were made to support multiple processes or users,<ref name="Duncan_1988_MS-DOS_Encyclopedia"/><ref name="Chappell_1994_DOS-Internals"/> use other filesystems<ref name="Duncan_1988_MS-DOS_Encyclopedia"/><ref name="Chappell_1994_DOS-Internals"/> than FAT or to share files<ref name="Chappell_1994_DOS-Internals"/> over networks in the future, FCBs were felt to be too small to handle the extra data required for such features<ref name="Chappell_1994_DOS-Internals"/> and therefore FCBs were seen as inadequate for various future expansion paths.<ref name="Duncan_1988_MS-DOS_Encyclopedia
If a program uses the newer file handle API to open a file, the operating system will manage its internal data structure associated with that file in its own memory area. This has the great advantage that these structures can grow in size in later operating system versions without breaking compatibility with application programs; its disadvantage is that, given the rather simplistic [[memory management]] of DOS, space for as many of these structures as the most "file-hungry" program is likely to use has to be reserved at boot time and cannot be used for any other purpose while the computer is running. Such memory reservation is done using the [[FILES (CONFIG.SYS directive)|FILES]]= directive in the [[CONFIG.SYS]] file. This problem does not occur with FCBs in DOS 1 or in CP/M, since the operating system stores all that it needs to know about an open file inside the FCB and thus does not need to use any per-file memory in operating system memory space. When using FCBs in MS-DOS 3 or later, the FCB format depends on if SHARE.EXE is loaded and if the FCB refers to a local or remote file and often refer to a SFT entry. Because of this, the number of FCBs which can be kept open at once in DOS 3 or higher is limited as well, usually to 4; using the [[FCBS (CONFIG.SYS directive)|FCBS]]= directive in the CONFIG.SYS file, it may be increased beyond that number if necessary. Under [[DR-DOS]], both FILES and FCBS come from the same internal pool of available handles structures and are assigned dynamically as needed.<ref name="Paul_1997_NWDOSTIP"/>
Line 103 ⟶ 102:
<ref name="Paul_1997_NWDOSTIP">{{cite book |title=NWDOS-TIPs — Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds |work=MPDOSTIP |author-first=Matthias R. |author-last=Paul |date=1997-07-30 |edition=3 |version=Release 157 |language=de |url=http://www.antonis.de/dos/dos-tuts/mpdostip/html/nwdostip.htm |access-date=2012-01-11 |url-status=live |archive-url=https://web.archive.org/web/20170823014801/http://www.antonis.de/dos/dos-tuts/mpdostip/html/nwdostip.htm |archive-date=2017-08-23}} (NB. NWDOSTIP.TXT is a comprehensive work on [[Novell DOS 7]] and [[OpenDOS 7.01]], including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.)</ref>
<ref name="Programacion_Ensamblador_MSDOS">{{cite book |author-first=Miguel |author-last=Rodriguez-Rosello |date=1992 |title=8088-8086/8087 Programacion Ensamblador En Entorno MSDOS |publisher=Ediciones Anaya Multimedia |isbn=84-7614-128-9 |language=es}}</ref>
<ref name="stanislavs">{{cite web |title=FCB - Standard DOS File Control Block |url=http://stanislavs.org/helppc/fcb.html}}</ref>
}}
|