8.6 - Segmentation (p.378)
(Source: https://www2.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/8_MainMemory.html)
Basic Method
- Segmentation = Memory-Management methode waarbij het geheugen wordt opgedeeld in segmenten (zoals de gebruiker dit ziet).
Most users ( programmers ) do not think of their programs as existing in one continuous linear address space. Rather they tend to think of their memory in multiple segments, each dedicated to a particular use, such as code, data, the stack, the heap, etc. Memory segmentation supports this view by providing addresses with a segment number ( mapped to a segment base address ) and an offset from the beginning of that segment. For example, a C compiler might generate 5 segments for the user code, library code, global ( static ) variables, the stack, and the heap, as shown in
Segmentation Hardware
A segment table maps segment-offset addresses to physical addresses, and simultaneously checks for invalid addresses, using a system similar to the page tables and relocation base registers discussed previously. ( Note that at this point in the discussion of segmentation, each segment is kept in contiguous memory and may be of different sizes, but that segmentation can also be combined with paging. )