Basic To Advance Operating System Notes
Basic To Advance Operating System Notes
OPERATING SYSTEM
Written By: ATUL KUMAR
User-2 User-4
Fig: Multiuser os
Ex:
• MS-windows NT server
• MS-Windows 2000 server
• MS-Windows 2003 server
• Novel Network
• Linux
• Unix
Written By: ATUL KUMAR Page 5
OPERATING SYSTEM
➢ Function of OS:
• CPU management/processor
• Process management
• Memory management
• Disk management
• I/O management
c) Virtual machine
d) Client server model
HARDWAREE
Virtual Machine OS
c) Multiuser OS/Network OS
d) Time sharing OS.
e) Real time OS
I. Multitasking OS: - It is a form of multiprogramming OS
that performs multiple tasks simultaneously. It allows to
reside multiple programs into memory. When one
program waits for some I/O operation, an OS submits
another program to CPU for execution. This way, a user
gets the illusion that his/her multiple tasks are being
completed. Hence, it is also called serial multitasking and
it is different from multiprocessing.
Suspended
/*Process Scheduling*/
Scheduling refers to the set of policies and mechanism
supported by OS that determines the order in which the
process/jobs/task will be completed. It is one of the main
functions of an OS. All computer resources are scheduled
before use.
The part of OS (Operating System) which performs the job
of scheduling is called scheduler. A scheduler selects an
available process from a set of processes for execution by
CPU. i.e., the selection of the process is carried out by the
scheduler. The main objective of scheduling is to increase
the CPU utilization and improve the overall efficiency of
the computer.
Written By: ATUL KUMAR Page 17
OPERATING SYSTEM
Medium Term
Suspended Mode
Scheduler
Q1. Find the waiting time and turnaround time for the
following process under FCFS Scheduling.
Process Execution time
P1 5
P2 7
P3 9
P4 4
The process arrives in the order as P1→P2→P3→P4
➢ Process Waiting time Turnaround time
P1 0 5
P2 5 12
P3 12 21
P4 21 25
P1 P2 P3
0 5 X 10 X
Process Scheduling
Batch FCFS
Process Scheduling
/*Inter-Process Communication*/
In multiprogramming environment multiple processes are
executed concurrently (parallel). These concurrent
processes also communicate with each other which are
called inter-process communication.
The process of synchronization is also needed in case of
inter-process communication. Processes are executed with
very high speed and therefore 1-process must perform
some tasks before other process deletes it.
Synchronization can be viewed as setup constraints on the
ordering of the events.
Following are the some of the technique use in process
synchronization in multi programming environment: -
Process-1 Process-2
Resource-2
/*Memory management*/
Memory management is mainly concerned with allocation
of main memory to requested process. No process can
even run before a certain amount of memory is allocated
to it. Hence, organization and management of main
memory has been one of the most important factors to be
considered in design of OS. The overall resource utilization
and other performance criteria of a computer system are
mostly affected by the performance of the memory
management module.
Two important feature of memory management function
are protection and sharing.
Written By: ATUL KUMAR Page 27
OPERATING SYSTEM
Of Memory System
User
Program
Fig: PDT
OS OS
100k P1 Free //100k//
300k P2 300k
50k P3 Free //50k//
200k P4 200k
Fig: External Fragmentation
OS OS
P1 P1(100k)
//50k// Free P3(200k)
P3(200k) Compaction P5(300k)
//100k// Free
P5(300k) //180// Free
//30k// Free
➔ Advantages: -
I. Memory utilization is better than fixed size
partitioning since partition is created
according to the size of process.
II. Protection and sharing in fixed and dynamic
partition are similar.
III. When the process is larger than the free
partition then OS expends the free area by
combining the adjacent free area and moving
the process into it.
→ Disadvantages: -
I. Dynamic memory management requires lots
of OS space, time, and complex memory
management algorithms.
II. Compaction time is very high.
/*Paging*/
Paging is a memory management scheme/technique which
allows a process to be stored in memory in non-contiguous
partition. This way it solves the problem of external
fragmentation. The program is divided into logical memory
space or virtual address space called pages. Similarly,
physical memory is also divided into the fixed/same size
blocks called frames or page frames. When a process
needs to be executed then its pages are loaded into any
frames of physical memory from the disk.
The program generated addresses are called virtual
address and the address where actually the page will be
stored is called physical address. Hence, address mapping
is required to convert the logical address into physical
address.
The logical address consists of page no. and offset
whereas physical address consists of base address and
offset.
The following diagram shows the address mapping in the
paging system.
Physical memory
Physical address
Virtual address
CPU Page no. Offset Basic addres Offset
Base address
/*Disk management*/
Disk management is an important function of an OS. The
performance of a computer system also largely depends
upon how fast a disk request is serviced. In a
multiprogramming environment, many processes may
generate request for reading and writing disk record. To
service a request, the disk system requires moving the
head at desired track then wait for latency and finally
transfer the data. When more than track is to be serviced
to different processes then the order in which track will be
serviced to process depends upon the disk scheduling
algorithm.
➢ Disk scheduling algorithm: Following are the various
scheduling algorithm for disk services: -
i. FCFS Scheduling
Written By: ATUL KUMAR Page 37
OPERATING SYSTEM
0 6 12 18
1 Free 7 Free 13 19
2 8 14 Free 20
3 Free 9 15 21
Free 4 10 16 22
5 Free 11 17 Free 23
THE END
THANK YOU
Written By: ATUL KUMAR Page 44