-
Process Scheduling
- Round-Robin
- Lottery
-
Process Switching (Context Switching)
- Switch out old
- Switch in new
- Execute instructions
-
Store sufficient information into the kernel PCB for a process.
- Process ID
- Parent ID
- Start CPU Time
- Accumulated CPU time
- Memory Size (just text size)
- Priority
- Program Counter
- Etc.
- Coding Notes
-
Process Management
- State Transitions
- Queues
-
Status
- Ready
-
Blocked
- Awaiting completion of started I/O
- Terminated
- Running
- Passage of Time (in units of timer interrupts)
- Pick Scheduling Algorithm
-
Interaction with Simulated Hardware
-
CPU
-
Reduced Instruction Set
- System Calls
- Privileged Instructions
-
Seven types of instructions.
- S: x:storextoVC
- P: Privileged instruction
- I: <dev-class> (B/C)
- E : terminate the current process
- C: <priority> <file-name>
- D: x:decrxfromVC
- A: x:addxtoVC
-
Two Registers
- VC
- PC
-
IO
- System Clock Timer
- Character Device
- Block Device
-
Trace File of CPU Activity
- 1) The clock tick number every time a clock tick interrupt is received.
- 2) When instructions are executed, you should print the instruction and the originating process' ID.
- 3) When a {CHAR|BLOCK} device interrupt is received, print out which process has been unblocked
(moved to the ready queue).
- 4) For Lottery scheduling, you also need to print the ticket allocations to various processes.
- 5) Whenever a new process is being scheduled you also need to print the lottery ticket number used for this decision.
-
Memory
- Device table/Data-Structure
-
Process Clean Up/Creation
- Create initial process with id=0 (main.trace).
- Simple VAS with text segment
- Associated kernel state (PCB)