Process Description and Control
Process Description and Control
Chapter 3
Concepts
Computer platform consists of a collection of hardware resources Computer applications are developed to perform some task Inefficient for applications to be written directly for a given hardware platform Operating system provides a convenient to use, feature rich, secure, and consistent interface for applications to use O provides a uniform, abstract representation of resources that can be re!uested and accessed by an application
Process
% program in e$ecution %n instance of a program running on a computer 'he entity that can be assigned to and e$ecuted on a processor % unit of activity characteri)ed by the e$ecution of a se!uence of instructions, a current state, and an associated set of system resources
Process #lements
Identifier tate Priority Program counter "emory pointers Conte$t data I(O status information %ccounting information
'race of a Process
e!uence of instructions that are e$ecuted by a process 'he trace can be used for optimi)ation and(or debugging purposes, Dispatcher switches the processor from one process to another
#$ample #$ecution
'race of Processes
Process Creation
ubmission of a batch *ob 1ser logs on Created to provide a service such as printing Process creates another process
Process 'ermination
+atch *ob issues Halt instruction 1ser logs off 0uit an application #rror and fault conditions
Processes
/ot-running
. ready to e$ecute
+locked
. waiting for I(O
Dispatcher cannot *ust select the process that has been in the !ueue the longest because it may be blocked
'ransitions
Running -> Blocked 3I(O operation, waiting for an event, waiting for a communication to complete Running -> Ready 3 preemption, timeout Blocked -> Exit : Ready -> Exit : % process can almost always transfer to the Exit state given the right circumstances 4forced to e$it5,
Process tates
uspended Processes
Processor is faster than I(O so all processes could be waiting for I(O wap these processes to disk to free up more memory +locked state becomes suspend state when swapped to disk 'wo new states
. +locked, suspend . &eady, suspend
"odes of #$ecution
1ser mode
. 6ess-privileged mode . 1ser programs typically e$ecute in this mode
Process Creation
%ssign a uni!ue process identifier %llocate space for the process Initiali)e process control block et up appropriate linkages
. #$3 add new process to linked list used for scheduling !ueue
upervisor call
. such as file open
O #$ecution
/on-process 7ernel
. #$ecute kernel outside of any process . Operating system code is e$ecuted as a separate entity that operates in privileged mode
Countermeasures
Inrusion Detection ystems %uthentication
. ensors . %naly)ers
. omething the individual knows . omething the individual possesses . omething the individual is 4static biometrics5 . omething the individual does 4dynamic biometrics5
1ni$ Process
1nder 1/I:, a process consists of3
. 1ser-level Conte$t
%ll memory regions 4code, data, shared, stack5
. &egister Conte$t
CP1 register contents, including PC
. ystem-level Conte$t
Process-table data 1 4user5 area Per process region table 4virtual to physical address mapping, including permission flags5 7ernel stack
2ields reported by ps
1ID 3 user ID PID 3 Process ID PPID 3 Parent Process ID P&I 3 priority /I 3 nice, % value used to calculate priority ; ? 3 ;irtual "emory i)e &# 4or & 5 3 resident memory si)e
2ields reported by ps
9CA%/ 3 waiting channel ''B 3 the name of the terminal that a process is attached to for performing console I(O '%' 3 status 'I"# 3 total e$ecution time CO""%/D 3 name of e$ecutable
&unning top
Parent