In the x86 architecture, memory is categorized into different regions based on their address range. Understanding these categories is crucial for system programming and operating system development. Two primary regions are Low Memory (Conventional Memory) and Extended Memory.
1️⃣ Low Memory (Conventional Memory)
- Definition: Low Memory, also known as Conventional Memory, refers to the first 1 MB of the physical address space in an x86 system.
- Address Range:
0x00000 to 0xFFFFF
(0 to 1 MB). - Historical Context: This memory region was originally designed for use by the operating system, BIOS, and DOS applications. It follows the memory model of the original IBM PC.
- Usage:
- BIOS: Basic Input/Output System (BIOS) uses the upper portion of this memory for its data and interrupt vectors.
- Operating System: Early operating systems and bootloaders reside in this region.
- DOS Applications: DOS and early PC applications run within this 1 MB space.
- Video Memory: A portion of this memory (typically starting at 0xA0000) is reserved for video memory in text and graphics modes.
2️⃣ Extended Memory
- Definition: Extended Memory refers to all physical memory addresses above 1 MB.
- Address Range:
0x100000 and above
(1 MB and higher). - Historical Context: As PCs evolved and required more memory than what was available in Conventional Memory, the concept of Extended Memory was introduced.
- Usage:
- Operating Systems: Modern operating systems, such as Windows and Linux, utilize Extended Memory to provide a larger memory space for applications and system processes.
- Protected Mode: To access Extended Memory, systems switch from Real Mode to Protected Mode or Long Mode, allowing for the use of 32-bit or 64-bit address spaces.
- High-Performance Applications: Applications that require large amounts of memory, such as databases and scientific computing applications, make use of Extended Memory.
Accessing Memory Regions
- Real Mode: In Real Mode, the CPU can directly address only up to 1 MB of memory. This mode is typically used by bootloaders and DOS.
- Protected Mode: Introduced with the 80286 processor, Protected Mode allows access to Extended Memory and provides features like memory protection and multitasking.
- Long Mode: Available in x86-64 processors, Long Mode allows 64-bit addressing, enabling access to a vast amount of memory beyond the 4 GB limit of 32-bit systems.
What is Memory Map?
A memory map is a representation of the layout and organization of memory in a computer system. It defines the allocation and usage of memory addresses for different purposes, such as system components, hardware devices, and software applications.
Memory Map Example
Here's a simplified view of the memory map for a typical x86 system:
Low Memory:
Address Range | Size | Description | Notes |
---|---|---|---|
00000h - 003FFh | 1 KB | Interrupt Vector Table (IVT) | Stores 256 interrupt vectors (4 bytes each). |
00400h - 004FFh | 256 bytes | BIOS Data Area (BDA) | Holds system data (e.g., equipment, keyboard status). |
00500h - 07BFFh | ~31 KB | Conventional Memory (Low Memory) | Used for temporary program data, stack, etc. |
07C00h - 07DFFh | 512 bytes | Bootloader Area | Typically where the BIOS loads the MBR. |
07E00h - 9FBFFh | ~607 KB | Usable Conventional Memory | Available to programs in real mode. |
9FC00h - 9FFFFh | 1 KB | Extended BIOS Data Area (EBDA) | Used for ACPI tables or other data. |
A0000h - AFFFFh | 64 KB | Graphics Memory (EGA/VGA) | For video graphics in higher resolutions. |
B0000h - B7FFFh | 32 KB | Monochrome Display Memory | Used for MDA adapters (monochrome text mode). |
B8000h - BFFFFh | 32 KB | Color Text Mode Video Memory | Text mode display memory (CGA/VGA). |
C0000h - C7FFFh | 32 KB | Video BIOS | Contains firmware for video hardware. |
C8000h - DFFFFh | 96 KB | Optional ROMs and Expansion Cards | ROMs for add-on cards (e.g., SCSI, network). |
E0000h - EFFFFh | 64 KB | Reserved for System BIOS Extensions | Reserved for advanced firmware features. |
F0000h - FFFFFh | 64 KB | System BIOS | Contains motherboard BIOS and POST routines. |
Memory Beyond 1 MB:
Address Range | Size | Description | Notes |
---|---|---|---|
100000h - 10FFFFh | 64 KB | High Memory Area (HMA) | First 64 KB above 1 MB boundary, accessible in real mode with A20 enabled. |
110000h - xxxxxx | Variable | Extended Memory | Available in protected mode or beyond. |
FFFF0h | 16 bytes | Reset Vector | CPU starts execution here after reset. |