Anonymous user
Memory Map (x86): Difference between revisions
→External Links: update link to archive link
[unchecked revision] | [unchecked revision] |
(→"Low" memory (< 1 MiB): update EBDA limit text) |
(→External Links: update link to archive link) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1:
This article describes the contents of the computer's physical memory at the moment that the BIOS jumps to your bootloader code.
==
When a typical x86 PC boots it will be in [[Real Mode]], with an active [[BIOS]]. During the time the CPU remains in Real Mode, IRQ0 (the clock)
Line 21:
Note: the EBDA is a variable-sized memory area (on different BIOSes). If it exists, it is always immediately below 0xA0000 in memory.
It is absolutely guaranteed to be at most 128 KiB in size. Older computers typically uses 1 KiB from 0x9FC00 - 0x9FFFF, modern firmware can be found using significantly more.
You can determine the size of the EBDA by using BIOS function [[Detecting Memory (x86)#Detecting Low Memory|INT 12h]], or
Both of those methods will tell you
It should also be noted that your bootloader code is
area is likely to also be unusable until execution has been transferred to a second stage bootloader, or to your kernel.
Line 34:
! end
! size
! description
! colspan=2 | type
|-
! colspan=
|-
| 0x00000000
| 0x000003FF
| 1 KiB
| Real Mode IVT (Interrupt Vector Table)
| rowspan=2 | unusable in real mode
| rowspan=6 | 640 KiB RAM ("Low memory")
|-
| 0x00000400
| 0x000004FF
| 256 bytes
| BDA (BIOS data area)
|-
| 0x00000500
| 0x00007BFF
|
| Conventional memory
| rowspan=3 | usable memory
|-
| 0x00007C00
| 0x00007DFF
| 512 bytes
| Your OS BootSector
|-
Line 66 ⟶ 65:
| 0x0007FFFF
| 480.5 KiB
| Conventional memory
|-
Line 72 ⟶ 70:
| 0x0009FFFF
| 128 KiB
| EBDA (Extended BIOS Data Area)
| partially used by the EBDA
|-
| 0x000A0000
| 0x000BFFFF▼
| 128 KiB▼
| rowspan=4 | 384 KiB System / Reserved ("Upper Memory")
|-▼
| 0x000C0000▼
| 0x000C7FFF▼
| 32 KiB (typically)▼
| Video BIOS▼
| rowspan=3 | ROM and hardware mapped / Shadow RAM
|-▼
| 0x000C8000▼
| 0x000EFFFF▼
| 160 KiB (typically)▼
| BIOS Expansions
|-▼
| 0x000F0000▼
| 0x000FFFFF
|
| Motherboard BIOS▼
|}
===BIOS Data Area (BDA)===
The BDA is only partially standardized
The following is a partial list. See the External Links references below for more detail.
Line 104 ⟶ 119:
| packed bit flags for detected hardware
|-
| 0x0413 (word)
| Number of kilobytes before EBDA / unusable memory
|- ▼
| 0x0417 (word)
| keyboard state flags
Line 134 ⟶ 152:
| last keyboard LED/Shift key state
|}
===Extended BIOS Data Area (EBDA)===
You may see "maps" of the EBDA if you search the web. However, those maps are for the original IBM BIOS EBDA.
▲|-
▲|-
▲|-
▲| 0x000BFFFF
▲| 128 KiB
▲| VGA display memory
▲|-
▲| 0x000C0000
▲| 0x000C7FFF
▲| 32 KiB (typically)
▲| Video BIOS
▲| 0x000C8000
▲| 0x000EFFFF
▲| 160 KiB (typically)
▲| Mapped hardware & Misc.
▲| 0x000F0000
▲| Motherboard BIOS
==
The region of RAM above 1 MiB is not standardized, well-defined, or contiguous. There are likely to be regions of it that
Line 186 ⟶ 164:
Some ACPI areas cannot be "reclaimed" this way. Some of the computer's RAM may extend above 4 GiB.
Use the BIOS function [[Detecting Memory (x86)#BIOS Function: INT 0x15, EAX = 0xE820|INT 15h, EAX=0xE820]] to get a reliable map of
Line 247 ⟶ 225:
===External Links===
* https://web.archive.org/web/20120130052813/http://www.nondot.org/sabre/os/files/Booting/BIOS_SEG.txt -- detailed BIOS Data Area map
*
* [http://files.osdev.org/mirrors/geezer/osd/ram/index.htm#layout Geezer's memory layout description]
* http://stanislavs.org/helppc/bios_data_area.html
[[Category:X86]]
[[Category:Physical Memory]]
|