Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
103 Cards in this Set
- Front
- Back
What is an operating system? |
The basic software required to operate a computer. |
|
What kind of program does not belong to OS? Give an example of each. |
User programs: compilers, word processors Most utility programs: mkdir Command language interpreter: UNIX shell |
|
Which program executions are not controlled by the kernel? |
All program executions are controlled by the kernel. |
|
What are other names for the kernel? |
monitor supervisor executive core of the OS |
|
How do programs interact with the kernel? |
System calls |
|
Are all IO operations performed through system calls? |
Yes. |
|
What are the four basic functions of an OS? |
1) proved a better user interface 2) manage the system resources 3) protect users' programs and data 4) let programs exchange information |
|
Why is improvement of the UI a basic function of an OS? |
Directly accessing hardware would be a nightmare. |
|
Describe time sharing. How was it advantageous? |
Several users interact with a single computer at the same time. It was an economical solution for when computers were expensive. |
|
What advantages do file systems offer users? |
1) lets users create and delete files without worrying about disk allocation 2) some can tolerate disk failures (RAID) |
|
When are the advantages file systems not seen as such? |
1) when users need to specify how their files are stored on the disk, for example, database designers usually bypass the file system. |
|
What are the two main techniques for optimizing IO access? |
1) managing disk access more efficiently 2) doing something else while waiting for an IO operation |
|
Is disk access always necessary for read operations? |
No, most small operations do not need any. |
|
How much does an OS typically read during a disk access? In blocks? In KB? |
Entire blocks are read (4KB +) |
|
Where are blocks read by OS stored? |
In the IO buffer. |
|
What system of optimizing reads well enough for most systems to use it? |
Buffered reads |
|
What is the major limitation of buffered reads? |
When trying to move too far ahead of the program data that will never be used may be brought in. |
|
What is caching in the context of read access optimization? |
Keeping recently accessed blocks in a buffer in the hopes that they will be accessed again Caching is a fundamental technique of OS and database design! |
|
Why do small writes require disk access? |
Most of them do not! |
|
Does an OS write actively, or does it write in groups? |
It writes "in groups," delaying a write for a few seconds then writing an entire block |
|
What is the major drawback of delayed writes? |
Data loss may occur if system or program crashes. |
|
Why would a crash cause a system that uses delayed write to lose data? |
The program may have issued a write but the data has not necessarily been saved to the disk. |
|
What does multi-programming allow a computer to do? |
It is when the OS lets the CPU run another program while the program waits for an IO |
|
Why has multi-programming been advantageous for business applications? |
1) many applications use peripherals more than the CPU 2) the CPU was the most expensive component of a computer for a long time 3) multi-programming keeps the CPU busy 4) it made time sharing possible 5) allows a PC to run several applications simultaneously |
|
How many tasks can a n core(s) CPU work on at any given time? |
n tasks. |
|
How does the OS reassert control of the CPU? |
It uses interrupts. |
|
How does multiprogramming effect the relationship between the CPU and IOs? |
It ensures that the CPU doesnt waste any time waiting for completion of IOs |
|
In what scenarios does the OS need to regain control of the CPU? |
1) a task has exhausted its fair share of CPU time 2) something else needs to be done |
|
What is an interrupt? |
A request to interrupt the flow of execution of the CPU |
|
What detects an interrupt? When is it detected? |
It is detected by the CPU hardware. Detection occurs after it has executed the current instruction and before it starts the next instruction. |
|
Write pseudo code in which interrupts are detected at the proper time. |
check_for_interrupts(); fetch_instruction(); decode_instruction(); execute_instruction(); |
|
What happens when an interrupt occurs? |
1) the current state of the CPU is saved, typically on the top of a stack 2) a new CPU state is fetched |
|
Does a process "know" if has been interrupted? |
No. |
|
Does the new state that accompanies and interrupt have a program counter that is defined by the artifact? |
The PC is defined by the hardware. What even is an artifact in this context that doesn't even make sense |
|
Name the four types of interrupts presented in Chapter 1 |
1) IO completion interrupts 2) timer interrupts 3) traps 4) system calls |
|
What does an IO completion interrupt do? |
it notifies the OS that an IO operation has completed |
|
What does a time interrupt do?
|
it notifies the OS that a task has exceeded its quantum of CPU time (T) |
|
What does a trap interrupt do? |
notifies the OS of a program error (division be zero, illegal address, ...) notifies the OS of a hardware failure |
|
What does a system call interrupt do? |
it notifies the OS that the running task wants to submit a request to the OS |
|
Do programs interrupt themselves? |
Yes. |
|
What is the overhead of any simiple system call? |
two context switches |
|
What two context switches result from an interrupt? |
1) running task is interrupted 2) task regains CPU |
|
Are context switches expensive? |
Yes. |
|
Can interrupt requests occur while a system is already processing another interrupt? |
Yes. Priority can exist in interrupts. |
|
What do vectorized interrupts entail? |
interrupts are prioritized (assigned a priority level according to their source) new interrupt requests will be allowed to interrupt lower priority interrupts while having to still wait for the completion of other interrupts. |
|
In what situation would interrupts be disabled by the OS? |
before performing short critical tasks works only for single threaded kernels |
|
In what situation would interrupts be disabled by the user? |
The user should never be able to disable interrupts! |
|
What is DMA? What does it allow the disk controller to do? |
Direct memory access (DMA) allows the disk controller to read data from and write data to main memory without any CPU intervention it "steals" memory cycles from the CPU |
|
What must users be prevented from doing to their data in order to protect their data? |
1) access 2) deleting 3) modifying without authorization other people's program and data |
|
What are the two aspects of data protection? |
1) protecting user's files on disk 2) preventing programs from interfering with each other |
|
What is the key idea in trying to protect a user's files? |
prevent users' programs from directly accessing the disk |
|
What are privileged instructions? |
instructions only the kernel can execute |
|
What are the two CPU modes that privldeged instructions need to operate? |
1) privledged/executive mode: allows CPU to execute all instructions 2) User mode: CPU executes only safe unprivleged instructions |
|
What is the state of a CPU determined by in the context of privileged instructions? |
a special bit |
|
What is the default state that a CPU is in? |
User mode |
|
Who can run in supervisor mode? |
ONLY the kernel |
|
How does the switch between user mode and supervisor mode happen? |
It is done through an interrupt |
|
Is a dual mode CPU enough to protect a user's files? |
No. |
|
What is memory protection? |
It is the means by which rogue users are prevented from tampering with the kernel. |
|
What does memory protection hardware do? |
1) checks every reference issued by a program 2) generates an interrupt when it detects a protection violation thus prevents programs from accessing any memory location outside their own address space |
|
What advantages does memory protection offer? |
1) prevents programs from corrupting address spaces of other programs 2) prevents programs from crashing the kernel |
|
Is memory protection really necessary for a multiprogramming system? |
yes |
|
Is having both dual mode CPU and memory protection enough to protect user's files? Justify your answer. |
No, rogue users have to be prevented from booting the system with a doctored kernel |
|
What are the two techniques for inter-process communication? |
1) message passing: general, not easy to use 2) shared memory: less general, easier to use, requires inter-process synchronization |
|
Name two instances of process abstraction |
virtualization the CPU: process scheduling virtualization the memory: memory management |
|
What are the strict real time constraints? |
1) process control 2) guidance systems 3) most multimedia applications |
|
When must critical tasks be performed in a real time system? |
Always! |
|
What defines a hard real time system? |
1) must guarantee that all deadlines will be met 2) any failure could have catastrophic consequences |
|
What defines a soft real time system? |
guarantee that most deadlines will be met |
|
What kind of OSes do hard real time applications run on? |
typically they run on special real time OSes |
|
Can soft real time applications run on a regular OS? |
yes, if the OS supports them |
|
Are interactive/time sharing systems real time systems? |
No, while they try to provide a fast response time they do not try to meet specific deadlines |
|
What is the major advantage of master/slave multi-processing |
simplicity |
|
What defines a master/slave multi-processing? |
a single copy of OS runs on a dedicated processor |
|
What is the major disadvantage of master/slave multi-processings |
lack of scalability |
|
What must symmetric multiprocessing prevent? How does it do this? |
multiple copies of an OS running parallel must not interfere with one another must add locks to all critical sections, disabling interrupts will not work |
|
What is a distributed system? |
an integrated network of computers or workstations sharing common resources |
|
Draw the client/server model. |
|
|
What performance issues exist for a network? |
1) Network latency is added to disk latency, negatively affecting the response time. 2) file consistency management 3) user authentication (a problem on insecure networks |
|
How does a network mask associated latencies? |
Client caching |
|
What are the three basic kernel organizations? |
1) monolithic kernel 2) layered kernels 3) microkernels |
|
How are monolithic kernels organized? |
There is no particular organization, all kernel functions share the same address space, including device drivers and other kernel extensions |
|
What problems do monolithic kernels introduce? |
Hard to manage, extend, and debug due to the lack of internal organization. |
|
What does BIOS stand for? |
basic input output system (BIOS) |
|
What is BIOS stored on? |
a chip (EEPROM) |
|
What does BIOS do? When does it do it? |
It takes control of the CPU when system is turned on, identifying system components and initiating a boot of the OS. It also provides low level IO access routines. |
|
What does a monolithic kernel contain? |
Everything that is not device specific including the file system and networking code. |
|
Define layered kernel. |
A hierarchy of layers, each of which define a new data object. Lower layers hide some of their functions from the higher layers. |
|
Give an example of a layered operating system kernel. |
User programs Buffering for IO devices Operator Console device driver memory managment CPU scheduling hardware |
|
What are the limitations of a layered design? |
There is no clear ordering of layers, for example, the memory management uses file system features and vice versa. This makes it less suitable for kernel design. |
|
Where does layered design do well? |
In networking code, each layer offering its own functionality is very useful. |
|
What is the key idea behind microkernels? |
Make the kernel smaller by delegating non-essential tasks to trusted user-level servers. |
|
What happens when a microkernel cannot delegate a task? |
It handles the task itself. |
|
Describe the process of microkernels. |
1) receives request from user program 2) decides to forward it to a user level server 3) waits for reply form server 4) forwards it to user program |
|
Does a trusted server run inside the kernel? What does that affect? |
No. It cannot execute privileged instructions |
|
What are the advantages of a microkernel? |
1) smaller 2) easier to secure and manage 3) servers running outside of the kernel so they cannot crash it 4) it is easier to extend kernel functionality by adding new servers |
|
What is the major disadvantage of microkernels? What causes this? |
too slow four context switches instead of two! |
|
What are modular kernels? |
Object files whose contents can be linked to and unlinked from the kernel at any time. |
|
Where do modular kernels run with reguard to the kernel address space? |
They run inside of the kernel address space. |
|
What kind of kernel is used to add kernel device drivers for new devices? |
Modular kernels |
|
What are the advantages of using a modular kernel? |
1) extensibility: add new features to kernel, process is transparent to user 2) no performance penalty on account of modules running in kernel address space |
|
What are the disadvantages of using a modular kernel? |
1) they are not as reliable, a single bad module can corrupt the entire kernel and crash the system. 2) many device drivers are poorly written and result in OS failures |
|
WHY? |
Unix has a monolithic kernel (which makes it fast) and does not allow extensions (which makes it both safe and non extensible) Windows has a monolithic kernel (which makes it fast) and allows extensions (which makes it both extensible and unsafe) Mach allows extensions in user space (which makes it extensible, safe and slow) |