CS240 Sequence 6 Processes cont.: OS Control Structures, Tables (Memory, I/O, File, P

What are Operating System Control
Structures ?
Contains Information about the current status of
each process and resource
How do Operating System Control
Structures function?
Tables are constructed for each entity the
operating system manages
What is tracked in Memory Tables ? >allocation of main memory to processes
>allocation of secondary memory to
processes
>protection attributes for access to shared
memory regions
>information needed to manage virtual
memory
What are I/O Tables ? Used by OS to manage I/O devices
What is tracked in I/O Tables? >I/O device is available or assigned
>status of I/O operation
>location in main memory being used as the
source or destination of the I/O transfer
What do File Tables keep track of ? >existence of files
>location on secondary memory
>current Status
>attributes
What is important to note about the information that file tables keep track of? sometimes it is maintained
by a file management system
What does a Process Table do? Mange processes
What is tracked in a Process Table? >where process is located
>attributes in the process control block
What are attributes in the process control block? >Program
>Data
>Stack
What is contained in the Process Image ? >User Data
>User Program
>System Stack
>Process Control Block
What is User Data? >The modifiable part of the user space
>includes:
a.) program data b.) user stack area c.) programs that may be modified
What is User Program? The program to be executed
What is System Stack? Process has one or more LIFO stacks associated with it.
What is a stack used for? To store parameters and calling addresses for procedure and system calls
What does LIFO stand for? last in first out
What is the Process Control Block Data needed by the operating system to control the process
What is the first thing the Process Control Block contains from the list given in class? Process Identification
What is contained in Process Identification? Identifiers
What is a special type of Identifier? Numeric Identifier
What types of numeric identifiers can be stored with the process control block? >identifier of the process
>identifier of the process that created this process
(Parent Process)
>user identifier
What is the second thing the Process Control Block contains from the list given in class? Process State Information
What is a user visible register? one that may be referenced by means of the machine language that the processor executes while in user mode
how many typical registers are there? 8-32
what is the name of the groups of applications that has over 100 registers RISC
What are control and status registers? processor registers that are employed to control the operation of the processor
What is considered processor state information? user visible registers
control and status registers
stack pointers
What are the special processor registers that are included in the Control and Status registers? Program Counter
Condition Codes
Status Information
What is a program counter? contains the address of the next instruction to be fetched
What is a condition code? result of the most recent arithmetic logical operation
What are some examples of arithmetic logical operations sign
zero
carry
equal
overflow
What is status information? includes interrupt enabled/disabled flags
execution mode
What is a stack pointer? points to the top of a stack which each process has one or more LIFO system stacks associated with it
What is the third thing the Process Control Block contains from the list given in class? Process Control Information
What is considered Process Control Information? >Scheduling and State Information
>Data Structuring
>Inter-process Communication
>Process Privileges
>Memory Management
>Resource Ownership and Utilization
What is the information needed by the OS to perform its scheduling function Process State
Priority
Scheduling Related Information
Event
What is the Process State? Defines the readiness of the process to be scheduled for execution
What are examples of Process State? running, ready, waiting ,halted
What is the Priority? One or more fields may be used to describe the scheduling priority of the processes.
What are the values required for Priority? default, current, highest-allowable
What is scheduling-related information? This will depend on the scheduling algorithm used.
What are some examples of the scheduling related information? >amount of time the process has been waiting
>amount of time that the process executed the last time it was running
What is an event? Identity of event the process is awaiting before it can be resumed
What is data structuring ? a process may be linked to other process in a queue ring or some other structure
what is a situation which uses data structuring? all processes in a waiting state for a particular priority level may be linked in a queue
True or False: A process may exhibit a parent -child relationship with another process True
True or False: The process control block may contain pointers to other processes to support the data structures True
What is inter-process communication? Various flags, signals and messages that may be associated with communication between two independent processes
Where is the information for inter-process communication maintained? some or all in the process control block
What are process privileges ? granted allowances in terms of the memory that may be accessed and the types of instructions that may be executed.
can process privileges apply to the use of system utilities and services? yes
What is memory management? may include pointers to segment and or page tables that describe the virtual memory assigned to this process
What is Resource Ownership and Utilization? resources that are controlled by the process may be indicated, such as open files. A history of utilization may also be included because this information might be needed by the scheduler.
What is a Program Status Word? contains status information
what is the acronym for Program Status Word? PSW
What is an example of a Program Status Word EFLAGS register on Pentium
What are the modes of execution? user mode
system mode/control mode/kernel mode
What is User mode privilege? less privileged
Where do user programs typically execute? user mode
What is System mode/Control Mode/Kernel Mode privilege? more privileged
What does System mode/Control Mode/Kernel mode generally execute? kernel of the operating system
What are the process creation steps? >assign a unique process identifier
>allocate space for the process
>initialize process control block
>set up appropriate linkages
>create or expand other data structure
What is an example of setting up appropriate linkages? add new process to linked list used for scheduling queue
What is an example of creating or expanding other data structures? maintain an accounting file
When to Switch a Process? >clock interrupt
>I/O interrupt
>memory fault
>trap
>supervisor call
What is a clock interrupt? process has executed for the maximum allowable time slice
what is a memory fault? memory address is in virtual memory so it must be brought into main memory
what is a trap? an error or exception occurred
may cause process to be moved to exit state
What is a supervisor call? such as file open
user process calls OS function to open a file
What is the sequence that a computer goes through in regards to the changing of process state >outgoing process
>select another process for execuation
>incoming process
what happens during the outgoing process >save context of processor (program counter/registers)
>update the process control block of the process that is currently in the running state
>move process control block to appropriate queue (ready;blocked;ready/suspend;)
what happens for an incoming process? >update the process control block of the process selected
>update memory management data structures
>restore context of the selected processes
what is os execution within user processes? >OS software within context of a user
process
>Process executes in privileged mode when
executing OS code
what is non-process Kernel os execution? >executes kernel outside of any process
>os code is executed as a separate entity that operates in privileged mode
what is the relationship between Os and User Processes?? (a)separate kernel
(b)OS functions execute within user processes
(c)OS functions execute as separate processes
Advantages of process based operating system (OS functions execute as separate processes) useful in multi processor or multi computer environment
what type of operating system execution styles does UNIX SVR4 use? os functions execute within the environment of a user process
what are the unix process states? >user running
>kernel running
>ready to run in memory
>asleep in memory
>ready to run swapped
>sleeping swapped
>preempted
>created
>zombie
What is User Running? Executing in user mode
What is Kernel Running? Executing in kernel mode
What is Ready to Run in Memory? Ready to run as soon as the kernel schedules it
what is Asleep in Memory? Unable to execute until an event occurs ; process is in main memory (a blocked state)
what is ready to run, swapped? process is ready to run, but the swap-er must swap the process into main memory before the kernel can schedule to execute
what is sleeping , swapped? the process is awaiting an event and has been swapped to secondary storage ( a blocked state)
what is preempted? process is returning from kernel to user mode, but the kernel preempts it and does a process switch to schedule another process
what is created? process is newly created and not yet ready to run
what is zombie? process no longer exists but it leaves a record for its parent process to collect
what are the UNIX process image sections? >user level context
>register context
>system level context
what is in the UNIX user level context? >Process Text
>Process Data
>User Stack
>Shared Memory
What is process text? Executable machine instructions of the program
What is process data? Data accessible by the program of this process
What is the user stack? contains the arguments, local variables and pointers for functions executing in user mode
what is shared memory? memory shared with other processes, used for inter-process communication
what is in the UNIX register context? >program counter
>processor status register
>stack pointer
>general-purpose registers
what is a program counter? address of next instruction to be executed
where can the address of next instruction be? kernel or user memory space
what is the processor status register? contains the hardware status at the time of preemption (contents and format are hardware dependent)
what is the stack pointer? points to the top of the kernel or user stack, depending on the mode of operation at the time or preemption
what is a general purpose register hardware dependent
what is in the UNIX System Level Context >Process Table Entry
>User Area
>Per Process Region Table
>Kernel Stack
What is Process Table Entry? defines state of a process; this information is always accessible to the operating system
What is user area? process control information that needs to be accessed only in the context of the process
what is per process region table defines the mapping from virtual to physical addresses
contains a permission field that indicates the type of access allowed the process
types of access allowed by the process read only, read write, read execute
what is the kernel stack contains the stack frame of kernel procedures as the process executes in kernel mode