Operating Systems and Systems Integration Tutorial: Process Control Blocks 1. What is a process control block (pcb)? i 2. Is a pcb only found in a Linux or posix os or is it found in all operating systems? i 3. Give ONE other name for a pcb. i 4. Give ONE name for the data structure that holds the pcbs. i 5. Briefly define the term program counter. i 6. What data is held in the program counter ? i Process Control Blocks: In figure 1 on the following page we see three processes, P1, P2 and P3. There are seven moments in time where the main values of the pcbs of the three processes are shown. The time intervals are not equal; they are just where the scheduler changed the process. The size of all i/o instructions is three bytes. In each pcb I have shown the program counter value, and the process state. The process state can be running (i.e., executing on the cpu), ready (i.e., ready to run), and sleeping (i.e., blocked). There are two queues shown: a wait queue for processes that are blocked waiting for i/o, and a ready queue, for processes that are in the ready to run state. 1. State the technical term for what the scheduler does at each of the times t0 , t1 , t2 , t3 , t4 , t5 and t6 . i Nick Urbanik nicku(at)vtc.edu.hk ver. 1.0 Tutorial: Process Control Blocks Operating Systems and Systems Integration CPU idle t0 2 t1 t2 t3 t4 t5 t6 time Ready Queue: Wait Queue: P3 P2 P3 P1 P1 P2 P2 P3 P3 PCB for P1 0xCAFE Running 0xC0DE Sleeping 0xC0DE Ready 0xC0DE Running Process 1 has terminated; It’s PCB has been freed PCB for P2 0xFACE Ready 0xFACE Running 0xFEED Sleeping 0xFEED Ready 0xFEED Running Process 2 has terminated PCB is freed PCB for P3 0xDEAF Ready 0xDEAF Ready 0xDEAF Running 0xD1CE Sleeping 0xD1CE Ready 0xD1CE Running P3 has exited; PCB freed Figure 1: An example of three processes executing, showing their process control blocks. 2. Does process P1 perform i/o? If so, at what address is the i/o instruction? i 3. Does process P2 perform i/o? If so, at what address is the i/o instruction? i 4. Does process P3 perform i/o? If so, at what address is the i/o instruction? i 5. List at least FIVE other kinds of data that will be stored in a pcb that is not shown Nick Urbanik nicku(at)vtc.edu.hk ver. 1.0 Tutorial: Process Control Blocks Operating Systems and Systems Integration 3 in figure 1 on the previous page. i Nick Urbanik nicku(at)vtc.edu.hk ver. 1.0