P1L2: Introduction to Operating Systems Flashcards

1
Q

What are the key roles of an operating system?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which are operating system abstractions?

File editor, File system, cache memory, device driver, scheduler, web browser

A

File system, device driver, scheduler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Can you make distinction between OS abstractions, mechanisms, policies?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the principle of separation of mechanism and policy mean?

A

Implement flexible mechanisms to support many policies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the principle optimize for the common case mean?

A
  1. 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
  2. Select the correct policy that is supported by the current mechanisms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a system call? How does it happen? What are the steps that take place during a system call?

A
  • 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

  1. (User process) user process executing
  2. (User process) calls system call
  3. (kernel) trap mode bit = 0
  4. (kernel) execute system call
  5. (kernel) trap mode bit = 1
  6. Return from system call

To make system call application must:

  • write arguments
  • save relevant data at well defined location
  • make system call
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a kernel trap? Why does it happen? What are the steps that take place during a kernel trap?

A

.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Contrast the design decisions and performance tradeoffs among monolithic, modular and microkernel-based OS designs.

A
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
-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a kernel?

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Elements of an OS

A
  • Abstractions
  • Mechanisms
  • Policies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly