Fundamentals 9 min read

How Early CPUs Managed Memory: From 8086 Segmentation to Modern Paging

The article narrates a whimsical tour through CPU history, explaining how the 8086 used shared address/data pins and segmentation, how 32‑bit processors introduced separate buses and operating‑system multitasking, and how virtual memory, paging, and swapping evolved to support modern multi‑core systems.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How Early CPUs Managed Memory: From 8086 Segmentation to Modern Paging

In a light‑hearted dialogue between the narrator "A‑Q" and a worker named "Xiao Hei", the story introduces the challenges of memory page errors and the need for address translation in CPUs.

8086

The original 8086 CPU used a set of metal pins to communicate with memory. Its 16‑bit data bus and shared address/data pins (AD0‑AD15) were supplemented by four extra address lines (A16‑A19), allowing a 1 MB address space. Because registers were only 16 bits, the processor employed segmented memory management, dividing memory into 64 KB blocks. Segment registers pointed to the start of each block, and a segment base plus an offset gave access to a larger address range.

32‑Bit Era

Later CPUs such as the 80286 and especially the 80386 expanded the bus to 32 bits, separating address and data lines. This increased capacity enabled the development of an operating system that managed multitasking via time‑slicing, allowing programs to run seemingly simultaneously (e.g., music playback, web browsing, document editing).

Virtual Memory

With many programs sharing limited RAM, the concept of a virtual address was introduced. Each process sees a 0x00000000‑0xffffffff (4 GB) address space, but the physical memory is allocated on demand in pages (4 KB for 32‑bit CPUs). The CPU uses a special register CR3 that points to a two‑level page‑directory structure: the high‑order bits select entries in the first‑level directory, the next bits select entries in the second‑level directory, and the low bits give the offset within the physical page. This mechanism, known as paged memory management, isolates processes and enables protected mode, contrasting with the earlier real‑address mode that used physical addresses directly.

Paging and Swapping

When RAM fills up, the operating system moves rarely used pages to a reserved area on the hard disk, marking them as swapped out. If a process later accesses a swapped‑out page, the CPU triggers a page‑fault interrupt, prompting the OS to load the page back into RAM. This technique is called memory paging swap and alleviates memory pressure.

Modern Times

Today's CPUs are 64‑bit, often with 16 GB or more of RAM, and feature multiple cores (e.g., an 8‑core processor). The number of pins and internal registers has grown dramatically compared to the early 8086.

Easter Egg

A brief humorous note shows another character, "Old K", appearing with a warning about data changes in a neighboring workshop, adding a light‑hearted finish to the technical journey.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

CPUOperating SystemSegmentation
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.