Operating Systems Flashcards

1
Q

Key Roles of an OS

A

1) Hide hardware complexity (e.g. no need to think about how to interact with hdd)
2) manage underlying HW resources (allocates memory for apps)
3) provides isolation and protection (apps shouldn’t access other app’s memory)

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

What is an OS? (3 things)

A

A layer of software systems that:

1) directly has priviliged access to underlying HW
2) manages hw on behalf of 1 or more apps according to predefined policies
3) ensures that apps are isolated and protected from one another

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

List abstractions:

A

1) process, thread, file, socket memory page

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

List mechanisms:

A

2) create, schedule, open, write, allocate

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

policies:

A

used to determine exactly how the mechanism will be used to manage underlying hw (LRU)

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

Give an example of abstractions, mechanism and policies:

A

Abstraction: memory page
Mechanism: “allocate”
policy: determines when to move page from DRAMto disk (LRU)

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

Separation of Mechanism and policy:

A

memory management mechanisms should be generalized to these different policies (LRU, LFU for memory)

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

optimize for common case

A

understanding the common case helps OS implement correct policy basedon generalized mechanism

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

user-mode

A

unprivileged

where most apps run

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

kernel mode:

A

OS operates in kenernel mode with direct access to HW

privileged

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

user kernel mode crossing

A

1) app wants direct acess to HW so it uses a system call
2) control is switched to OS which can flip a bit in cpu to allow app access to HW
3) if privileged instructions are encountered in non-privileged execution, the app becomes trapped at which point the OS can grant access or terminate

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

trapped

A

when a privileged instruction is encountered by HW in non-privileged execution

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

system call definition:

A

an interface that can be invoked by app to allow privileged access of HW resources for the app on behalf of OS (e.g. open, send, mmap)

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

System call flow:

A

1) app needs access to HW so makes system call
2) control is passed to OS which accesses HW
3) execution control and data is passed back to app process from OS

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

Monolithic kernel Pros and Cons:

A
Pros: everything included
inlining, compile time optimizations
Cons: no customization
not portable
large memory footprint that may impact performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Modular kernel pros and cons:

A

Pros: maintainability, smaller footprint than monolithic, less resources needed
Cons: may reduce optimization (but probably not)
maintenance may be issue

17
Q

microkernel pros and cons:

A

pros: size, verifiability
cons: bad portability due to customized to underlying HW
expensive cost of frequent user/kernel crossing