Write in brief about segmentation in the operating system.
Write in brief about segmentation in the operating system.
531
02-Apr-2023
Updated on 04-Apr-2023
Krishnapriya Rajeev
04-Apr-2023Segmentation is a memory management technique in which the logical memory of a program is divided into variable-size segments. Each segment represents a logical unit of the program, such as a code segment, a data segment, and a stack segment. Segmentation helps to reduce external fragmentation and allows the logical structure of a program to be more easily managed.
Each segment is allocated a contiguous block of physical memory, and the mapping between logical and physical addresses is maintained in a segment table. When a program references a memory address, the segment table is used to translate the logical address into a physical address. The segment table holds two key pieces of information related to a segment. Firstly, it contains the Base value which refers to the lowest address of the segment, and secondly, it holds the Limit value which specifies the size of the segment.
An example of a segment table is shown below:
The advantages of using segmentation are:
Some of its disadvantages are: