13 - Address Spaces Flashcards

1
Q

What is the VM system responsible for?

A

providing the illusion of a large, sparse, private address to each running program

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

What does each virtual address space contain?

A

All of a program’s instructions and data

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

What does the OS do with each virtual memory reference?

A

Turn them to physical addresses

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

What is presented to the physical memory in order to fetch or update the desired information?

A

Physical addresses

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

What is multiprogramming?

A

multiple processes are ready to run at a given time, and the OS can switch between them.

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

Name a benefit of multiprogramming.

A

increased effective CPU utilization which lead to increase efficiency

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

Name optimal way to implement time sharing

A

leave processes in memory while switching between them, allowing the OS to implement time sharing efficiently

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

Name something about protection

Talk about what you want or don’t want a process to do

A

You don’t want a process to be able to read or write some other process’s memory

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

The easy to use abstraction of physical memory is also known as?

A

Address space

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

What is the running program’s view of memory in the system?

A

Address space

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

What is the ‘code’ of the program otherwise known as, and where is it?

A

the instructions of the program and they are in the address space

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

What data structure does the running program use and for what? (First one mentioned)

A

A stack. Keep track of where it is in the function call chain as well as to allocate local variables and pass parameters and return values to and from routines

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

What data structure does the running program use and for what? (Second one mentioned)

A

A heap. for dynamically-allocated, user-managed memory

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

What are three components in an address space?

A

code, stack, heap

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

Is code static or dynamic, and what are the perks of it?

A

Static. Easy to place in memory and can place it at the top of the address space and know that it won’t need any more space as the program runs.

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

Are stack and heap dynamic or static and where are their locations, respective to each other?

A

Both are dynamic. Heap is above stack. Stack is below heap.

16
Q

What about heap and stack’s growth?

A

They have to grow in opposite directions. Heap grows downward while stack grows upward.

17
Q

Can stack and heap be placed differently?

A

Yes, when multiple threads co-exist in an address space, dividing the regions nicely like this won’t work anymore

18
Q

When processes are loaded into memory at different addresses, what is the OS doing?

A

Virtualizing memory. The running program thinks it is loaded into memory at a particular address and has a potentially large address space. The reality is different.

19
Q

What if a process tries to perform a load at a virtual address?

A

Somehow the OS, along with hardware support, will have to make sure the load doesn’t actually go to the physical version of the virtual address but rather the physical address of where the process is loaded into memory.

20
Q

What are the three goals of virtual memory?

A

Transparency, Efficiency, Protection

21
Q

In Transparency, how does the OS implement virtual memory and how should the program behave?

A

In a way that is invisible to the running program. The program should behave as if has its own private physical memory.

22
Q

In Efficiency, on what terms should the virtualization make as efficient as possible and what will the OS rely on?

A

time(not making programs run more slowly) and space(not using too much memory for structures needed to support virtualization). The OS will have to rely on hardware support, like TLBs

23
Q

In Protection, what should the OS makes sure to do and what property does the OS deliver to each process?

A

The OS makes sure to protect processes from each other and the OS itself from the processes. When a process is in action, it should not be able to access or affect in any way the memory contents of any other process or the OS itself. The OS delivers ISOLATION among processes.

24
Q

What is a key principle of building reliable systems?

A

Isolation

25
Q

What kernels are used in Isolation?

A

Microkernels