Next: Interrupts and Interrupt Vectors
Up: No Title
Previous: Process Management Operations
A process is represented by the PCB (Process Control Block) or
PD (Process Descriptor), which contains the following :
- Process Identifier (parent identifier)
- Context
Program Counter (PC)
Processor Status Word (PSW)
Stack Pointer (SP)
Registers (perhaps implemented as a stack)
Memory addressing registers
- Process State
- Priority
- Accounting Information : start time, CPU used
- Resources Allocated
memory allocated (base and limit regs, page and segment tables)
root directory
open files
other i/o devices
- Exception address
- Pointer for queues - why is this needed ?
Figure:
Assume - ReadyQ is priority ordered
BEGIN
disable interrupts
initialise data structures
create initial processes
REPEAT (FOREVER)
Dispatch process
ENTER :
save registers of current process
determine the source of interrupt
service interrupt or call
END (repeat)
END
Things to consider :
- The Dispatcher selects the highest priority process,
enables the interrupts and runs it. The priority at which a process
is run is defined by the PSW (Processor Status Word)
- The saving of registers and determining interrupt source is
determined by the First Level Interrupt Handler (FLIH)
- Note : Servicing an interrupt or call may state the change
of the current or another process, and cause a reschedule to take place.
Hence, it is possible that another process may be run after an external
event has occurred instead of the one intended prior to the event. Hence,
the dynamic element of scheduling
- The amount of stuff that is stored in the PCB depends on the need.
Hence, it is possible to control the degree of information that needs
to be recorded on a context switch
The Dispatcher does the following (more later) :
REPEAT (FOREVER)
Run thread (process)
Save state (into PCB
or TCB (thread control block))
Choose new thread (process) to run
Load state into PCB (TCB)
END
Omer F Rana
Thu Feb 6 16:16:03 GMT 1997