Here are the pre-defined data structures and procedures:
Running_Process - global variable which contains the PCB for the current
running process.
IO_Done_PID - global variable which contains the process id PID of the process
whose I/O just completed.
PCB - a structure for the process control block. It contains the following
fields:
PID - process ID
Next_PCB - link to the next PCB in the queue
PC - current program counter value for this process
Other - you can define other fields if you need them
Ready_Queue - linked list of PCBs of processes waiting for the CPU.
Wait_Queue - linked list of PCBs of processes waiting for I/O to complete.
Append(pcb, queue) - appends pcb to tail of queue.
Head(queue) - removes the first PCB in queue and returns it; if queue is
empty it returns NIL.
Select(queue,pid) - searches queue for the first process PCB whose PID
matches pid.
Context_Switch(pcb,TAU) - set the interval timer clock to TAU and
start executing the process whose PCB is specified.
NOTE: Context_Switch never returns. The PC (Program Counter)
is loaded with the PC value stored in pcb->PC which causes
the fetch/execute cycle to start where that process left off.
You can define any other procedures or data structures you need, but
these should be sufficient. If you end up defining too many more,
you may lose points for an overly complex solution.