QUESTIONS AND CORRECT ANSWERS
Algorithm - CORRECT ANSWER set of instructions with finite initial store and state, a
starting point, and unambiguous ordering until the endpoint
Process (general definition) - CORRECT ANSWER a program in execution
= program + state
Program - CORRECT ANSWER sequence of instructions that embody an algorithm
Job - CORRECT ANSWER a task to be completed
Why need an O.S.? - CORRECT ANSWER - load program onto computer
- access and supervise I/O devices
- manage resources
- protect private info
- facilitate program interactions
2 main OS Roles? - CORRECT ANSWER 1. resource manager
2. extended machine
3 types of resource management - CORRECT ANSWER 1. process manager (who executes)
2. memory manager
3. I/O management
Purpose of extended machine - CORRECT ANSWER allows user to not think about low-level
things. (file storage for example)
What OS is not? - CORRECT ANSWER - not UI
,- not development tools
- not libraries (even if it may use them)
3 general OS types - CORRECT ANSWER - interactive (laptop/pc)
- batch (priority is pre-defined queued tasks)
- real time (well-defined task priorities like in avionics or cars)
5 generations of OS - CORRECT ANSWER '45-'55 : vacuum tubes / plugboards
'55-'65 : transistors/batch
'65-'80 : ICs and timesharing
'80-now : PCs
'90-now : mobile computers and multicore systems
Multiprogramming v. Uniprogramming - CORRECT ANSWER multiple = 2+ programs' data
concurrently in main memory (RAM)
(uni is just 1 at a time)
T/F: modern systems do not allow direct reads from the disk, rather a syscall is passed to the kernel
which then returns the info (if allowed) - CORRECT ANSWER True
2 types of named calls - CORRECT ANSWER 1. procedure calls
2. system calls
Procedure Calls - CORRECT ANSWER - essentially a function call
- no context switch to kernel space (faster bc no OS help necessary)
- local vars and parameters
- frame pointer (where stack was before call)
- stack pointer (where new bottom of stack is)
Segments of Process in Memory - CORRECT ANSWER - TEXT(lowest): code being executed
- DATA(middle growing up): static + dynamic
, - STACK(highest growing down): activation frames of calls
System Calls - CORRECT ANSWER - provide interface to OS services
- context switch to kernel mode
- has sys lib entry point
- invocation causes kernel trap
- sys call number identifies a sysfunc from table
- returns to library, returns to user program
- parameters stored at specific mem. locations
Hardware Interrupts - CORRECT ANSWER - hardware device sends interrupt request signal
to the CPU through interrupt controller
- CPU acks interrupt (implicitly checks for interrupts before each new instruction is loaded)
- interrupt controller sends specific IRQ #
- current CPU instruction interrupted and dispatcher finds correct handler, executes
- CPU resumes in user mode
- type of ASYNCHRONOUS TRAP
Handle an interrupted interrupt process? - CORRECT ANSWER - solved with interrupt masks
- a CPU feature that allows computer to ignore an interrupt request until mask bit is disabled
- stores interrupt data in a (sometimes dedicated) register until ready
- implement protection states that allow for hierarchical interrupting
Precise Interrupt Qualities (4) - CORRECT ANSWER 1. PC saved in known state
2. All preceding instructions fully executed
3. No instructions after PC have been executed
4. Execution state of PC instruction is known
Imprecise Interrupts - CORRECT ANSWER - instructions are left incomplete or partially
executed
- could simulate precision by rolling back incomplete instructions