Part 1 Flashcards
What are the key roles of an operating system?
An OS is a special piece of software that abstracts and arbitrates the use of a computer system. Some of its key roles include:
- Interface and hide hardware complexity
- Manage hardware and resources for more than one application
- Ensure applications are isolated and protected from one another.
Can you make distinction between OS abstractions, mechanisms, policies?
Examples:
Abstractions: Process, thread, file, socket, memory, etc
Mechanisms: Create, schedule, open, write, allocate, etc
Policies: Least-Recently Used (LRU), Earliest Deadline First (EDF)
What does the principle of separation of mechanism and policy mean?
The idea is to create mechanisms that are flexible enough to support many different policies of an operating system.
What does the principle optimize for the common case mean?
To optimize for the common case means to answer a variety of questions that allows us to pick the best suited policy and mechanics for that discovered case.
What happens during a user-kernel mode crossing?
It largely depends. Some operating systems support user-kernel crossing, and will only allow so if a specific bit is set in the cpu.
If that bit is not explicitly set, an access forbidden error is thrown.
What are some of the reasons why user-kernel mode crossing happens?
An application might be trying to open/read to a file or device, or connecting to a socket.
What is a kernel trap? Why does it happen? What are the steps that take place during a kernel trap?
A kernel trap is a detection for an application from the user level trying to access illegal information or cross into the kernel level. During a kernel trap, the application or process is interrupted and allows the OS to take control at a specific location. The OS can check why the trap was triggered and what to do next.
What is a system call? How does it happen? What are the steps that take place during a system call?
A system call is a set of operations that user-level applications can call or make use of from that is provided by the OS. Methods like Open(file), send(socket), or malloc(memory).
When a system call is made from the user process, the information is passed to the OS where the process will execute (disabling the trap bit if legal), and then returning the outcome back to the process and resetting the trap bit.
Contrast the design decisions and performance tradeoffs among monolithic, modular and microkernel-based OS designs.
Monolithic: \+ Everything is included \+ Compile time optimizations by inlining - Difficult to customize and portability suffers - Huge memory footprint
Modular (More common approach): \+ Maintainable \+ Smaller memory footprint \+ Needs less resources - Indirection can have an impact on performance - Maintenance can still be an issue
Microkernel:
+ Very small
+ Easy to verify
- Portability still suffers (Super customized)
- Very complex to develop
- Very frequent user/kernel crossings (expensive)