P1L2: Introduction to Operating Systems Flashcards
What are the key roles of an operating system?
- Hides the hardware complexity. Provides functions like read/write to applications to interact with memory. File is an abstraction, storage
- Manages hardware on behalf of one or more applications according to predefined policies. Schedules use of CPU for application and allocates memory
- ensures that applications are isolated and protected from one another. For example avoid memory overwrite 2 applications
Which are operating system abstractions?
File editor, File system, cache memory, device driver, scheduler, web browser
File system, device driver, scheduler
Can you make distinction between OS abstractions, mechanisms, policies?
- Mechanisms: Operate on top of the abstractions.
- Policies: determine how the mechanisms will be used to manage the hardware related to the abstractions
- Example:
- Abs: memory page
- Mecha: allocate, map to a process
- Policies: least recently used to determine if to create memory page in DRAM or disk
What does the principle of separation of mechanism and policy mean?
Implement flexible mechanisms to support many policies
What does the principle optimize for the common case mean?
- Study on the current common case like the system that the OS is going to be installed, how the user is going to do in the machine and the expected workload
- Select the correct policy that is supported by the current mechanisms
What is a system call? How does it happen? What are the steps that take place during a system call?
- Interface that allow the interaction between the applications and the operating system
- Interface with some defined set of operations that the application can invoque so the OS does some service or privilege access in the hardware resources.
- Example: open(file), send(socket)
Steps
- (User process) user process executing
- (User process) calls system call
- (kernel) trap mode bit = 0
- (kernel) execute system call
- (kernel) trap mode bit = 1
- Return from system call
To make system call application must:
- write arguments
- save relevant data at well defined location
- make system call
What is a kernel trap? Why does it happen? What are the steps that take place during a kernel trap?
.
Contrast the design decisions and performance tradeoffs among monolithic, modular and microkernel-based OS designs.
Monolithic \+ Everything is included \+ compile-time optimizations - Portability - Hard to maintain - Takes a lot of memory - Bad performance
Modular \+ Modules can be added, it has a basic structure \+ maintainability \+ Smaller code size \+ Less resource needs - Maintenance can be an issue - Indirection can impact performance
Microkernel (Needs work)
It is smaller than modular and does not include File system or disk driver
+ Size
- It is complex to develop software, because it is very specialized and has unique requirements
-
What is a kernel?
…
Elements of an OS
- Abstractions
- Mechanisms
- Policies