Segmentation Flashcards

1
Q

What is the only storage that the CPU can access directly?

A

Main memory and registers

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

What is swapping

A

-saving a program’s state on background storage (roll-out)
-replacing it with another program’s state (roll-in)

+ only needs hardware support to protect the kernel
- very slow
-no parallelism

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

Static relocation

A

-The OS adds a fixed offset to every address in a program when loading it and creating a process from it
-Same address space for every process
> no protection: every program sees and can access every address

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

Desired properties when sharing physical memory

A
  • protection: a bug in one process mustn’t corrupt memory in another
  • transparency: a process shouldn’t require particular physical memory addresses
    -resource exhaustion: allow that the sum of sizes of all processes is greater than physical memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Base and Limit registers advantages and disadvantages

A

+ straightforward to implement MMU
+ very quick at run-time
- can’t grow a process’ address space
- can’ share code or data

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

Segmentation trade-offs

A

+ dynamic relocation is possible
+ makes data/code sharing between processes possible without compromising
+ process doesn’t need one large contiguous physical memory area
+ don’t need entire process in memory
-segments need to be kept contiguous in physical memory
- fragmentation of physical memory

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

Fragmentation, internal, external

A

Fragmentation: Inability to use free memory

Internal: Overallocate resource requests to align memory blocks. No free blocks left although there is sufficient unused memory within the blocks

External: Sum of free space is sufficient but can’t allocate sufficiently large contiguous block of free memory

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

Difference between a virtual and a physical address

A
  • in systems with no fixed 1:1 mapping of the applications’ addresses to the physical addresses
  • each executable program belongs to a virtual address space
  • during execution parts of the programs are mapped to physical memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When is compaction a viable option to reduce external fragmentation

A

If all references to moved memory blocks can be updated
Compaction may not be used for memory blocks allocated on the heap (with malloc), because it can’t reduce external fragmentation in a native heap as the heap is not able to reliably track and update all pointers to the allocated memory.

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

What is the benefit of using virtual addresses instead of physical

A

That allows the OS to freely organize the physical address space and to protect itself from processes and isolating processes from each other, by configuring the virtual-to-physical mapping appropriately.
Adding the same mapping to more than one process also allows for convenient and fast sharing of memory

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

How does MMU determine where the segment table is located in memory

A

it has two registers:
1. contains the physical address of the segment table
2. specifies the size of the table

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