Getting to Run: The Process Control Block

The OS must also keep track of the data that each process needs to be able to execute. The operating system stores these 'metadata' in a kernel data structure called the Process Control Block (PCB), also called Task Control Block. Since the data in the PCB is sensitive, this data structure is stored in the part of memory that only the kernel has permission to access (= kernel space). These metadata include:

  1. The process id and the current process state (one of the 5 we saw earlier.)
  2. The program counter, which contains the address to the next instruction that should be executed.
  3. Copies of the CPU registers, which contain the data that was processed when the process was running.
  4. CPU-scheduling information, such as the process's priority and pointers to scheduling queues.
  5. Memory-management information, such as page tables or segment tables.
  6. Accounting information, such as the amount of CPU and real time that the process has used.
  7. I/O Status information like the I/O devices that the process uses and the list of open files.