Process: CSCE 351: Operating System Kernels
Process: CSCE 351: Operating System Kernels
• Not-running
– ready to execute
• Blocked
– waiting for I/O
• Dispatcher cannot just select the
process that has been in the queue the
longest because it may be blocked
Not-Running Process in a Queue
Process Creation
• Running
• Ready
• Blocked
• New
• Exit
A Five-State Model
Using Two Queues
Using Multiple Queues
Suspended Processes
• Existence of files
• Location on secondary memory
• Current Status
• Attributes
• Sometimes this information is
maintained by a file-management
system
Process Table
• Process identification
– Identifiers
• Numeric identifiers that may be stored with the
process control block include
• Identifier of this process
• Identifier of the process that created this
process (parent process)
• User identifier
Process Control Block (2)
• User mode
– Less-privileged mode
– User programs typically execute in this
mode
• System mode, control mode, or kernel
mode
– More-privileged mode
– Kernel of the operating system
Process Creation
• Clock interrupt
– process has executed for the maximum
allowable time slice
• I/O interrupt
• Memory fault
– memory address is in virtual memory so it
must be brought into main memory
When to Switch a Process
• Trap
– error occurred
– may cause process to be moved to Exit
state
• Supervisor call
– such as file open
Change of Process State (1)
• Non-process Kernel
– Execute kernel outside of any process
– Operating system code is executed as a separate
entity that operates in privileged mode
• Execution Within User Processes
– Operating system software within context of a user
process
– Process executes in privileged mode when
executing operating system code
Execution of the Operating System