Segmentation Qs Flashcards

Chapter 16 of Operating Systems: Three Easy Pieces

1
Q

What is external fragmentation in segmentation?

A

free memory scattered in small, non-contiguous blocks

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

What does the OS need to do during a context switch regarding segmentation?

save and load to &

A

The OS saves the current process’s segment registers, base and bounds
It loads the segment registers for the new process to ensure memory isolation and proper address translation

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

What statement about segment sharing is correct?

definition and back-up info

A

Segments can be shared among processes to allow efficient use of memory, especially for shared libraries or read-only data. The base and bounds registers ensure that each process accesses only permitted parts of the segment

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

Why does hardware need both base and bounds registers for each segment?

A

The base specifies the starting physical address of the segment while the bounds defines the size of the segment, ensuring the process cannot access memory beyond the allocated range

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

What is the purpose of segmentation into memory management?

definition and three pros (ofp)

A

divides a process’s memory into logical units for better organization, flexibility, and protection. Each segment can be independently managed and sized, allowing efficient memory allocation

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

What is stored in a segment descriptor or segment register?

bba

A

the base address(start of the segment in physical memory), bounds/limit(size of the segment), access permissions(read, write, execute)

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

What segment grows typically downward in memory?

backwards

A

the Stack

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

What does the segmentation mask represent in a virtual address?

A

the segment number, separating it from the offset within the virtual address

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

How is the offset mask calculated in segmentation? Assume 14bit virtual address

A

-

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

In segmentation, what determines how many different segments we can have?

A

the number of bits allocated for the segment number, 2^n.
n bits for segment number allows 2^n segments

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

Given a 14-bit virtual address 4200 (binary: 01000001101000), how do we extract the segment number (top 2 bits)?

A

-

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

In a 14-bit address space with 2-segment bits, what’s the maximum size a single segment can be?

explicit number

A

2^12 or 4096

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