Part 1 Flashcards

1
Q

What are the key roles of an operating system?

A

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

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

A

Examples:
Abstractions: Process, thread, file, socket, memory, etc

Mechanisms: Create, schedule, open, write, allocate, etc

Policies: Least-Recently Used (LRU), Earliest Deadline First (EDF)

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

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

A

The idea is to create mechanisms that are flexible enough to support many different policies of an operating system.

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

What does the principle optimize for the common case mean?

A

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.

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

What happens during a user-kernel mode crossing?

A

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.

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

What are some of the reasons why user-kernel mode crossing happens?

A

An application might be trying to open/read to a file or device, or connecting to a socket.

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

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.

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

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

A

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.

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

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

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

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