Content deleted Content added
Artoria2e5 (talk | contribs) No edit summary |
mNo edit summary |
||
(7 intermediate revisions by 5 users not shown) | |||
Line 1:
{{Multiple issues|
{{refimprove|date=January 2014}}
{{Technical|date=October 2022}}
}}
{{Use dmy dates|date=May 2019|cs1-dates=y}}
A '''File Control Block''' ('''FCB''') is a file system structure in which the state of an open [[Computer file|file]] is maintained. A FCB is managed by the operating system, but it resides in the memory of the program that uses the file, not in operating system memory. This allows a process to have as many files open at one time as it wants
The FCB originates from [[CP/M]] and is also present in most variants of [[DOS]], though only as a
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 ⟶ 50:
|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
==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
FCBs were supported in all versions of MS-DOS and [[Microsoft Windows|Windows]] until the introduction of the [[FAT32]] filesystem. [[Windows 95]], [[Windows 98]] and [[Windows Me]] do not support the use of FCBs on FAT32 drives due to its 32-bit cluster numbers,<ref name="Chappell_1994_DOS-Internals"/><!-- While this source predates the introduction of FAT32, it discusses the various real and potential future limitations of the FCB approach and the cumbersome workarounds introduced in DOS 3, DOS 4 and DOS 5 to keep FCBs alive for a bit longer --> except to read the volume label. This caused some old DOS applications, including [[WordStar]], to fail under these versions of Windows.
Line 100 ⟶ 102:
{{Reflist|refs=
<ref name="Duncan_1988_MS-DOS_Encyclopedia">{{cite book |title=The MS-DOS Encyclopedia: versions 1.0 through 3.2 |author-first1=Ray |author-last1=Duncan |author-first2=Steve |author-last2=Bostwick |author-first3=Keith |author-last3=Burgoyne |author-first4=Robert A. |author-last4=Byers |author-first5=Thom |author-last5=Hogan |author-first6=Jim |author-last6=Kyle |author-first7=Gordon |author-last7=Letwin |author-link7=Gordon Letwin |author-first8=Charles |author-last8=Petzold |author-link8=Charles Petzold |author-first9=Chip |author-last9=Rabinowitz |author-first10=Jim |author-last10=Tomlin |author-first11=Richard |author-last11=Wilton |author-first12=Van |author-last12=Wolverton |author-first13=William |author-last13=Wong |author-first14=JoAnne |author-last14=Woodcock |contribution=Technical advisors |contributor-first1=Mark |contributor-last1=Zbikowski |contributor-link1=Mark Zbikowski |contributor-first2=Paul |contributor-last2=Allen |contributor-link2=Paul Allen |contributor-first3=Steve |contributor-last3=Ballmer |contributor-link3=Steve Ballmer |contributor-first4=Reuben |contributor-last4=Borman |contributor-first5=Rob |contributor-last5=Borman |contributor-first6=John |contributor-last6=Butler |contributor-first7=Chuck |contributor-last7=Carroll |contributor-first8=Mark |contributor-last8=Chamberlain |contributor-first9=David |contributor-last9=Chell |contributor-first10=Mike |contributor-last10=Colee |contributor-first11=Mike |contributor-last11=Courtney |contributor-first12=Mike |contributor-last12=Dryfoos |contributor-first13=Rachel |contributor-last13=Duncan |contributor-first14=Kurt |contributor-last14=Eckhardt |contributor-first15=Eric |contributor-last15=Evans |contributor-first16=Rick |contributor-last16=Farmer |contributor-first17=Bill |contributor-last17=Gates |contributor-link17=Bill Gates |contributor-first18=Michael |contributor-last18=Geary |contributor-first19=Bob |contributor-last19=Griffin |contributor-first20=Doug |contributor-last20=Hogarth |contributor-first21=James W. |contributor-last21=Johnson |contributor-first22=Kaamel |contributor-last22=Kermaani |contributor-first23=Adrian |contributor-last23=King |contributor-first24=Reed |contributor-last24=Koch |contributor-first25=James |contributor-last25=Landowski |contributor-first26=Chris |contributor-last26=Larson |contributor-first27=Thomas |contributor-last27=Lennon |contributor-first28=Dan |contributor-last28=Lipkie |contributor-first29=Marc |contributor-last29=McDonald |contributor-link29=Marc McDonald |contributor-first30=Bruce |contributor-last30=McKinney |contributor-first31=Pascal |contributor-last31=Martin |contributor-first32=Estelle |contributor-last32=Mathers |contributor-first33=Bob |contributor-last33=Matthews <!-- |contributor-link33=Robert Matthews (scientist)??? --> |contributor-first34=David |contributor-last34=Melin |contributor-first35=Charles |contributor-last35=Mergentime |contributor-first36=Randy |contributor-last36=Nevin |contributor-first37=Dan |contributor-last37=Newell |contributor-first38=Tani |contributor-last38=Newell |contributor-first39=David |contributor-last39=Norris |contributor-first40=Mike |contributor-last40=O'Leary |contributor-first41=Bob |contributor-last41=O'Rear |contributor-link41=Bob O'Rear |contributor-first42=Mike |contributor-last42=Olsson |contributor-first43=Larry |contributor-last43=Osterman |contributor-first44=Ridge |contributor-last44=Ostling |contributor-first45=Sunil |contributor-last45=Pai |contributor-first46=Tim |contributor-last46=Paterson |contributor-link46=Tim Paterson |contributor-first47=Gary |contributor-last47=Perez |contributor-first48=Chris |contributor-last48=Peters |contributor-first49=Charles |contributor-last49=Petzold |contributor-link49=Charles Petzold |contributor-first50=John |contributor-last50=Pollock |contributor-first51=Aaron |contributor-last51=Reynolds |contributor-link51=Aaron R. Reynolds |contributor-first52=Darryl |contributor-last52=Rubin |contributor-first53=Ralph |contributor-last53=Ryan |contributor-first54=Karl |contributor-last54=Schulmeisters |contributor-first55=Rajen |contributor-last55=Shah |contributor-first56=Barry |contributor-last56=Shaw |contributor-first57=Anthony |contributor-last57=Short |contributor-first58=Ben |contributor-last58=Slivka |contributor-first59=Jon |contributor-last59=Smirl |contributor-first60=Betty |contributor-last60=Stillmaker |contributor-first61=John |contributor-last61=Stoddard |contributor-first62=Dennis |contributor-last62=Tillman |contributor-first63=Greg |contributor-last63=Whitten |contributor-first64=Natalie |contributor-last64=Yount |contributor-first65=Steve |contributor-last65=Zeck |date=1988 |edition=Completely reworked |publisher=[[Microsoft Press]] |___location=Redmond, Washington, USA |isbn=1-55615-049-0 |lccn=87-21452 |oclc=16581341}} (xix+1570 pages; 26 cm) (NB. This edition was published in 1988 after extensive rework of the withdrawn 1986 first edition by a different team of authors. [https://www.pcjs.org/pubs/pc/reference/microsoft/mspl13/msdos/encyclopedia/])</ref>
<ref name="Chappell_1994_DOS-Internals">{{cite book |title=DOS Internals |author-first=Geoff |author-last=Chappell |editor-first1=Andrew |editor-last1=Schulman |editor-first2=Amorette |editor-last2=Pedersen |date=January 1994 |
<ref name="Paul_1997_NWDOSTIP">{{cite book |title=NWDOS-TIPs — Tips &
<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>
}}
Line 108 ⟶ 111:
* {{cite web |title=210F: DOS 1+ - OPEN FILE USING FCB |editor-first=Ralf D. |editor-last=Brown |editor-link=Ralf D. Brown |date=2000-07-17 |work=[[Ralf Brown's Interrupt List]] 61 |publisher=ctyme.com |url=http://www.ctyme.com/intr/rb-2574.htm |url-status=dead |archive-url=https://web.archive.org/web/20160619060655/http://www.ctyme.com/intr/rb-2574.htm |archive-date=2016-06-19}} [http://www.delorie.com/djgpp/doc/rbinter/id/85/25.html]
* {{cite web |author-first=John C. |author-last=Elliott |title=CP/M File Control Block |date=2002-12-29 |work=Seasip.info |url=http://seasip.info/Cpm/fcb.html |access-date=2017-08-23 |url-status=live |archive-url=https://web.archive.org/web/20170823020604/http://seasip.info/Cpm/fcb.html |archive-date=2017-08-23}}
* {{cite web |title=CP/M Internals |date=2017-08-23 |url=http://obsolescence.wix.com/obsolescence#!cpm-internals/c247i |access-date=2017-08-23 |url-status=
{{Digital Research}}
|