[ Pobierz całość w formacie PDF ]

and \ mfree" which are used to manage mem-
Only one instance of the \user" structure is
ory resources.
ever accessible at one time. This is referenced
under the name \u" and is in the lowaddress
part of a 1024 byte area known as the \ per
4.8 Section Two
process data area".
Section Two is concerned with traps, hardware in-
In general the complete \h" les are not anal-
terrupts and software interrupts.
ysed in detail later in this text. It is expected
Traps and hardware interrupts introduce sud-
that the reader will refer to them from time
den switches into the CPU's normal instruction ex-
to time (with increasing familiarity and un-
ecution sequence. This provides a mechanism for
derstanding).
handling special conditions which occur outside the
CPU's immediate control.
Use is made of this facility as part of another
4.6 Assembly Language Files
mechanism called the \system call" whereby a user
There are two les in assembly language which com- program may execute a \trap" instruction to cause
prise about 10% of the source code. A reasonable a trap deliberately and so obtain the operating sys-
acquaintance with these les is necessary. tem's attention and assistance.
The software interrupt (or \signal" is a mecha- conf.h [Sheet 46 Chapter 15] de nes the arrays
nism for communication between processes, partic- of structures \bdevsw" and \cdevsw" which
ularly when there is \bad news". specify the device oriented procedures needed
to carry out logical le operations.
reg.h [Sheet 26 Chapter 10] de nes a set of con-
stants which are used in referencing the pre-
conf.c [Sheet 46 Chapter 15] is generated, like
vious user mode register values when they are
\low.s" by the \mkconf" utility to suit the
stored in the kernel stack.
set of peripheral devices present at a particu-
lar installation. It contains the initialisation
trap.c [Sheets 26..28 Chapter 12] contains the
for the arrays \bdevsw" and \cdevsw" which
\C" procedure \trap" which recognises and
control the basic i/o operations.
handles traps of various kinds.
bio.c [Sheets 47..53 Chapters 15, 16, 17] is the
sysent.c [Sheet 29 Chapter 12] contains the decla-
largest le after \m40.s" It contains the pro-
ration and initialisation of the array \ sysent"
cedures for manipulation of the large bu ers,
which is used by \ trap" to associate the ap-
and for basic block oriented i/o.
propriate kernel mode routine with each sys-
tem call type.
rk.c [Sheets 53, 54 Chapter 16] is the device driver
sysl.c [Sheets 30..33 Chapters 12, 13] contains for the RK11/K05 disk controller.
various routines associated with system calls,
including \ exec" \exit" \wait" and \ fork".
4.10 Section Four
sys4.c [Sheets 34..36 Chapters 12, 13, 19] contains
Section Four is concerned with les and le systems.
routines for \unlink", \kill" and various other
A le system is a set of les and associated ta-
minor system calls.
bles and directories organised onto a single storage
device such as a disk pack.
clock.c [Sheets 37, 38 Chapter 11] contains \ clock"
This section covers the means of creating and
which is the handler for clock interrupts, and
accessing les locating les via directories organis-
which does much of the incidental housekeep-
ing and maintaining le systems. It also includes
ing and basic accounting.
the code for an exotic breed of le called a \pipe".
sig.c [Sheets 39..42 Chapter 13] contains the pro-
cedures which handle \signals" or \software
le.h [Sheet 55 Chapter 18] de nes the \ le"
interrupts" These provide facilities for inter-
structure and array.
process communication and tracing.
lsys.h [Sheet 55 Chapter 20] de nes the \ lsys"
structure which is copied to and from the \su-
4.9 Section Three
per block" on \mounted" le systems.
Section Three is concerned with basic input/output
ino.h [Sheet 56] describes the structure of \inodes"
operations between the main memory and disk stor-
as recorded on the \ mounted" devices. Since
age.
this le is not \included" in any other, it re-
These operations are fundamental to the activi-
ally exists for information only.
ties of program swapping and the creation and ref-
erencing of disk les.
inode.h [Sheet 56 Chapter 18] de nes the \inode"
This section also introduces procedures for the
structure and array. \ inodes" are of funda-
use and manipulation of the large (512 byte) bu ers.
mental importance in managing the accesses
of processes to les.
text.h [Sheet 43 Chapter 14] de nes the \text"
structure and array. One \text" structure is
sys2.c [Sheets 57..59 Chapters 18, 19] contains a
used to de ne the status of a shared text seg-
set of routines associated with system calls in-
ment.
cluding \read", \ write", \ creat", \ open" and
text.c [Sheets 43, 44 Chapter 14] contains the pro-
\close"
cedures which manage the shared text seg-
sys3.c [Sheets 60, 61 Chapters 19, 20] contains a
ments.
set of routines associated with various minor
buf.h [Sheet 45 Chapter 15] de nes the \ buf"
system calls.
structure and array, the structure \devtab"
and names for the values of \ b error" All rdwri.c [Sheets 62, 63 Chapter 18] contains inter-
these are needed for the management of the mediate level routines involved with reading
large (512 byte) bu ers. and writing les.
subr.c [Sheets 64, 65 Chapter 18] contains more pc.c [Sheets 86,87 Chapter 22] is the device han-
intermediate level routines for i/o, especially dler for the PC11 paper tape reader/punch
\bmap" which translates logical le pointers controller.
into physical disk addresses.
lp.c [Sheets 88, 89 Chapter 22] is the device han-
dler for the LP11 line printer controller.
o.c [Sheets 66..6 Chapters 18, 19] contains inter-
mediate level routines for le opening, closing
mem.c [Sheet 90] contains procedures which pro-
and control of access.
vide access to main memory as though it were
an ordinary le. This code has been left to the
alloc.c [Sheets 69..72 Chapter 20] contains proce-
reader to survey as an exercise.
dures which manage the allocation of entries
in the \inode" array and of blocks of disk stor-
age.
iget.c [Sheets 72..74 Chapters 18, 19, 20] con-
tains procedures concerned with referencing
and updating \ inodes". [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • mexxo.keep.pl