Professional Documents
Culture Documents
Overview of Operating System: Department of Information Technology
Overview of Operating System: Department of Information Technology
Operating System
Computer
Resources
Main
Processor I/O I/O I/O
Memory
Figure 3.10 Processes and Resources (resource allocation at one snapshot in time)
Files
Process 1
Process 2
Process
Process 3 Image
Process
n
Process n
●
existence of files
●
location on secondary memory
●
current status
• Information
●
may be maintained
other attributes and used by a file management
system
• in which case the OS has little or no knowledge of files
• In other operating systems, much of the detail of file management is managed by the OS
itself
To manage and ●
where the process is located
control a process ●
the attributes of the process
the OS must that are necessary for its
management
know:
Consists Progra
of the ●
user-visible ●
contains condition codes
content registers m plus other status
information
s of ●
control and status ●
EFLAGS register is an
process example of a PSW used by
status registers
or ●
stack pointers
word any OS running on an x86
processor
registers (PSW)
Department of Information Technology, VIIT, Pune-48
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
I
V V
I A V R N O O D I T S Z A P C
0 0 0 0 0 0 0 0 0 0 I I 0 0 0 1
D C M F T P F F F F F F F F F
P F
L
EFLAGS
Register
Bits
Ready
Blocked
cr
ea
tes
or
ex
pa
nd
s
ot
he
r
da
ta
str
uc
tur
es
Interrupt Trap
• Due to some sort of event that is • An error or exception condition
external to and independent of generated within the currently
the currently running process running process
• clock interrupt • OS determines if the condition
• I/O interrupt is fatal
• memory fault • moved to the Exit state and
• Time slice a process switch occurs
• the maximum amount of time
• action will depend on the
that a process can execute
before being interrupted nature of the error
Department of Information Technology, VIIT, Pune-48
Mode Switching
If an interrupt is pending the processor:
nterrupts are pending the processor:
sets the program counter to the starting address of an interrupt handler program
Execution
Kernel
of the P1 P2 Pn
Operating System
OS OS OS
Func- Func- Func-
tions tions tions
P1 P2 Pn OS1 OSk
User Stack
Private User
Address Space
(Programs, Data)
Kernel Stack
Shared Address
Space
Created
Preempted
User
Running preempt
swap out
return Ready to Run Ready to Run
reschedule
In Memory Swapped
process swap in
system call,
interrupt Kernel
Running
1 ●
Allocate a slot in the process table for the new process
• Process creation is
by means of the 2 ●
Assign a unique process ID to the child process
kernel system call,
fork( ) 3 ●
Make a copy of the process image of the parent, with the exception of any shared memory
Mode, to:
5 ●
Assigns the child process to the Ready to Run state
6 ●
Returns the ID number of the child to the parent process, and a 0 value to the child process