Operating System 1

21 Sep 2020

Following summary is extracted from Chapter 3 of Operating System Concepts. 9th Edition, briefly disccusing how Progress is represented and works in an Operating System.

NOTE: Most of this summary are full quotes from the book; all diagrams are copied from the book.

How Process is Represented in OS:

A process is represented by a Process Control Block in the OS, which contains following information:

Information Meaning
Process state new, ready, running, waiting, halted, and so on.
Program counter indicates the address of the next instruction to be executed for this process
CPU registers vary in number and type, depending on the computer architecture: accumulators, index registers, stack pointers, and general-purpose registers, plus any condition-code information. Along with the program counter, this state information must be saved when an interrupt occurs, to allow the process to be continued correctly afterward
CPU-scheduling information process priority, pointers to scheduling queues, and any other scheduling parameters.
Memory-management information include base and limit registers and the page tables, or the segment tables, depending on the memory system used by the operating system
Accounting information includes the amount of CPU and real time used, time limits, account numbers, job or process numbers, and so on.
I/O status information includes the list of I/O devices allocated to the process, a list of open files, and so on.

PCB simply serves as the repository for any information that may vary from process to process.

On a system that supports threads, the PCB is expanded to include information for each thread.

Process in Memory

A process in memory typically consists of:

Process In Memory

Process State

Process State Transition

Process Scheduling

A new process is initially put in the ready queue. It waits there until it is selected for execution (dispatched). Once the process is allocated the CPU and is executing, one of several events could occur:

Queueing Digram

Most processes are either: