Fact-checked by Grok 2 weeks ago

Memory segmentation

Memory segmentation is a technique in operating systems that divides a process's into variable-sized segments, each corresponding to a logical unit of the program such as , , , or , allowing for flexible allocation and protection of distinct program components. This approach contrasts with fixed-size partitioning by enabling segments to grow or shrink dynamically as needed, with addresses specified as a segment identifier and an offset within that segment. The concept originated in the Multics operating system during the 1960s, where it was designed to support efficient information sharing among users through hardware-enforced segments with attributes like size, access privileges (read, write, execute), and direct addressing via symbolic names. In , implemented on the Honeywell 645 computer, segmentation was integrated with paging to manage large virtual memories, using segment descriptor words to track attributes and locations while preventing unauthorized access. This innovation addressed limitations of earlier systems like CTSS, which relied on file-based addressing and lacked fine-grained sharing, influencing hardware support in processors and the development of other operating systems that adopted or adapted segmentation concepts. In practice, segmentation works by maintaining a segment table in the operating system or (MMU), where each entry includes a base address, length (or limit), and bits for the segment. Address translation adds the to the segment's base address, with a bounds check to ensure the offset does not exceed the segment length; violations trigger a . Advantages include support for sparse address spaces by allocating only for used segments, efficient code sharing via read-only segments, and logical organization that aligns with programmer views of . However, it can lead to external fragmentation, as variable-sized segments create gaps in physical memory that are difficult to reuse without compaction. Hardware implementations, such as in the microprocessor introduced in 1978, extended segmentation to provide a 1 MB using 20-bit physical addresses formed by shifting a 16-bit segment register value left by 4 bits and adding a 16-bit offset. The 8086 employs four segment registers—CS (), DS (), SS (stack segment), and ES (extra segment)—each defining up to 64 KB relocatable blocks aligned on 16-byte boundaries, facilitating modular addressing for instructions, variables, stack operations, and external data. While pure segmentation has largely been supplanted by paging in modern systems for better fragmentation control, it remains relevant in legacy x86 and combined segmentation-paging schemes like those in .

Core Concepts

Segment Structure and Addressing

In memory segmentation, a is a contiguous block of memory with a variable size, defined by its base address—the starting physical location where the segment resides in —and its limit, which indicates the length or extent of the segment. This structure allows the operating system to manage in logical units that correspond to program components, such as , , or regions. Logical addressing in segmented systems employs a pair consisting of a segment identifier—typically a segment number or selector that uniquely identifies the segment—and an offset, which specifies the displacement from the beginning of that segment. The segment identifier is used to retrieve the corresponding base and limit from a segment table or descriptor maintained by the operating system. Each segment incorporates protection attributes to enforce security and isolation, including permissions for read, write, and execute operations, as well as privilege levels that restrict access based on the requesting process's authority. These attributes are stored in segment descriptors and checked by hardware on every memory reference to prevent unauthorized access or modification. The address translation mechanism converts the ( identifier + ) to a by adding the to the 's , provided the is within the to avoid . Bounds checking is performed during this process: if the exceeds the , a or protection violation is generated, halting the access. This translation is typically supported by , such as registers that the and values for the currently active , enabling efficient relocation without software intervention for every reference. Unlike flat addressing models, which view the as a uniform linear region, segmentation's use of variable-sized blocks with explicit base-limit pairs facilitates modular organization while integrating protection at the segment level.

Benefits and Limitations

Memory segmentation provides a logical division of a program's into variable-sized units, such as , , and segments, which aligns naturally with the modular of programs and simplifies management of distinct components. This approach enables sparse allocation, allowing structures like stacks and heaps to grow independently without constraining the entire to contiguous blocks. Additionally, segmentation facilitates easier sharing of specific segments, such as or shared libraries, between multiple processes, promoting efficient resource utilization in multiprogrammed environments. It also supports dynamic relocation of individual segments, permitting flexible placement in physical memory without requiring fixed-size allocations or recompilation of the entire program. Despite these benefits, segmentation introduces significant limitations, primarily external fragmentation, where free becomes scattered into small, non-contiguous holes due to variable segment sizes, making it difficult to allocate space for new or expanding segments even when total free is sufficient. This fragmentation arises because each must be allocated contiguously in physical , potentially leaving unusable gaps between segments that cannot accommodate larger requests. Per-segment management adds overhead, including the maintenance of segment tables and base/limit registers for each , which increases complexity and memory usage compared to simpler allocation schemes. Address translation in segmentation can also be slower, as it involves additional lookups and checks per access, potentially impacting performance in systems with many segments. Segmentation offers trade-offs in protection and sharing: it enables fine-grained by assigning distinct permissions (e.g., read-only for segments) to logical units, enhancing and , but this per-segment raises risks of overlap or misalignment issues if segment boundaries are not properly enforced, complicating inter-process . In terms of quantitative impact, classic analyses of external fragmentation in variable-partition systems like segmentation indicate that approximately one-third of can be lost in steady-state conditions, according to the 50% rule, which states that the number of free holes approximates half the number of allocated blocks, rendering much of the unusable without compaction.

Comparison to Other Techniques

Segmentation Versus Paging

Paging divides physical memory into fixed-size blocks known as pages, typically 4 KB in modern systems, allowing the operating system to allocate memory in uniform units that map to physical frames via page tables. This approach eliminates external fragmentation by permitting non-contiguous allocation, as pages can be scattered across physical memory without leaving unusable gaps between them. However, it introduces internal fragmentation, where the last page of a process may contain unused space, averaging half a page per process. In contrast, segmentation partitions into variable-sized units corresponding to logical components, such as , , or , each defined by a base address and limit in a segment table. This logical division supports direct sharing of entire modules between processes, like shared libraries, without the need for complex mapping beyond segment descriptors. Paging, however, relies on page tables to translate virtual page numbers to physical frames, treating as a flat, -defined that abstracts away logical boundaries. Segmentation's variable sizes align with semantics but can lead to external fragmentation as holes form between allocated segments, while paging's fixed sizes simplify implementation but obscure . Segmentation is particularly suited for modular , where programs benefit from isolating and sharing logical units, such as in early systems like that emphasized user-defined memory organization. Paging excels in environments requiring simpler hardware support and effective fragmentation control, as seen in modern operating systems like and Windows, where uniform page allocation facilitates and multitasking without the overhead of variable-size management. For instance, in a implementation, segmentation naturally separates the from and segments, enabling efficient protection and sharing of the code module across compilations, whereas paging treats these as uniform blocks of pages, potentially mixing logical boundaries across page boundaries and requiring additional software mechanisms for isolation. While segmentation and paging address challenges differently, their combination in hybrid systems can leverage segmentation's logical flexibility with paging's efficient allocation, though such integrations introduce added complexity in translation mechanisms.

Combined Approaches

Combined approaches in memory segmentation integrate segmentation with paging to mitigate the limitations of pure segmentation, particularly external fragmentation, while retaining logical organization. In segmented paging, also known as paging on segmentation, each is divided into fixed-size pages, allowing variable-length segments to be mapped coarsely via segment tables and finely via page tables. This hybrid technique uses segment tables to provide coarse-grained mapping to page tables, which then handle fine-grained addressing to physical memory frames. Address translation in these hybrid systems follows a multi-level process. A virtual address is structured as a segment selector, which indexes the segment table to retrieve the base address of the corresponding page table, followed by the page number within the segment to index that page table for the physical frame, and finally the offset within the page to obtain the physical address. This process typically involves two table lookups, enhancing protection and sharing at the segment level while distributing pages to avoid fragmentation. The general form of the virtual address can be expressed as: \text{Virtual Address} = \{\text{segment number}, \text{page number within segment}, \text{offset within page}\} \to \text{physical address} The primary benefits of segmented paging include reduced external fragmentation, as paging manages internal fragmentation within segments while segmentation preserves logical divisions for easier sharing and protection of code or data modules. It also supports efficient sharing at the segment granularity, allowing multiple processes to access common segments without duplicating entire pages. However, drawbacks arise from the increased complexity of address translation, requiring multiple memory accesses for table lookups, which can degrade performance without hardware acceleration like translation lookaside buffers. Additionally, the overhead for maintaining both segment and page tables consumes more memory compared to pure paging.

Hardware Mechanisms

Pure Segmentation Implementation

Pure segmentation implementation relies on dedicated hardware registers to manage variable-sized memory segments without the use of descriptor tables or paging mechanisms. In simple systems, each segment is defined by a pair of base and registers: the base register holds the starting of the segment in main memory, while the register specifies the segment's length or maximum . These register pairs can be allocated per or shared globally across processes, enabling basic relocation and protection for logical address spaces divided into segments such as , , or . Address resolution in this hardware model involves the CPU interpreting a logical address as a segment selector and an offset within that segment. The hardware first checks if the offset is less than the value in the limit register for the selected segment; if it is, the physical address is computed by adding the offset to the base register value, resulting in direct access to the target location. If the offset exceeds the limit, a hardware fault (such as a segmentation violation) is triggered, preventing invalid memory accesses and providing runtime protection. This process supports variable segment sizes as a core concept, allowing segments to grow or shrink dynamically based on program needs. To accommodate multiple segments, the hardware provides an array of segment registers, typically 2 to 16 pairs, with selection determined by processor mode or explicit instructions (e.g., separate registers for user-mode data and kernel-mode code segments). Early examples include the , which featured two base/limit register pairs—one for user data and one for shared code—to enable basic segmentation in multiprogrammed environments during the late 1960s and 1970s. Other systems extended this to fixed sets of 8-16 registers without descriptors, allowing limited but straightforward multi-segment addressing in resource-constrained hardware. This approach offers fast address translation, requiring only a single addition and comparison per access, which minimizes overhead in early computer architectures. However, is inherently limited by the fixed number of registers, restricting the total segments per and necessitating careful OS management to avoid exceeding constraints.

Segmentation with Descriptor Tables

In advanced implementations of memory segmentation, descriptor tables provide a scalable for defining and managing multiple segments beyond the limitations of fixed registers. These tables store segment descriptors, which are 8-byte entries that specify the (the starting of the segment in the linear ), the segment limit (defining the size, scalable from 1 byte to 4 GB when the granularity flag is set), protection bits (including the present bit to indicate segment availability, descriptor privilege level for , and type fields for code/data distinctions), and additional flags (such as the system flag to denote non-user segments and the 64-bit code flag in extended modes). The primary table structures are the Global Descriptor Table (GDT), which holds system-wide segment descriptors accessible by all tasks, and the Local Descriptor Table (LDT), which contains per-task descriptors for process-specific segmentation. The GDT is mandatory and stores its base address and limit in the GDTR register, supporting up to 8192 entries, while each LDT is optional, referenced via a dedicated descriptor in the GDT, and managed through the LDTR register for task isolation. This dual-table approach allows selective sharing of global segments while enabling customized local views, enhancing modularity in multitasking environments. Address translation begins with a segment selector—a 16-bit loaded into a segment register—which includes an field (up to 13 bits for table entry selection), a table indicator bit (to choose GDT or LDT), and a requested level. The uses the selector's to retrieve the corresponding descriptor from the specified , validates the against the segment limit (with expansion if the granularity flag is active), checks attributes like the present bit and privilege conformance, and computes the linear address by adding the offset to the descriptor's base address. If valid, this linear address may proceed to further translation stages, ensuring bounded and protected access. Hardware support relies on segment registers (CS for code, DS/ES/FS/GS for data, and SS for stack), which store only the segment selector rather than full and values, providing to the descriptor s for dynamic . Each includes hidden portions that the retrieved descriptor's , , and attributes upon loading, avoiding repeated table lookups for . This enables efficient handling of thousands of segments across tables, far exceeding fixed- constraints, with the caching in segment registers (and potential integration with translation lookaside buffers in systems) maintaining low overhead during frequent computations. protection attributes, such as read/write permissions and privilege levels, are enforced during this process to prevent unauthorized access.

Historical Development

Early Innovations (1950s-1960s)

In the , early systems on computers like the and 704 faced severe memory constraints, with core memory capacities typically limited to 4,096 to 32,768 words, necessitating modular techniques such as overlays to handle programs larger than available . Overlays allowed portions of a —such as subroutines or data sections—to be swapped in from or drums during execution, addressing the inefficiencies of flat, monolithic memory allocation in these systems. This approach emerged from the need to process sequential jobs in batch mode without manual intervention, marking the initial push toward segmented, relocatable code structures influenced by emerging compiler designs for languages like on the IBM 704. The 1960s saw pivotal hardware innovations in memory segmentation, beginning with the Burroughs B5000 in 1961, which introduced native support for variable-sized segments to facilitate high-level language execution, particularly , through descriptor-based addressing. Descriptors in the B5000's Program Reference Table defined segment boundaries, enabling dynamic relocation and protection without fixed-size paging, a design tailored to stack-oriented programming and multiprogramming. By 1965, the GE-645 implementation for advanced this further, pioneering descriptor-based protection mechanisms that segmented into logical units up to 262,144 36-bit words (approximately 1 MB), supporting shared access and hierarchical . These developments introduced key concepts like variable-sized relocation, which allowed segments to be loaded at arbitrary physical addresses during for dynamic linking, and segment sharing, enabling multiple processes to access common libraries or code without duplication. Drawing from subroutine libraries and compiler-driven modularity in languages such as , segmentation addressed the limitations of flat memory models by aligning hardware with logical program structures, reducing fragmentation and enhancing reusability. A milestone was the formalization of base-and-limit registers in early 1960s designs, with integrating them into ring-based protection to enforce access levels across segments, laying groundwork for secure multiprogramming.

Maturation and Decline (1970s-1990s)

During the 1970s, memory segmentation expanded significantly through hardware implementations that integrated it with systems. The , introduced in 1972, incorporated segment registers via the Segment Table Origin Register (STOR), enabling a two-level translation where virtual storage was divided into fixed 65,536-byte segments, each further subdivided into pages for demand paging. Similarly, the microprocessor, released in 1978, implemented real-mode segmentation using four 16-bit segment registers (CS, DS, SS, ) to access up to 1 MB of by combining a segment base shifted left by four bits with a 16-bit offset, addressing the limitations of 16-bit addressing while supporting modular program structures. Refinements in the 1970s focused on combining segmentation with to improve protection and relocation, but studies highlighted persistent external fragmentation issues, where variable-sized segments led to inefficient memory utilization as free space became scattered into unusable holes. For instance, operating system research emphasized how segmentation's logical division of memory into , , and segments reduced internal waste compared to flat addressing but exacerbated external fragmentation, often requiring compaction overhead that paging avoided. These integrations, seen in systems like OS/VS2, allowed dynamic segment loading but underscored the trade-offs in performance for multiprogrammed environments. By the 1980s and 1990s, segmentation's prominence declined as paging gained dominance, particularly in UNIX variants on RISC architectures such as and , which favored flat paging models for simpler management without segment descriptors. processors, for example, relied on a (TLB) for page-based translation, eschewing segmentation to streamline address resolution in 32-bit and 64-bit modes. In x86 evolution, the 80386's (1985) layered paging atop segmentation, but operating systems increasingly disabled segmentation in favor of paging for its uniform 4 KB pages, enabling efficient demand paging and reduced overhead in 32-bit addressing. architectures similarly adopted multilevel paging hierarchies, prioritizing hardware simplicity over segmented protection. Key factors in segmentation's decline included its added complexity in address translation via descriptor tables, which increased hardware costs and TLB misses compared to paging's fixed-size units, alongside advancing MMUs that optimized paging for growing memory sizes. The shift to 32- and 64-bit addressing further diminished the need for segmentation's expansion beyond 16-bit limits, as flat models sufficed for larger address spaces. Despite this, segmentation's legacy persists in modern virtual machines like the JVM, where runtime data areas—such as the for objects, method area for class metadata, and per-thread stacks—function as logical segments for isolated and garbage collection.

Notable Implementations

Burroughs Systems

The Burroughs B5000, introduced in 1961, pioneered hardware-supported memory segmentation in commercial computing, dividing memory into distinct segments for code, data, and stacks to facilitate . These systems, evolving into the B5500 (with replacing drums) and B5700 (supporting clustered configurations), utilized a Program Reference Table (PRT) to manage up to 1024 descriptors for program segments, data areas, and I/O operations. Program segments represented logical code portions linked via communication operators, while data segments were allocated through descriptors specifying array sizes and core locations. Stacks provided automatic last-in, first-out temporary storage, handled by dedicated registers (A, B, and S) without programmer intervention. The Master Control Program (MCP) operating system automatically managed descriptor creation, validation, and relocation, triggering interrupts for segment overlays when data was absent from core memory to ensure efficient use and protection. Building on this foundation, the B6500 and B6700 systems in the late and enhanced segmentation with fixed 256-word segments and a tagged , incorporating three tag bits per 48-bit word (positions 50-48) to enforce and access controls. These tags distinguished operand types—such as single-precision (tag 000) or double-precision (tag 010) data from —and included a memory protect bit (bit 48) to prevent writes to segments, Read Control Words, or descriptors, alongside a presence bit (bit 47) for . Segmentation relied on Data Descriptors and Segment Descriptors for bounds checking, with hardware interrupts (e.g., invalid index or memory protect) triggered on violations, enabling type-safe operations without user-accessible tags. Dynamic allocation occurred via stack-based mechanisms using / registers (BOSR, LOSR) and memory link words, allowing segments to be bounded and relocated seamlessly under MCP supervision. A hallmark of Burroughs segmentation was the absence of explicit arithmetic, with all addressing descriptor-mediated to support relocation and protection inherently. Segments were allocated dynamically on demand, protected by tags that segregated from executable content, preventing unauthorized modifications and enabling bounds-checked access. This approach marked the first commercial implementation of pure segmentation without paging, avoiding fixed-page fragmentation while aligning with ALGOL 60's block-structured, modular paradigm through native support for procedures and as segments. These innovations influenced subsequent designs for secure, high-level language environments by demonstrating descriptor-based protection and stack-oriented segmentation, though the line was discontinued in the amid shifts to compatible architectures. The Burroughs systems laid foundational principles for capability-like addressing in tagged environments, prioritizing hardware-enforced over low-level control.

Multics System

The operating system, developed collaboratively by , , and Bell Laboratories from 1965 to 1969 on the GE-645 computer, introduced a pioneering implementation of memory segmentation designed for secure, multi-user environments. The GE-645 supported 36-bit virtual addressing, where addresses were composed of an 18-bit segment number—allowing up to 262,144 segments per process—and an 18-bit offset within the segment, enabling variable-sized segments ranging from small procedures to large files. This two-part addressing scheme (segment number and word offset) facilitated logical organization of memory into independent, named units, contrasting with flat linear addressing in earlier systems. Central to Multics segmentation were 36-bit segment descriptor words (SDWs) stored in a per-process descriptor segment, indexed by the segment number and accessed via a descriptor base . Each SDW included an 18-bit pointing to the segment's location in physical memory, an 18-bit specifying the segment's , and control bits for such as read, write, and execute. To support hierarchical structures, Multics employed indirect segments, where an SDW could reference another descriptor segment instead of data, allowing multi-level for complex data organizations like directories of segments. Hardware enforced bounds checking by comparing the against the during , on violations to prevent overflows. Protection in Multics was enforced through an innovative ring-based mechanism integrated with segmentation, featuring eight concentric protection rings numbered 0 to 7, where ring 0 held the highest privileges for system kernel operations and ring 7 the lowest for user applications. Each SDW defined three ring brackets—R1 for read access, R2 for write access, and R3 for execute access—allowing a segment's permissions to vary by the caller's current ring, with hardware validating access at runtime to ensure confinement. This per-segment enforcement enabled fine-grained control, such as allowing read access from outer rings while restricting writes to inner ones, thereby supporting multi-level security in a shared environment. Sharing mechanisms in allowed explicit linking of segments across user processes, managed through per-segment lists maintained by the , which specified permitted rings and users for attachment. Dynamic loading was supported by the adding segments to a process's descriptor table , validating against access lists before granting visibility, which facilitated modular program construction and resource without compromising . Although Multics demonstrated scalable segmentation for large-scale, secure multi-user systems, its complexity—stemming from intricate ring interactions and hierarchical addressing—contributed to its limited commercial adoption. Bell Labs (AT&T) withdrew from the project in 1969, while Honeywell continued development until 1987, with the last Multics installation shut down in 2000. Nonetheless, Multics' segmentation concepts influenced subsequent systems, including Unix, which adopted hierarchical file structures and protection ideas while opting for a flat memory model to reduce overhead. Multics concepts, including segmentation, influenced Unix's design, particularly in file systems and protection, and the system remained in use until the last installation was decommissioned in 2000.

IBM System/370

The architecture, introduced in 1970 with virtual storage enhancements available from 1972 via operating systems like OS/VS, supported memory segmentation as an optional mechanism within its Dynamic Address Translation () facility for virtual storage management. This allowed programs to operate in a larger of up to 16 MB using 24-bit addresses, divided into segments for logical organization, while maintaining compatibility with the non-virtual basic mode. Segmentation was not mandatory; systems could run without it by setting the DAT-off bit in the (), reverting to direct real addressing. In virtual storage (VS) mode, segmentation operated through control registers that designated segment tables, providing base addresses (origins) and limits (lengths) for address translation. Control register 0 configured segment sizes to either 65,536 bytes (64 KiB) or 1,048,576 bytes (1 ) and page sizes to 2,048 or 4,096 bytes, applying system-wide. Control registers 1 and 7 held the primary and secondary segment table designations, respectively, each including a 24-bit origin (bits 8-31, right-justified) pointing to the real location of the segment table and a 4-bit length field (bits 0-3), where the value L indicates 16*(L+1) 4-byte entries (16 for 1 MiB segments or 256 for 64 KiB segments). Virtual addresses were translated in two levels: the high-order bits indexed the segment table to obtain the page table origin, followed by page table lookup for the frame offset, yielding a real address within the 16 MB real limit. Protection included invalid bits in segment and page entries to deny access and keys (4-bit values per 2K/4K block) matched against the PSW protection key for read/write/fetch . Extended access was facilitated through specific configurations, though not via dedicated registers; instead, it relied on the overall DAT framework for larger memory hierarchies in models like the 168. Integration with operating systems emphasized paging over segmentation for fine-grained management, but segmentation provided the structural backbone for address spaces. In , introduced in 1974, segmentation enabled large address spaces up to 16 MB per job step or task, with the system allocating segments dynamically for code, data, and common areas while paging handled to auxiliary via page datasets. exploited multiple address spaces for multiprogramming, using primary and secondary tables for distinct user and system contexts, though paging dominated due to its efficiency in handling variable-sized allocations and demand fetching. The real manager in coordinated segment allocation with page frames, supporting features like virtual I/O for temporary datasets to balance contention. Limitations of System/370 segmentation included its fixed granularity, with uniform segment sizes lacking per-segment variability, leading to inefficient packing for small modules and potential external fragmentation. The reliance on a small number of registers restricted flexibility to predefined spaces (primary, secondary, and later home/access-register spaces in extended modes), resulting in coarse boundaries unsuitable for fine-grained sharing. Model-dependent constraints, such as unavailability of 1 segments on entry-level systems, further limited adoption. Segmentation evolved in the Enterprise Systems Architecture/370 (ESA/370) during the , incorporating 31-bit addressing for 2 GB spaces while retaining segment tables, but it was progressively de-emphasized as paging mechanisms advanced. By the transition to in 2000, segmentation was fully phased out in favor of a 64-bit flat paging model using and segment tables only for compatibility, with primary reliance on hierarchical page tables and larger page sizes (up to 1 ) for efficient management of exabyte-scale virtual storage.

x86 Architecture

Memory segmentation in the x86 architecture originated with the Intel 8086 microprocessor introduced in 1978, which implemented a real-mode addressing scheme to access a 1 MB physical address space using 16-bit registers. In this model, memory is divided into variable-length segments of up to 64 KB each, addressed via a segment:offset pair where the 16-bit segment value (from one of four segment registers: CS for code, DS for data, SS for stack, and ES for extra data) is shifted left by 4 bits and added to a 16-bit offset to form a 20-bit physical address. For example, the code segment register CS combined with the instruction pointer IP (CS:IP) specifies the location of the next instruction to execute. This segmentation allowed the 8086 to exceed the 64 KB limit of pure 16-bit addressing while maintaining compatibility with simpler 8-bit systems, though segments must align on 16-byte boundaries. The , released in 1982, extended segmentation into , introducing descriptor tables for more flexible and secure . In , segment registers hold 16-bit selectors that index into the (GDT) or Local Descriptor Table (LDT), each containing 8-byte descriptors specifying a segment's base address (24 bits), limit (16 bits, up to 64 KB granular), and flags for access rights such as present bit, privilege level (0-3), executable/readable/writable attributes, and accessed status. This enables virtual addressing with up to 16 MB physical memory, where the 16-bit selector indexes into the descriptor table to retrieve the 24-bit base address, which is added to the 16-bit offset to form the linear address for a theoretical 1 GByte per task, supporting multitasking and protection by isolating segments and enforcing privilege checks on transitions. The GDT is system-wide, while LDTs are task-specific, allowing shared or private segments; selectors include a table indicator bit (TI: 0 for GDT, 1 for LDT) and requestor privilege level (RPL) for . With the transition to 32-bit architecture in processors like the 80386 (1985), segmentation evolved to support larger s, but the flat memory model became dominant to simplify programming. In the flat model, all segment registers are set with selectors pointing to descriptors that span the entire 4 GB linear (base 0, limit 4 GB - 1), effectively disabling segmentation's relocation features while retaining via paging. This discourages traditional segmentation in favor of paging for , though legacy support persists for compatibility. Segmentation challenges in , such as the 640 KB limit in early PC-compatible systems—arising from hardware reservations for , video , and expansion cards above address 0xA0000—highlighted compatibility issues, restricting applications and necessitating workarounds like extended memory specifications. In the (AMD64) extension introduced in 2003, segmentation is further minimized in 64-bit , where , , , and bases default to zero for a flat 64-bit , with limits ignored except for compatibility checks; only and retain meaningful base addresses for specialized uses like (TLS). Operating systems like configure for TLS access via runtime libraries, using instructions like arch_prctl(ARCH_SET_FS) or FSGSBASE (RDFSBASE/WRFSBASE on supported CPUs) to set per-thread bases, while GS remains available for application-specific purposes. Similarly, Windows employs a flat model where segmentation is largely inactive beyond FS/GS repurposed as additional registers for TLS and kernel structures, prioritizing paging for and isolation. Today, x86 segmentation is primarily emulated for legacy real-mode code (e.g., during boot) or used minimally for compatibility, with modern OSes and applications favoring paging to avoid the complexity and performance overhead of full segmentation.

References

  1. [1]
    [PDF] Segmentation - cs.wisc.edu
    What segmentation allows the OS to do is to place each one of those segments in different parts of physical memory, and thus avoid filling physical memory with ...
  2. [2]
    OS Lecture #11 - NYU Computer Science
    Segmentation is a user-visible division of a process into multiple variable-size segments, whose sizes change dynamically during execution.
  3. [3]
    [PDF] The Multics virtual memory: concepts and design
    As experience with use of on-line operating systems has grown, the need to share information among system users has become increasingly apparent.
  4. [4]
    [PDF] intel-8086_datasheet.pdf
    The memory is logically divided into code, data, extra data, and stack segments of up to 64K bytes each, with each segment falling on 16-byte boundaries. (See ...
  5. [5]
    Operating Systems Lecture Notes Lecture 15 Segments
    Program's memory is structured as a set of segments. Each segment is a variable-sized chunk of memory. An address is a segment,offset pair. Each segment has ...
  6. [6]
    Memory Management, Segmentation, and Paging - UCSD CSE
    Paging splits the address space into equal sized units called pages. While segmentation splits the memory into unequal units that may have sizes more ...
  7. [7]
    [PDF] Abraham-Silberschatz-Operating-System-Concepts-10th-2018.pdf
    ... Operating system concepts / Abraham Silberschatz, Yale University,. Peter ... segmentation. • Chapter 10: Virtual Memory (previously Chapter 9) contains ...<|control11|><|separator|>
  8. [8]
    [PDF] Virtual Memory
    Advantages of Segmentation. • Enables sparse allocation of address space ... Disadvantages of Segmentation. • If only a few segments allowed per process ...
  9. [9]
    [PDF] Segmentation - CS 537: Introduction to Operating Systems
    Recall disadvantages of base/bound address translation. Extend address translation to segmentation. Advantages / Disadvantages of Segmentation. Louis Oliphant.
  10. [10]
    CIS 307: Storage Management
    Tanenbaum (page 88) discusses the Fifty percent Rule and the Unused Memory Rule. ... external fragmentation is more wasteful than internal fragmentation. In fact ...Missing: segmentation | Show results with:segmentation
  11. [11]
    None
    Below is a merged summary of memory segmentation and paging from *Modern Operating Systems* by Andrew S. Tanenbaum, consolidating all information from the provided segments into a comprehensive response. To retain maximum detail, I will use tables where appropriate (in CSV format for clarity) and narrative text for explanations, comparisons, and additional context. All relevant details, including page references, URLs, and key points, are included.
  12. [12]
    [PDF] Virtual Memory, Processes, and Sharing in MULTICS - andrew.cmu.ed
    MULTICS concepts of processes, address space, and virtual memory are defined and the use of paging and segmentation is explained. The means by which users may ...
  13. [13]
    [PDF] memory management - nob.cs.ucdavis.edu!
    example: PDP-10 had 2 base/limit register pairs, the high order bit of each indicating which half of memory (high or low) the pair refers to. Instructions ...
  14. [14]
    [PDF] Intel® 64 and IA-32 Architectures Software Developer's Manual
    This is Volume 3A, the System Programming Guide, Part 1, of the Intel 64 and IA-32 manual, which consists of ten volumes.
  15. [15]
    [PDF] The Evolution of Electronic Computer Services
    The 704 had a relatively small memory. Some of the conversion programs i.e. input and output translators, would have filled that memory and caused overlays on ...
  16. [16]
    Software—Historical perspectives and current trends
    Jan 4, 2020 · The genealogy of software is developed, starting from the early 1950's when the most elemental concepts were subroutines, simple assemblers and ...
  17. [17]
    Virtual Memory
    Two principal methods for implementing virtual memory, segmentation and ... gramming languages in the mid-1950s. Pro- grammers were encouraged to be more.
  18. [18]
    [PDF] Descriptors - Bitsavers.org
    The BURROUGHS B 5000 is capable of very fast com- pilation speeds and efficient object programs because the system has been designed to take advantage of.
  19. [19]
    [PDF] Early Descriptor Architectures
    The B5000's use of the stack, segmentation, descriptor ad- dressing, and high-level languages made it one of the most advanced systems of its time. These ...
  20. [20]
    [PDF] Protection and the control of information sharing in multics
    The descriptor based strategy permits two further simplifying steps to be taken: Step 1. All information in the storage system is read and written by mapping it ...
  21. [21]
    [PDF] GR20-4260-1_Introduction_to_Virtual_Storage_in_.. - Bitsavers.org
    System/370 has a segment table origin register (STOR regis- ter). It points to the real storage origin of the segment table. Smaller models of System/370 ...
  22. [22]
    [PDF] Users Manual - Bitsavers.org
    Page 1. The. 8086Family. Users Manual. October1979. © Intel Corporation 1978, 1979. 9800722-03/ $7 .50. Page 2. The. 8086 Family. Users Manual. October 1979 ...
  23. [23]
    [PDF] Back to the Past: When Segmentation Is More Efficient Than Paging
    The Multics [DD68, BCD72] operating system was a very ambitious design, which combined the logic simplicity of segmentation while each segment was paged in or ...
  24. [24]
    [PDF] MIPS® Architecture For Programmers Volume III - Amazon S3
    Dec 22, 2015 · To meet the architecture requirement without reserving one segment as uncached and unmapped, overlay segments ... memory segmentation ...
  25. [25]
    [PDF] INTEL 80386 PROGRAMMER'S REFERENCE MANUAL 1986
    ... Page 16. INTEL 80386 PROGRAMMER'S REFERENCE MANUAL 1986. Page 16 of 421. 1. Protected Mode. 2. Real-Address Mode. 3. Virtual 8086 Mode. Protected mode is the ...
  26. [26]
    [PDF] The SPARC Architecture Manual - cs.wisc.edu
    SPARC International, Inc. San Jose, California. David L. Weaver and Tom Germond. Editors. SA-V09-R147-Jul2003. Page 2. 2. Page 3. The SPARC Architecture Manual.
  27. [27]
    [PDF] Burroughs B 5000 - Bitsavers.org
    Storage areas within the internal memory of the B 5000 are divided into five general types. These are stacks, program reference tables, program segments, data ...
  28. [28]
    None
    Below is a merged summary of segmentation in the B6500/B6700, consolidating all information from the provided segments into a single, dense response. To maximize detail and clarity, I’ve organized key aspects into a table in CSV format, followed by a narrative summary that integrates additional details not suited for the table. The response retains all information mentioned across the summaries while avoiding redundancy and ensuring completeness.
  29. [29]
    [PDF] Capability-Based Addressing - UCF Department of Computer Science
    The tagged approach used on the Burroughs B6700, the Rice computers, and the Basic Machine adds one or more tag bits to each word in a segment and to each proc-.
  30. [30]
    [PDF] A Hardware Architecture for Implementing Protection Rings
    In a system which usessegmentation as a memory addressing scheme, protection can be achieved in part by associating concentric rings of decreasing access.Missing: GE- | Show results with:GE-<|control11|><|separator|>
  31. [31]
    [PDF] ge-645 system manual - Bitsavers.org
    The DBR, like the descriptor segment, is accessible only to Multics-645/I. This means it cannot be manipulated in order to gain unauthorized access to ...
  32. [32]
    A Hardware Architecture for Implementing Protection Rings - Multics
    The 645 represents a first attempt to define a suitable hardware base for a computer utility. While containing special logic to support a segmented virtual ...Missing: GE- | Show results with:GE-
  33. [33]
    Integrating segmentation and paging protection for
    Data sharing within a process or among processes is controlled through segment-level protection checks. Unlike the X86 architec- ture, the paging hardware in GE ...Missing: segmented | Show results with:segmented
  34. [34]
    [PDF] Thirty Years Later: Lessons from the Multics Security Evaluation
    The results are still interesting today, because many of the concepts of UNIX and other modern operating systems came directly from Multics. This paper revisits ...
  35. [35]
    Myths about Multics
    Jul 31, 2025 · The UNIX system [12] was a reaction to Multics. Even the name was a joke. Ken Thompson was part of the Bell Laboratories' Multics effort, and, ...
  36. [36]
  37. [37]
    [PDF] IBM System/370 Principles of Operation
    This publication provid~s, for reference purposes, a detqiled definition of the machine functions performed by System/370. The publication describes each ...
  38. [38]
    None
    Below is a merged summary of memory segmentation in IBM System/370, consolidating all provided segments into a single, comprehensive response. To maximize detail and clarity, I’ve organized the information into a table format where appropriate, followed by a narrative summary for additional context. The table captures key attributes across the different sources, while the narrative integrates overlapping details and highlights unique aspects.
  39. [39]
    [PDF] Introduction to the New Mainframe: z/OS Basics - IBM Redbooks
    This book covers basic mainframe concepts, including usage, architecture, z/OS fundamentals, and mainframe hardware and peripheral devices.<|control11|><|separator|>
  40. [40]
    [PDF] 80286 and 80287 Programmers Reference Manual (1987)
    COMPLETE SET OF 9 HANDBOOKS. Save $50.00 off the retail price of $175.00. MEMORY COMPONENTS HANDBOOK. MICROCOMMUNICATIONS HANDBOOK.
  41. [41]
    Intel® 64 and IA-32 Architectures Software Developer Manuals
    Oct 29, 2025 · These manuals describe the architecture and programming environment of the Intel® 64 and IA-32 architectures.
  42. [42]
    The 640 K Barrier - The Digital Antiquarian
    Apr 14, 2017 · Already by 1984 the 640 K barrier had gone from a theoretical to a very real limitation, and customers were beginning to demand that IBM do ...
  43. [43]
    29.8. Using FS and GS segments in user space applications
    Using FS and GS segments in user space applications¶. The x86 architecture supports segmentation. Instructions which access memory can use segment register ...
  44. [44]
    The x86-64 processor (aka amd64, x64): Whirlwind tour
    Aug 31, 2022 · Segmentation is architecturally dead. The processor is always in flat mode. The fs and gs selectors have been repurposed as two additional ...