Memory segmentation

It was intended to increase reliability of the systems running multiple processes simultaneously.

[3] A hardware memory management unit (MMU) is responsible for translating the segment and offset into a physical address, and for performing checks to make sure the translation can be done and that the reference to that segment and offset is permitted.

In this case each segment has an associated flag indicating whether it is present in main memory or not.

The size of a memory segment is generally not fixed and may be as small as a single byte.

[8] The later B6500 computer also implemented segmentation; a version of its architecture is still in use today on the Unisys ClearPath Libra servers.

The Intel iAPX 432,[9] begun in 1975, attempted to implement a true segmented architecture with memory protection on a microprocessor.

They reside in either the Program Reference Table (PRT) or the stack, and contain a presence bit indicating whether the data are present in memory.

[12]: 6-5–6-10 The line includes the B6500, B6700, B7700, B6800, B6900, B5900, the A-series Burroughs and Unisys machines, and the current Clearpath MCP systems (Libra).

In the IBM System/370 models[a] with virtual storage[13][14] (DAT) and 24-bit addresses, control register 0 specifies a segment size of either 64 KiB or 1 MiB and a page size of either 2 KiB or 4 KiB; control register 1 contains a Segment Table Designator (STD), which specifies the length and real address of the segment table.

Each segment grants read-write access to 64 KiB (65,536 bytes) of address space (this limit is set by the 16-bit PC and SP registers; the processor does no bounds checking).

For backward compatibility, all x86 CPUs start up in "real mode", with the same fixed overlapping 64 KiB segments, no memory protection, only 1 MiB physical address space, and some subtle differences (high memory area, unreal mode).

In order to use its full 24-bit (16 MiB) physical address space and advanced MMU features, an 80286 or later processor must be switched into "protected mode" by software, usually the operating system or a DOS extender.

If a program does not use the segment registers, or only puts values into them that it receives from the operating system, then identical code can run in real mode or protected mode, but most real-mode software computes new values for the segment registers, breaking this compatibility.

[18] Four of the segment registers: CS, SS, DS, and ES are forced to 0, and the limit to 264.

This allows operating systems to use these segments for special purposes such as thread-local storage.