Chapter 3 Quizlet Flashcards

1
Q

OS application management execution

A
  • Resources are made available to multiple applications
  • Processor switches between multiple apps so all appear to be running
  • Processor and IO devices can be used efficiently
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Process elements

A
  • Process
  • process control block
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Process

A
  • when processor begins to execute the program code, executing entity
  • consists of program code, set of data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

process control block

A
  • created and managed by OS
  • Contains enough info that a running process can be interrupted and resumed later
  • Key tool that enables OS to support multiple processes + do multiprocessing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

process interruption

A
  • When process is interrupted, current values of program counter + processor registers (context data) are saved in fields of control block and process state is changed to blocked/ready
  • OS can put other process in running state and load program counter + context data into processor registers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

process control block storage

A
  • Identifier
  • state
  • priority
  • program counter
    -memory pointer
  • context data
  • IO status information
  • accounting information
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

identifier

A
  • stored in process control block
  • unique, distinguishes it from other processes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

state

A
  • stored in process control block
  • if a process is running/blocked/ready/suspended, etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

priority

A
  • stored in process control block
  • priority level relative to other processes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

program counter

A
  • stored in process control block
  • address of next instruction in program to be executed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

memory pointers

A
  • stored in process control block
  • pointers to program code and data associated with this process + any memory blocks shared with other processes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

context data

A
  • stored in process control block
  • data present in registers in processor while process is executing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

I/O status information

A
  • stored in process control block
  • includes outstanding I/O requests, I/O devices assigned to the process, list of files in use by process, etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

accounting information

A
  • stored in process control block
  • includes amount of processor/clock time, time limits, account numbers, etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

trace of a process

A
  • the sequence of instructions that execute for that process, used to characterized behavior of individual processes
  • Processor behavior characterized by how traces of various processes are interleaved
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Dispatcher

A

small program that switches processor from 1 process to another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

2 state process model

A
  • process is either in Running or Not Running state
  • When OS creates new process, it creates process control block for it and enters process into system in Not Running state
  • Process exists, is known to OS, is waiting for opportunity to execute
  • At times, currently running process will be interrupted and dispatcher will select other process to run, which moves it into Running state
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

2 state process model dispatcher behavior

A

Any interrupted process is transferred to queue of waiting processes by dispatcher
- If process is completed/aborted, it is discarded and exits system via dispatcher
- Dispatcher takes process from queue to execute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Process creation

A

OS builds data structures used to manage the process and allocates address space in main memory to process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

process creation reasons

A
  • new batch job
  • interactive logon
  • created by OS to provide a service
  • spawned by existing process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

process spawning

A
  • when OS creates a process at explicit request of another process
  • parent process and child process
  • related processes usually need to communicate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Process termination

A

computer system must provide means for a process to indicate its completion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

process termination reasons

A
  • normal completion
  • time limit exceeded
  • memory unavailable
  • bounds violation
  • arithmetic error
  • timer overrun
  • IO failure
  • invalid instruction
  • privileged instruction
  • operator/OS intervention
  • parent termination
  • parent request
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

5 state process model

A
  • running - currently being executed
  • ready - prepared to execute
  • blocked/waiting - can’t execute until some event occurs
  • new - created process but not yet admitted to pool of executable processes
  • exit - process released from pool of executable processes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

process exit stages

A
  1. Process terminated when it reaches natural completion, aborts due to unrecoverable error, or when another process with authority causes it to abort
  2. Process no longer eligible for execution
    - Information associated with job temporarily preserved by OS so support/auxiliary programs can extract needed info
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

process dispatching priority

A

convenient to have multiple ready queues for different priority levels

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

suspended process

A
  • Processor can be idle when all no processes are in ready state (Can’t easily increase memory capacity)
  • processes can be stored in secondary storage to make room for new/previously suspended process
  • useful in detecting security threats and debugging software
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Swapping

A
  • moving part/all of a process from main memory to disk
  • When no processes in main memory are in Ready state, OS puts a blocked process into suspend state and swaps it out to disk into a suspend queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

suspend queue

A

queue of existing processes that have been temporarily removed from main memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Suspended process characteristics

A
  • Process not immediately available for execution
  • Process may/may not be waiting on an event
  • Process placed in suspended state by an agent (itself, parent process, OS) for purpose of preventing its execution
  • Process may not be removed from this state until agent explicit orders its removal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

process suspension reasons

A
  • swapping
  • other OS reason - background/utility process/problem causing process
  • interactive user request
  • timing
    parent process request
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

OS control structures

A
  • OS constructs and maintains information tables about each entity it manages
  • memory tables
  • IO tables
  • file tables
  • process tables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

memory tables

A
  • tracks main(real) and secondary(virtual) memory
  • some main memory reserved for OS
  • includes:
    – allocation of main memory to processes
    – allocation of secondary memory to processes
    – protection attributes of blocks of main/virtual memory
  • any information needed to manage virtual memory
34
Q

IO tables

A
  • manages IO devices and channels of computer system
  • At any given time, an IO device may be available or assigned to a particular process
  • If IO operation is in progress, OS needs to know:
    • status of the IO operation
    • location in main memory being used as the source/destination of the IO transfer
35
Q

File tables

A
  • provide information about existence of files, their location on secondary memory, their current status, other attributes
  • This info may be maintained/used by file management system → OS has little/no knowledge of files
  • In other OSes, OS manages file management details
36
Q

Process tables

A
  • manages processes
37
Q

OS table linkages

A
  • Memory, IO, files are managed on behalf of processes → process table must contain direct/indirect reference to them
  • Files in file tables are accessible via IO device and will be in main/virtual memory sometime
  • Tables themselves must be accessible by OS and are subject to memory management
38
Q

process control structures

A

To manage and control a process the OS must know process location and process attributes

39
Q

process location

A
  • Process image location depends on memory management scheme being used
  • simple vs modern
40
Q

simple memory management scheme

A
  • Process maintained as contiguous block of memory in secondary memory
  • For OS to manage process, small portion of its image must be in main
  • To execute process, entire process image must be loaded into main/virtual memory
41
Q

modern memory management scheme

A
  • Paging hardware allows noncontiguous memory to support partially resident processes
  • At a given time, a portion of a process image may be in main memory, with remainder in secondary memory
  • Process tables maintained by OS must show location of each page of process image
42
Q

process image

A

Physical manifestation of a process consists of:
- Sufficient memory to hold user program + user data
- stack
- process control block

43
Q

user program

A

program/set of programs to be executed

44
Q

user data

A
  • data of process
  • Modifiable part of user space (program data, user stack area, modifiable programs)
45
Q

stack

A
  • used to keep track of procedure calls and parameter passing between procedures
  • Each process has 1/more LIFO stacks
46
Q

process attributes

A
  • necessary for its management, resides in process control block
  • 3 categories of process control block information
    1. process identification
    2. processor state information
    3. process control information
47
Q

process identification

A
  • process control block information
  • each process is assigned a unique identifier (index into primary process table or mapping that allows OS to locate table based on identifier)
48
Q

process identification usage

A
  • Many tables controlled by OS use process identifiers to cross reference process tables
  • Memory tables may be organized to provide map of main memory with indication of which process is assigned to which region
  • Similar references will appear in IO and file tables
  • When processes communicate with each other, process identifier informs OS of destination of a particular communication
  • When processes create other processes, identifiers indicate parents and descendants of each process
49
Q

processor state information

A
  • process control block information
  • contents of processor registers (user-visible, control and status, stack pointers) when process is running
  • program status word
50
Q

program status word

A
  • processor state information
  • register/set of registers present in all processors
  • Contains condition codes and other status information
  • Ex: EFLAGS register is used by any OS using an Intel x86 processor
51
Q

Process control information

A
  • process control block information
  • additional info needed by OS to control/coordinate various active processes
52
Q

process control block role

A
  • Most important data structure in an OS
  • Routines within OS needs access to process control block
53
Q

process control block as data structure

A
  • Contains all information about a process needed by OS
  • Blocks are read or modified by virtually every module in OS
  • Set of process control blocks defines the state of the OS
54
Q

process control block access

A
  • Routines within OS needs access to process control block
  • Access isn’t difficult, protection is
    • A bug in a single routine could damage process control blocks, destroying the system’s ability to manage affected processes
    • Design change in structure/semantics of process control block could affect multiple modules in OS
55
Q

Modes of execution

A
  • most processors support at least 2, protects OS and key OS tables from user program interference
    • user mode
    • system/kernel mode
56
Q

User mode

A
  • less privileged mode
    • User programs usually execute in this mode
57
Q

System mode

A
  • more privileged mode
  • Certain instructions can only be executed in this mode (reading/altering control register (PSW, primitive IO instructions, memory management instructions))
  • certain regions of memory can only be accessed in this mode
58
Q

determining mode of execution

A

Bit in PSW indicates mode of execution, is changed in response to certain events

59
Q

process creation steps

A
  1. assign unique process identifier to new process - new entry added to process table
  2. allocate space for process - for all elements of process image
  3. initialize process control block
  4. set appropriate linkages
  5. create or expand other data structures
60
Q

system interrupts

A

interrupt
- trap
- supervisor call

61
Q

process switching

A

may occur any time that OS has gained control from currently running process

62
Q

interrupt

A

due to event that is external to and independent of currently running process

63
Q

Clock interrupt

A
  • interrupt
  • OS determines whether currently running process has been executing for maximum allowable unit of time (time slice)
  • If yes, process must be switched to a Ready state and another process dispatched
64
Q

I/O interrupt

A
  • interrupt
  • OS determines what I/O action has occurred
  • If IO action constitutes an event for which 1/more processes are waiting, OS moves all corresponding blocked processes to Ready state, and Blocked/Suspend processes to Ready/Suspend state
  • OS then decides whether to resume execution of current Running state process, or switch to a higher-priority Ready process
65
Q

Memory fault

A
  • interrupt
  • processor encounters a virtual memory address reference for a word not in main memory
  • OS brings in block (page/segment) of memory containing reference from secondary memory to main memory
  • Once IO request is made to do this, process with memory fault is placed in Blocked state, OS switches process
  • After desired block is brought into memory, that process is placed in Ready state
  • Control is transferred to interrupt handler then a interrupt-specific OS routine
66
Q

trap

A
  • system interrupt
  • error/exception generated within currently running process
  • OS determines if error/exception condition is fatal
  • Yes - Current process moved to Exit state → process switch
  • No - OS action depends on error nature and OS design
  • Recovery procedure/user notification/process switch/resume process
67
Q

Supervisor call

A
  • system interrupt
    • activates OS, from program being executed
  • An instruction that requests IO or an OS routine
68
Q

interrupt stage

A
  • During this, processor checks if any interrupts are pending
  • If no - processor proceeds to fetch stage and fetches next instruction of current program in current process
  • If yes
    1. Processor sets program counter to starting address of interrupt handler program
    2. Processor switches from user mode → kernel mode so interrupt processing code may include privileged instructions
    3. Processor proceeds to fetch stage and fetches first instruction of interrupt-handler program
    4. Context of interrupted process is saved into its process control block
    5. Includes any information that may be altered by execution of interrupt handler and that will be needed to resume process (Processor state information)
  • May occur without changing current Running process
69
Q

context switching steps

A
  1. Save context of processor (includes PC and other registers)
  2. Update process control block of process that is currently in Running state
    - change process state
    - update relevant fields
    - move process control blocks to appropriate queue
    - select another process for execution
    - update process control block of process selected
    - update memory management data structures
    - restore processor context
70
Q

Nonprocess Kernel

A

traditional approach is to execute OS kernel outside of any process (process applies only to user programs, OS code is executed as separate entity operating in privileged mode)
- When current running process is interrupted or issues supervisor call, mode context of process is saved and control is passed to kernel
- OS has its own region of memory to use and its own system stack for controlling procedure calls and returns
- OS can perform any desired functions and restore process or dispatch another process

71
Q

execution within user processes

A
  • common with OSes on personal computers
  • Execute almost all OS software in context of a user process
  • OS is primarily a collection of routines the user calls to perform various functions, executed within environment of the user’s process
  • At any given point, OS is managing n process images
    • Each image includes user process info + program/data/stack area for kernel programs
  • When interrupt, trap, supervisor call occurs
    • Processor placed in kernel mode, control passed to OS
    • Mode switch but not process switch
    • OS can decide to resume process by mode switching again or process switch
72
Q

process based OS

A
  • implement OS as collection of system processes
  • Software part of kernel executes in kernel mode but major kernel functions are organized as separate processes
    Advantages:
    • Encourages modular OS with clean interfaces between modules
    • Noncritical OS functions are implemented as separate processes
    • Implementing OS as a set of processes is useful in a multiprocessor/multicomputer environment (Some OS services can be on a dedicated processor, improving performance)
73
Q

Unix SVR4

A
  • Uses model where most of OS executes within environment of a user process
  • user processes and system processes
  • enters kernel mode by (issuing system call, when exception/fault is generated, when interrupt occurs)
74
Q

UNIX process image elements

A
  • user context (text area, data area)
  • register context
  • system level context
75
Q

user context

A
  • UNIX process image element
  • contains basic elements of a user’s program and can be generated directly from a compiled object file
  • text area - read only, holds program instructions
  • data area - shared memory area shared with other processes
76
Q

Register context

A
  • UNIX process image element
    • where processor status information is stored when a process isn’t running
77
Q

System-level context

A
  • UNIX process image element
    • contains remaining information that OS needs to manage process
  • Static part - fixed in size and stays with a process throughout its lifetime
  • Dynamic part - varies in size through life of process
78
Q

UNIX process control

A
  • When a process issues a fork request, OS performs:
    1. Allocates a slot in process table for new process
    2. Assigns unique process ID to child process
    3. Makes copy of process image of the parent, with exception of any shared memory
    4. Increments counters for any files owned by parent, to reflect that an additional process now also owns those files
    5. Assigns child process to Ready to Run state
    6. Returns ID number of the child to the parent process, and a 0 value to the child process
  • All of this is done in kernel mode in parent process
  • After creating process, kernel can do one of the following as part of dispatcher routine
    • Stay in parent process
    • Transfer control to the child process
    • Transfer control to another process
79
Q

degree of multiprogramming

A

refers to number of processes in memory

80
Q

Event queue

A
  • list of processes waiting for a particular IO device
81
Q

context switching

A
  • switching processes from one state to another
  • OS temporarily suspends the execution of one process and saves its current state. It then loads the saved state of another process and begins executing it.
  • OS must be designed so that this is transparent to processes
82
Q

maximum concurrent processes

A

equal to the number of processors in the system