4.10 Section Four

Section Four is concerned with files and file systems.

A file system is a set of files and associated tables and directories organised onto a single storage device such as a disk pack.

This section covers the means of creating and accessing files; locating files via directories organising and maintaining file systems. It also includes the code for an exotic breed of file called a “pipe”.

file.h

[Sheet 55; Chapter 18] defines the “file” structure and array.

filsys.h

[Sheet 55; Chapter 20] defines the “filsys” structure which is copied to and from the “super block” on “mounted” file systems.

ino.h

[Sheet 56] describes the structure of “inodes” as recorded on the “mounted” devices. Since this file is not “included” in any other, it really exists for information only.

inode.h

[Sheet 56; Chapter 18] defines the “inode” structure and array. “inodes” are of fundamental importance in managing the accesses of processes to files.

sys2.c

[Sheets 57..59; Chapters 18, 19] contains a set of routines associated with system calls including “read”, “write”, “creat”, “open” and “close”

sys3.c

[Sheets 60, 61; Chapters 19, 20] contains a set of routines associated with various minor system calls.

rdwri.c

[Sheets 62, 63; Chapter 18] contains intermediate level routines involved with reading and writing files.

subr.c

[Sheets 64, 65; Chapter 18] contains more intermediate level routines for i/o, especially “bmap” which translates logical file pointers into physical disk addresses.

fio.c

[Sheets 66..6; Chapters 18, 19] contains intermediate level routines for file opening, closing and control of access.

alloc.c

[Sheets 69..72; Chapter 20] contains procedures which manage the allocation of entries in the “inode” array and of blocks of disk storage.

iget.c

[Sheets 72..74; Chapters 18, 19, 20] contains procedures concerned with referencing and updating “inodes”.

nami.c

[Sheets 75, 76; Chapter 19] contains the procedure “namei” which searches the file directories.

pipe.c

[Sheets 77, 78; Chapter 21] is the “device driver” for “pipes” which are a special form of short disk file used to transmit information from one process to another.