Segmentation Qs Flashcards
Chapter 16 of Operating Systems: Three Easy Pieces
What is external fragmentation in segmentation?
free memory scattered in small, non-contiguous blocks
What does the OS need to do during a context switch regarding segmentation?
save and load to &
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
What statement about segment sharing is correct?
definition and back-up info
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
Why does hardware need both base and bounds registers for each segment?
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
What is the purpose of segmentation into memory management?
definition and three pros (ofp)
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
What is stored in a segment descriptor or segment register?
bba
the base address(start of the segment in physical memory), bounds/limit(size of the segment), access permissions(read, write, execute)
What segment grows typically downward in memory?
backwards
the Stack
What does the segmentation mask represent in a virtual address?
the segment number, separating it from the offset within the virtual address
How is the offset mask calculated in segmentation? Assume 14bit virtual address
-
In segmentation, what determines how many different segments we can have?
the number of bits allocated for the segment number, 2^n.
n bits for segment number allows 2^n segments
Given a 14-bit virtual address 4200 (binary: 01000001101000), how do we extract the segment number (top 2 bits)?
-
In a 14-bit address space with 2-segment bits, what’s the maximum size a single segment can be?
explicit number
2^12 or 4096