Download SUN User`s Guide
Transcript
SUNOS - A S~fALL OPERATING SYSTEM
63
• the patient's error status.
The SID register value is determined by Malloc. who may also change it. Canoe uses it only to sct the SID
register for the current (nmning or retiring) process. The SID register maps a virtual address to a Inap
address, which further maps the result to a physical address.
The pc/sp/cc values are used to initialize the epu on exiting to the process. The patient error status is
reported to the physician on request, along with the patient pc/spIce values.
The control state components are:
• activity: one of running, retiring, or sleeping;
• status: normal or suspended.
• A running process is one in control of the CPU. A retiring process is one which is attempting to go to sleep.
A sleeping process is one that does not have control of the CPU. A running or retiring process is called
current; there is at most one current process at a time.
A normal process executes the patient when running. while a suspended process executes the physician.
When retiring, a process executes the physician whether normal or suspended.
The process state is represented in the present SUN implenlcntation with the following 32-byte struct in
the C programming language.
typedef struct Procdesc
{int *patpc;
int *patsp;
int *patsb;
int *phypc;
int *physp;
int sid;
char patce;
char phycc;
short paterr;
struct Procdesc *next;
} *procdesc;
1*
1*
1*
1*
1*
1*
1*
1*
1*
1*
1*
process descriptor *1
pat program counter *1
pat stack pointer *1
pat stack base *1
phy program counter *1
phy stack pointer *1
space id *1
pat condition code reg *1
phy ditto *1
patient error status *1
next process descriptor *1
The current process is identified with a variable Currcnt of type procdesc. To facilitate renloval of a
.
terminated process the procdcsc variable Last identifies the process that was current prior to the present one
(with Last = Current if there is only onc process). Last contains no information not deducible less efficiently
from Current.
11 DECEMBER 1981