|
| 1 | +Copyright (c) 1999 Massachusetts Institute of Technology |
| 2 | +See the COPYING file at the top-level directory of this project. |
| 3 | +------------------------------ |
| 4 | + |
| 5 | +;Archive device format: |
| 6 | + |
| 7 | +;The first page of an archive device file is its directory. |
| 8 | +;The remaining pages are data. |
| 9 | + |
| 10 | +;The directory may not even be looked at unless the archive is "locked". |
| 11 | +.SEE LOCK,UNLOCK ;Only one ARCDEV can lock a given archive at a time. |
| 12 | +;Shuffling the directory should not be done in place, even when it is locked. |
| 13 | +;Instead, use DIRGET to make a copy and DIRPUT to store the copy back in. |
| 14 | +;When a file is open, the address of its data area is remembered in FILADR. |
| 15 | +;The data area of a file never moves, and the file can be open only in one |
| 16 | +;direction at a time, so reading or writing the data area requires no interlocking. |
| 17 | + |
| 18 | +;The format of the archive device directory is approximately that of |
| 19 | +;an I.T.S. UFD. The differences are: |
| 20 | + |
| 21 | +;In the fixed header, word 0 (UDESCP) contains SIXBIT /ARC1!!/ |
| 22 | +;Word 1 points to the beginning of the name area, as in UFDs. |
| 23 | +;Word 2 points to the end of the data area. |
| 24 | +;Word 3 is used to tell when the archive needs to be cleaned |
| 25 | +; because it is being touched for the first time since the system came up. |
| 26 | +;Word 4 contains what is supposed to be the creation date of the archive. |
| 27 | +; Since locking the archive device clobbers the creation date, |
| 28 | +; we store it here so we can restore it after clobbering it. |
| 29 | +;Word 5 similarly stores the dumped bit. |
| 30 | + |
| 31 | +;There is nothing analogous to the "descriptors" in a disk UFD. |
| 32 | + |
| 33 | + ;Random info in UFD |
| 34 | +UDESCP==0 ;SIXBIT /ARC1!!/ |
| 35 | +UDNAMP==1 ;Address in directory of first filename block. |
| 36 | +UDDATP==2 ;Address of first free word past data area of last file. |
| 37 | +UDINIT==3 ;Time of startup of last run of system during which this |
| 38 | + ;archive was cleaned (ARCCLN). If not same as startup time |
| 39 | + ;of this run of the system, we must do ARCCLN. |
| 40 | +UDCRDT==4 ;This word holds what ought to be the creation date |
| 41 | + ;of the archive device file itself. |
| 42 | + ;0 => this archive antedates the UDCRDT word, in which |
| 43 | + ;case it gets set from today's date. |
| 44 | +UDDMPB==5 ;This is like UDCRDT but stores the dumped bit. |
| 45 | + |
| 46 | +UDNMIN==10 ;If UDNAMP is less than this, there is no room for another filename block. |
| 47 | + |
| 48 | +;In each filename block, the UNFN1, UNFN2, UNDATE and UNREF words are |
| 49 | +;just as in UFDs. The UNRNDM word is slightly different: |
| 50 | + |
| 51 | +LUNBLK==5 ;Number of words in each filename block. |
| 52 | +UNFN1==0 ;First file name. |
| 53 | +UNFN2==1 ;Second file name. |
| 54 | +UNRNDM==2 ;All kinds of random info: |
| 55 | + ;The RH is the address in the file of the start of the file's data area header. |
| 56 | + ;The LH contains these bits: |
| 57 | + UNWRIT==4 ;Open for writing. Not actually maintained in the archive, |
| 58 | + ;Just reflected to the user when he reads ARC:.FILE. (DIR). |
| 59 | + UNCDEL==20 ;Delete this file when it is closed. |
| 60 | + UNIGFL==24 ;Bits to ignore file |
| 61 | + UNWRDC==301200,, ;Word count of last block mod 2000. |
| 62 | + ;This information really lives in UHWCNT, and is just reflected |
| 63 | + ;here when the user reads the image directory. |
| 64 | +UNDATE==3 ;Date and time file last modified. |
| 65 | + UNTIM==2200,, ;Compacted time of creation |
| 66 | + UNYMD==222000,, ;Y,M,D of creation |
| 67 | + UNMON==270400,, ;Month |
| 68 | + UNDAY==220500,, ;Day |
| 69 | + UNYRB==330700,, ;Year |
| 70 | +UNREF==4 ;Reference date same as left half of undate |
| 71 | + UNREFD==222000,, ;Reference date byte pointer |
| 72 | + UNAUTH==111100,, ;MFD index of author, all 1=> no directory. |
| 73 | + UNBYTE==001100,, ;File byte size and length info. |
| 74 | + ;LET S=BITS PER BYTE, C=COUNT OF UNUSED BYTES IN LAST WD |
| 75 | + ;400+100xS+C S=1 TO 3 C=0 TO 35. |
| 76 | + ;200+20xS+C S=4 TO 7 C=0 TO 8 |
| 77 | + ;44+4xS+C S=8 TO 18. C=0 TO 3 |
| 78 | + ;44-S S=19. TO 36. C=0 |
| 79 | + ;NOTE THAT OLD FILES HAVE UNBYTE=0 => S=36. |
| 80 | + |
| 81 | + |
| 82 | +;The data of a file starts with two words of header information: |
| 83 | +UHWCNT==0 ;Total length of the file's data, including header, in words. |
| 84 | +UHREFC==1 ;RH: Number of archives using the file, in either direction. |
| 85 | + ;LH: -1 if file open for writing. |
| 86 | +UHNAMP==2 ;Unused |
| 87 | +UHBLEN==3 ;Length of this header; offset to 1st actual data word. |
| 88 | + |
0 commit comments