COE628 Week3 Lecture Part I-W2023 (2)
COE628 Week3 Lecture Part I-W2023 (2)
•Processes
•Process states
•State-Diagrams
Last Week
•Queuing Models
(mechanism)
•Dispatcher, traces
• Part I:
• Operating System Control Tables
• Process Control Structure
• Process control
• Modes of execution
• Process creation
• Process switching
• UNIX SVR4 process management
• Process states
• Process description
• Process control
Process
Image
Memory Tables
Process
Memory 1
Files
Process 1
Process 2
Process
Process 3 Image
Process
n
Process n
• Existence of files
• Location on secondary memory
• Current status
• Other attributes
User Data
The modifiable part of the user space. May include program data, a user stack area, and
programs that may be modified.
User Program
The program to be executed.
Stack
Each process has one or more last-in-first-out (LIFO) stacks associated with it. A stack is
used to store parameters and calling addresses for procedure and system calls.
Stack Pointers
Each process has one or more last-in-first-out (LIFO) system stacks associated with it. A stack is used
to store parameters and calling addresses for procedure and system calls. The stack pointer points to
(Table is located
the top of the stack.
on page 125 in the
textbook)
Memory Management
This section may include pointers to segment and/or page tables that describe the virtual memory
assigned to this process.
Table 3.6 Indicates carrying out or borrowing into the leftmost bit position following an arithmetic operation. Also
modified by some of the shift and rotate operations.
OF (Overflow flag)
Indicates an arithmetic overflow after an addition or subtraction.
PF (Parity flag)
Parity of the result of an arithmetic or logic operation. 1 indicates even parity; 0 indicates odd parity.
x86
SF (Sign flag)
Indicates the sign of the result of an arithmetic or logic operation.
ZF (Zero flag)
Indicates that the result of an arithmetic or logic operation is 0.
Control Flag
DF (Direction flag)
EFLAGS
Determines whether string processing instructions increment or decrement the 16-bit half-registers SI and
DI (for 16-bit operations) or the 32-bit registers ESI and EDI (for 32-bit operations).
Register
If this bit can be set and cleared, this processor supports the CPUID instruction. This instruction provides
information about the vendor, family, and model.
RF (Resume flag)
Allows the programmer to disable debug exceptions so that the instruction can be restarted after a debug
exception without immediately causing another debug exception.
IOPL (I/O privilege level)
When set, causes the processor to generate an exception on all accesses to I/O devices during protected
Bits
mode operation.
IF (Interrupt enable flag)
When set, the processor will recognize external interrupts.
TF (Trap flag)
When set, causes an interrupt after the execution of each instruction. This is used for debugging.
NT (Nested task flag)
Indicates that the current task is nested within another task in protected mode operation.
VM (Virtual 8086 mode)
Allows the programmer to enable or disable virtual 8086 mode, which determines whether the processor
runs as an 8086 machine.
VIP (Virtual interrupt pending)
Used in virtual 8086 mode to indicate that one or more interrupts are awaiting service.
VIF (Virtual interrupt flag)
Used in virtual 8086 mode instead of IF.
(Table is located on page 127 in the textbook)
Ready
Blocked
Support Functions
•Interrupt handling
•Accounting
•Monitoring
n User Processes
n Operate in user mode to execute user programs and utilities
n Operate in kernel mode to execute instructions that belong to the kernel
n Enter kernel mode by issuing a system call, when an exception is
generated, or when an interrupt occurs
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