1. Introduction to operating systems Flashcards

- key components - design principals

1
Q

What is an operating system?

A

A special piece of software that abstracts and arbitrates the underlying hardware system.

  • hides hardware complexity
  • resource management
  • provide isolation protection (e.g., multiple running applications can’t hurt each other)

A layer of systems software that resides between applications and hardware.

It has privileged access to the underlying hardware and manipulate its state.

It’s role is to hide hardware complexity and manage hardware on behalf of one or more applications according to some predefined policies.

It also ensures that 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

What role does an operating system play in computer systems?

A
  • Directs operational resources (e.g., control use of CPU, memory, peripheral devices)
  • Enforces working policies (e.g., fair resource access, limits to resource usage)
  • Mitigates difficulty of complex tasks (e.g., abstract hardware details with system calls)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the key elements of an operating system?

A
  • abstractions
  • mechanisms
  • policies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the key design considerations of an operating system?

A

> Separation of mechanism & policy
- implement flexible mechanisms that can support many policies (e.g., LRU, LFU, random)

> Optimize for the common case
- based on the common case we can pick a policy that makes sense and can be supported by the underlying mechanisms and abstractions

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

What are some examples of OS abstractions?

A
  • process
  • thread
  • file
  • socket
  • memory page
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are some examples of OS mechanisms?

A
  • create
  • schedule
  • open
  • write
  • allocate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some examples of OS policies?

A
  • least-recently used (LRU)

- earliest deadline first (EDF)

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

Computer platforms distinguish between at least two modes of privilege. What are they?

A
  • user-level (unprivileged)

- kernel-level (privileged)

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

What is a privilege bit?

A

In kernel-level privileged mode a privileged bit is set in the CPU to indicate that we’re in this mode. In user-level unprivileged mode this bit is not set. Attempts to perform privileged operations will be forbidden and will cause a trap.

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

What happens when a trap is triggered by a user-level process attempting to access hardware?

A
  • The application will be interrupted
  • Hardware will switch the control to the operating system
  • The operating system will check what caused what caused the trap to occur and then will verify if it should grant that application access or terminate the process.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are examples of things that cross the user/kernel protection boundary?

A
  • trap instructions
  • system calls
  • signals
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do user/kernel transitions affect application performance?

A
  • they involve many instructions (e.g., ~50-100ns on a 2 GH machine running Linux)
  • the operating system brings some of what it needs into the hardware cache, likely displacing stuff the application needs, which will have some impact on performance b/c the application will then need to go to memory for the data it needs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are some pros and cons of a monolithic OS?

A

Pros:

  • everything included
  • inlining, compile-time optimizations

Cons:

  • customization, portability, manageability
  • memory footprint
  • performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are some pros and cons of a monolithic OS?

(every type of service that any application could require of that any type of hardware will demand is already part of the operating system)

e.g., some times of specialized file systems

A

Pros:

  • everything included
  • inlining, compile-time optimizations

Cons:

  • customization, portability, manageability
  • memory footprint
  • performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some pros and cons of a modular OS (e.g., Linux)

(some types of basic services and apis are already part of the operating system but everything can be customized. this is possible because the os specifies certain interfaces that every module must implement in order to be part of the os)

A

Pros:

  • maintainability / upgradability
  • smaller footprint
  • less resource needs

Cons:

  • indirection can impact performance
  • maintenance can be an issue as modules come from different codebases and can introduce bugs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are some pros and cons of a microkernel

A

Pros:

  • size
  • verifiability

Cons:

  • portability
  • complexity of software development
  • cost of user/kernel crossing