File Headers

How file headers are laid out.

For starters, here are the definitions given in R75DEFS file.
Keep in mind that there are 0400 (256 dec) words in the header block, just like every other disk block on IRIS.

; HEADER BLOCK DISPLACEMENTS (SEE MANAGER MANUAL)

.DUSR NAME = 0  ;FILENAME STRING (7 WORDS)
.DUSR ACNT = 7  ;PRIV LEVEL, ACCOUNT (GROUP, USER)
.DUSR TYPE = 10 ;FILE TYPE AND PROTECTION
.DUSR NBLK = 11 ;NUMBER OF BLOCKS IN FILE (INCL. HEADER)
.DUSR STAT = 12 ;FILE STATUS (SEE below)
.DUSR NITM = 13 ;NUMBER OF ITEMS PER RECORD       \  ALSO
.DUSR LRCD = 14 ;LENGTH OF EACH RECORD (# WORDS)   ) USED
.DUSR NRPB = 15 ;NUMBER OF RECORDS PER BLOCK       )  BY
.DUSR NRCD = 16 ;NUMBER OF RECORDS IN FILE        /  DSP.
.DUSR COST = 17 ;DIMES CHARGED FOR ACCESS TO FILE
.DUSR CHGS = 20 ;TOTAL CHARGES FOR FILE USAGE (2 WORDS)
.DUSR LDAT = 22 ;LAST ACCESS DATE (HOURS, TENTH-SECONDS)
.DUSR CDAT = 24 ;FILE CREATION DATE (HOURS, TENTH-SECONDS)
.DUSR NTAC = 26 ;NUMBER OF TIMES ACCESSED
.DUSR CATR = 27 ;"CATALOG" RECORD NUMBER
.DUSR CLAS = 30 ;CATALOG CLASSIFICATION (2 WORDS)
 ;           32-34   (SPARE)
.DUSR PPRI = 35 ;PROGRAM'S ASSIGNED PRIORITY
.DUSR SNUM = 36 ;SCO NUMBER OF LAST SCO APPLIED
.DUSR ADAT = 37 ;DATE LAST SCO APPLIED (HOURS AFTER 1-1-76)
.DUSR DASA = 40 ;DECIMAL ACCUMULATOR SAVE AREA (10 WORDS)
.DUSR DSPS = 50 ;STORAGE FOR DSP (20 WORDS)
.DUSR FMAP = 70 ;DATA FILE FORMAT MAP (101 WORDS)
.DUSR HTEM =171 ;TEMP CELL USED BY ALLOC, DALLC & ACNTL
.DUSR STAD =172 ;START ADDRESS (DRIVER OR STAND-ALONE)
.DUSR ABLK =173 ;NUMBER OF ACTIVE DATA BLOCKS
.DUSR DSAF =174 ;DEFAULT SIZE OF ACTIVE FILE (# BLOCKS)
.DUSR CORA =175 ;CORE ADDRESS OF FIRST DATA BLOCK
.DUSR UNIT =176 ;LOGICAL UNIT NUMBER WHERE FILE RESIDES
.DUSR DHDR =177 ;REAL DISC ADDRESS OF HEADER BLOCK

STAT:
100000 = File is being built, not yet closed
 40000 = A file is being built to replace this one
 20000 = File is to be deleted when no longer open
 10000 = File is mapped (formatted data file)
  4000 = File has been opened with an OPENLOCK
  2000 = File is not deleteable
     1 = File is extended

TYPE:
40000 = File is read protected against lower priv level users
20000 = File is write protected "         "   "     "     "
10000 = File is copy protected  "         "   "     "     "
 4000 = File is read protected against same priv level users
 2000 = File is write protected   "      "    "    "    "
 1000 = File is copy protected    "      "    "    "    "
  400 = This is an executable processor
  200 = Automatically Load user's active file when run
  100 = Start INPUT before the first swap-in (e.g. BASIC)
   40 = Process may be locked in core
   37 = Bits contain the file's type

File Types
 0 = permanent system file
 1 = system utility file, system device ($DEC), or processor
 2 = BASIC, RUN, RUNMAT, and Basic programs
 3 = Stand-alone assembly program (DISCUTILITY)
 4-17 (other matched file types, similar to BASIC)
20-27 = special file types (unknown usage)
30 = Text File
31 = Formatted Data File
32 = Contiguous data file
33 = ?
34 = ?
35 = ?
36 = peripheral driver ($LPT)
37 = (special code used in ASM progs to open any file type)

For most files, the most significant words here are the ones from 0 to 016, and everything from 0176 thru the end. This overview will begin with those words.

NAME (0): These 14 (dec) bytes are the filename, which is identical to its entry in the INDEX for that LU.

UNIT (176): This is the logical unit of the file. This may seem redundant, since you cannot access the file header unless you know the LU, but it helps to verify the integrity of the system.

DHDR (177): RDA of this header block. Again, for integrity purposes and to simplify logic in programs that have to keep track of all the blocks in a file.

ACNT (7): The owner’s account number. This is broken down into Privilege level, Group, and User. Nothing much ever came of this, as time sharing never really caught on with IRIS. But for simplicity, files owned by the SYSTEM are 140000 (Priv=3, Grp=0, User=0), those owned by MANAGER are 100001 (Priv=2, Grp=0, Usr=1).

TYPE (10): This is extremely important. It determines much of how a file is handled by the system. As can be seen from the TYPE breakdown and the ‘File Types’ above, these bits are very important. If you COPY certain file types, the COPY command will modify this word, and you will have to reset it using DSP if you want to use the file the same way as the original.

NBLK (11): The total number of blocks in the file, including the header. For contiguous files this is the only way of determining the RDA of the last block of the file (header RDA + NBLK – 1). For all other files, it tells you how many entries there are from 200 on in the header.

STAT (12): Another important word (see above breakkdown). Bit 1 is especially significant in non-contiguous files. If set, the RDA’s in cells 200-377 are not data blocks, but extender blocks, each of which contain up to 400 RDA’s of data blocks.

Record Structure (13-16): The meaning of these words varies from one file type to another. Exactly how they are used is not entirely clear. Although some of this information is copied to a user’s Channel info area when a file is opened. “Records” in IRIS do not have any ‘start’ or ‘end-of-record’ markers (except on mag tapes). They are simply displacements within the file, consisting of a certain # bytes.

LDAT, NTAC (22-23, 26): Updated when file is opened.

CDAT (24-25): System date when file is created.

CATR, CLAS (27-31): Catalog info. Unknown purpose.

PPRI (35):

SNUM, ADAT (36-37): Acts like a version # for patches applied to programs.

DASA (40-45): Only known use is in the Active File Header. Saves the contents of the Decimal Accumulator (in page zero) while swapped out.

(46-47): Holds address and #words which processor wants swapped in and out by system routines.

DSPS (50): In the Active File, this is used by DSP between time slices (and for breakpoints?)

FMAP (70-170): Multiple uses. (a) Holds record layout for formatted data files; (b) Holds directory info for Indexed contiguous files; (c) Holds processor data in Active File Hdr during swaps (based on values in 46 and 47)

HTEM (171): Used by some discsubs for temp storage; also holds original program LU in Active File Hdr.

STAD (172): For Stand-Alone programs (type 3) this is the address to begin execution; for $drivers, this value is set by SIR. In the case of $device drivers, this is the memory address for the driver INIT routine (OPEN); for $system drivers, it is the address of the 1st word of the driver in memory (+100000); for a minimum IPL in which drivers are not loaded, this is set to 177777.

ABLK (173): For active file, holds actual # blocks to be swapped (can change each time slice).

DSAF (174): set by SIR; not used anywhere in REX or Discsubs. Actual purpose is unknown, probably an obsolete value.

CORA (175): Depends on file type. For processors, usually 200, where the processor’s page zero is loaded. For drivers, usually BPS, which is 10200 in IRIS 7.5. For type 3 files, it would indicate where in memory the file should be loaded.

(200-377): File RDAs. For normal randomly allocated files, this is the list of blocks in the file. If it is an executable file, then CORA is where the block in cell 200 would be loaded, every block after that would be loaded at 0400 word increments (skipping zero value RDA’s). For extended random files, this list contains RDA’s of blocks that contain actual data blocks (using all 0400 words). Contiguous files do not use these cells.

Leave a Reply