0% found this document useful (0 votes)
40 views3 pages

Operating System Quiz Reviewer

The document discusses processes in an operating system. It defines a process as a program in execution that can be divided into four sections - stack, heap, text, and data. A process goes through various states in its lifecycle including ready, running, waiting, and terminated. Key process information is stored in a process control block (PCB) that includes the process ID, memory allocation, and scheduling details. There are two main types of schedulers - long-term schedulers that control job mixing and multiprogramming, and short-term CPU schedulers that select the next ready process to run on the CPU.

Uploaded by

Kyle M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views3 pages

Operating System Quiz Reviewer

The document discusses processes in an operating system. It defines a process as a program in execution that can be divided into four sections - stack, heap, text, and data. A process goes through various states in its lifecycle including ready, running, waiting, and terminated. Key process information is stored in a process control block (PCB) that includes the process ID, memory allocation, and scheduling details. There are two main types of schedulers - long-term schedulers that control job mixing and multiprogramming, and short-term CPU schedulers that select the next ready process to run on the CPU.

Uploaded by

Kyle M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

OPERATING SYSTEM Process privileges

Processes  This is required to allow/disallow access to system resources.

Process Process ID

• A process is basically a program in execution. The execution of  Unique identification for each of the process in the operating
a process must progress in a sequential fashion. system.

• A process is defined as an entity which represents the basic unit Pointer


of work to be implemented in the system.
 A pointer to parent process.
When a program is loaded into the memory
and it becomes a process, it can be divided Program Counter
into four sections ─ stack, heap, text and data.
 Program Counter is a pointer to the address of the next
Stack instruction to be executed for this process.

 The process Stack contains the


temporary data such as
method/function parameters, return CPU registers
address and local variables.
 Various CPU registers where process need to be stored for
Heap execution for running state.

 This is dynamically allocated


memory to a process during its run
time. CPU Scheduling Information

Text  Process priority and other scheduling information which is


required to schedule the process.
 This includes the current activity represented by the value of
Program Counter and the contents of the processor's registers. Memory management information

Data  This includes the information of page table, memory limits,


Segment table depending on memory used by the operating
 This section contains the global and static variables. system.

Process Life Cycle Accounting information

Start  This includes the amount of CPU used for process execution,
time limits, execution ID etc.
 This is the initial state when a process is first started/created.
O status information
Ready
 This includes a list of I/O devices allocated to the process.
 The process is waiting to be assigned to a processor. Ready
processes are waiting to have the processor allocated to them by Operating System -Process Scheduling
the operating system so that they can run.
 The process scheduling is the activity of the process manager
Running that handles the removal of the running process from the CPU
and the selection of another process on the basis of a particular
 Once the process has been assigned to a processor by the OS strategy.
scheduler, the process state is set to running and the processor
executes its instructions. Categories of Scheduling

Waiting 1. Non-preemptive: Here the resource can’t be taken from a


process until the process completes execution. The switching of
 Process moves into the waiting state if it needs to wait for a resources occurs when the running process terminates and
resource, such as waiting for user input, or waiting for a file to moves to a waiting state.
become available.
2. Preemptive: Here the OS allocates the resources to a process
Terminated or Exit for a fixed amount of time. During resource allocation, the
process switches from running state to ready state or from
 Once the process finishes its execution, or it is terminated by the waiting state to ready state.
operating system, it is moved to the terminated state where it
waits to be removed from main memory.

Process Control Block (PCB)

 is a data structure maintained by the Operating System for every


process. The PCB is identified by an integer process ID (PID).
 Processes that are not running are kept in queue, waiting for
their turn to execute. Each entry in the queue is a pointer to a
particular process. Queue is implemented by using linked list.
Use of dispatcher is as follows. When a process is interrupted,
that process is transferred in the waiting queue. If the process
has completed or aborted, the process is discarded. In either
case, the dispatcher then selects a process from the queue to
execute.

Schedulers

Schedulers are special system software which handle process scheduling in


various ways. Their main task is to select the jobs to be submitted into the
system and to decide which process to run. Schedulers are of three types −

Long-Term Scheduler

 Schedulers are special system software which handle process It


is also called a job scheduler. The primary objective of the job
scheduler is to provide a balanced mix of jobs, such as I/O
bound and processor bound. It also controls the degree of
multiprogramming. If the degree of multiprogramming is stable,
then the average rate of process creation must be equal to the
average departure rate of processes leaving the system.

Short-Term Scheduler

 It is also called as CPU scheduler. Its main objective is to


increase system performance in accordance with the chosen set
of criteria. It is the change of ready state to running state of the
process. CPU scheduler selects a process among the processes
that are ready to execute and allocates CPU to one of them.
 Short-term schedulers, also known as dispatchers, make the
decision of which process to execute next. Short-term
schedulers are faster than long-term schedulers.

Medium-Term Scheduler

 is a part of swapping. It removes the processes from the


Process Scheduling Queues memory. It reduces the degree of multiprogramming. The
medium-term scheduler is in-charge of handling the swapped
 The OS maintains all Process Control Blocks (PCBs) in Process out-processes.
Scheduling Queues. The OS maintains a separate queue for each  A suspended processes cannot make any progress towards
of the process states and PCBs of all processes in the same completion. In this condition, to remove the process from
execution state are placed in the same queue. When the state of memory and make space for other processes, the suspended
a process is changed, its PCB is unlinked from its current queue process is moved to the secondary storage. This process is
and moved to its new state queue. called swapping, and the process is said to be swapped out or
rolled out. Swapping may be necessary to improve the process
The Operating System maintains the following important process mix.
scheduling queues −
Context Switching
• Job queue − This queue keeps all the processes in the system.

• Ready queue − This queue keeps a set of all processes residing


in main memory, ready and waiting to execute. A new process is
always put in this queue.

• Device queues − The processes which are blocked due to


unavailability of an I/O device constitute this queue.

 A context switching is the mechanism to store and restore the


Two-State Process Model state or context of a CPU in Process Control block so that a
process execution can be resumed from the same point at a later
Running
time. Using this technique, a context switcher enables multiple
processes to share a single CPU. Context switching is an
 When a new process is created, it enters into the system as in the
essential part of a multitasking operating system features.
running state.
 When the scheduler switches the CPU from executing one
Not Running process to execute another, the state from the current running
process is stored into the process control block. After this, the  The addresses used in a source code. The variable names,
state for the process to run next is loaded from its own PCB and constants, and instruction labels are the basic elements of the
used to set the PC, registers, etc. At that point, the second symbolic address space.
process can start executing.
Relative addresses
Context switches are computationally intensive since register and memory
state must be saved and restored. To avoid the amount of context switching  At the time of compilation, a compiler converts symbolic
time, some hardware systems employ two or more sets of processor addresses into relative addresses.
registers. When the process is switched, the following information is stored
for later use. Physical addresses

• Program Counter  The loader generates these addresses at the time when a
program is loaded into main memory.
• Scheduling information
Static vs Dynamic Loading
• Base and limit register value
The time of loading, with static loading, the absolute program (and data) is
• Currently used register loaded into memory in order for execution to start.

• Changed State If you are using dynamic loading, dynamic routines of the library are
stored on a disk in relocatable form and are loaded into memory only when
• I/O State information they are needed by the program.

• Accounting information

Operating System -Memory Management

 Memory management is the functionality of an operating system


which handles or manages primary memory and moves
processes back and forth between main memory and disk during
execution. Memory management keeps track of each and every
memory location, regardless of either it is allocated to some
process or it is free. It checks how much memory is to be
allocated to processes. 

Process Address Space

 The process address space is the set of logical addresses that a


process references in its code. For example, when 32-bit
addressing is in use, addresses can range from 0 to 0x7fffffff;
that is, 2^31 possible numbers, for a total theoretical size of 2
gigabytes.
 The operating system takes care of mapping the logical
addresses to physical addresses at the time of memory allocation
to the program. There are three types of addresses used in a
program before and after memory is allocated −

Memory Addresses & Description

Symbolic addresses

You might also like