Flashcards
Sem título

Flashcards do conjunto (37)
- 1What are the three key ideas of an operating system?abstraction
mechanism
policy - 2What are the two purposes of a kernel1. Provides abstract machine
2. Provides/manages resources - 3What is a resource?Anything that allows work to get done
- 4What are the bits of user and kernel mode?Kernel - 0
User - 1 - 5What are the different kernel structures?Simple (MS-DOS, Unix)
Layered (T.H.E.)
Microkernel (Mach)
Modules (Modern Unix) - 6What is Arrakis?Under research by Jon Solworth
Ethos
Has a secure OS by isolation
virtualized I/O devices - 7Label the following registers PC SP GPprogram counter
stack pointer
(general purpose) registers - 8How would you run multiple programs?multiprogramming
- 9Context Switching1. Allocate CPU from one process to another
2. Load the context - 10Simple Context Switching (steps)Have two processes, A and B
1. A calls yield to voluntarily give up CPU to B
2. Save and restore registers
3. Switch text and data
4. Switch stacks - 11TimesharingConcurrent use of the CPU by more than one process
Characterized by process state (running, ready, blocked) - 12Logical vs. Physical Execution

- 13Process State Diagram

- 14What is the process to switch between user and kernel space?1. In hardware
- switch from user to kernel mode: amplifies power
- go to fixed kernel location: interrupt/trap handler
2. in software
- run handler code
- return to user mode - 15How does context switching occur?1. Switch to kernel
2. save context of last-running process
3. conditionally...
- select new proc from those that are ready
- restore context of selected proc
4. return to user mode - 16trapframe- builds frame on kernel stack
- contains all information necessary to restore the user mode registers
- built to restore process - 17Fork- process creation
- returns twice: the child's PID to the parent and "0" to the child - 18Process of fork()1. creates new address space
2. initialize address space with a copy of the parent's address space content
3. initialize kernel resources to point to those used by the parent
4. place process in ready queue - 19Process of exit()1. free resources and terminate
- close open files, network connections
- allocated memory
- remove procs from kernel data structures, delete
2. pass status to other processes - 20What are the goals of allocproc?1. allocate memory space for a process
2. when fork or init returns, we want the new process to run in userspace as if it just returned from a system call
3. create stack frames to make its context look as if it made a system call - 21Types of best space algorithmsfirst fit - fast
best fit - leaves small fragments
worst fit - leaves large fragments - 22Buddy Systemdynamically partition in powers of 2 chunks
allocate smallest chunk
free the chunk and coalesce with buddy - 23Basic Page Replacement AlgorithmsFIFO - select oldest page
OPT - select page to be used furthest in future
LRU - select page that was least recently used - 24Working Set vs Resident Setworking set - set of pages a process is using
resident set - set of pages currently in memory - 25Resident Set Managementresident set - pages of process in physical memory
local - limit frame selection to requesting process
global - select any frame (from any process) - 26Multiprogramming Levelsmaller resident sets = more process in memory
resident sets should contain working set - 27Phases of locality for a processperiod of locality - few faults outside working set
locality change - many faults, change in working set - 28Denning's Working Set ModelW(t, Δ)
Page referenced during last delta
(process time)
- difficult to implement - 29page fault frequencytoo high = working set not present
- give more frames; if none, swap out
too low = resident set too large
- take away frames - 30First Come First ServedAllocate CPU to processes in the order they arrive
preemptive, bad for short processes - 31Round Robintime slice - give each process a quantum in turn
- 32Shortest Process Next- select process with shortest service time currently available
- results in shortest possible average time
- optimal, non-preemptive, must know service times - 33Shortest Remaining Time- select process with shortest remaining time
- optimal, preemptive, must know service times - 34(Muti-level) Feedback Queues- preemptive: if a new process arrives, current process goes back to queue it came from
- runs process for 2^i quantums
(for queue i)
- favors shorter processes over longer, dynamic ones - 35Priority Scheduling- select process with highest priority
- allows scheduling based on arbitrary criteria
-> external (based on who's willing to pay the most)
-> internal (past CPU usage [dynamic]) - 36How to solve Priority Inversion?Priority Donation
- have a process hold a lock with a temporary high priority level
- after releasing lock, returns to original - 37Fair Share (Proportional Share)Utilization / Promised = Ratio
- select process with lowest ratio, needs CPU most
- ratio > 1 : process getting more than fair share
- ratio < 1: process is not getting fair share
- ratio = 1: process is getting exactly fair share
Informações
- Descrição
- FlashCards sobre Sem título, criado por Bresia Prudente em 13-10-2015.
- Criado por
- Bresia Prudente
- Visualizações
- 0
- Avaliação