多动脑,少走路。
分类: LINUX
2014-11-20 15:06:07
这篇文章主要内容是计算机启动时,BIOS跳转到你的bootloader代码后的计算机的物理内存。
start | end | size | type | description |
---|---|---|---|---|
Low Memory (the first MiB) | ||||
0x00000000 | 0x000003FF | 1 KiB | RAM - partially unusable (see above) | Real Mode IVT (Interrupt Vector Table) |
0x00000400 | 0x000004FF | 256 bytes | RAM - partially unusable (see above) | BDA (BIOS data area) |
0x00000500 | 0x00007BFF | almost 30 KiB | RAM (guaranteed free for use) | Conventional memory |
0x00007C00 (typical location) | 0x00007DFF | 512 bytes | RAM - partially unusable (see above) | Your OS BootSector |
0x00007E00 | 0x0007FFFF | 480.5 KiB | RAM (guaranteed free for use) | Conventional memory |
0x00080000 | 0x0009FBFF | approximately 120 KiB, depending on EBDA size | RAM (free for use, if it exists) | Conventional memory |
0x0009FC00 (typical location) | 0x0009FFFF | 1 KiB | RAM (unusable) | EBDA (Extended BIOS Data Area) |
0x000A0000 | 0x000FFFFF | 384 KiB | various (unusable) | Video memory, ROM Area |
The BDA is only partially standardized, and almost all the values stored there are completely obsolete and uninteresting. The following is a partial list. See the External Links references below for more detail.
address (size) | description |
---|---|
0x0400 (4 words) | IO ports for COM1-COM4 serial (each address is 1 word, zero if none) |
0x0408 (3 words) | IO ports for LPT1-LPT3 parallel (each address is 1 word, zero if none) |
0x040E (word) | EBDA base address >> 4 (usually!) |
0x0410 (word) | packed bit flags for detected hardware |
0x0417 (word) | keyboard state flags |
0x041E (32 bytes) | keyboard buffer |
0x0449 (byte) | Display Mode |
0x044A (word) | number of columns in text mode |
0x0463 (2 bytes, taken as a word) | base IO port for video |
0x046C (word) | # of IRQ0 timer ticks since boot |
0x0475 (byte) | # of hard disk drives detected |
0x0480 (word) | keyboard buffer start |
0x0482 (word) | keyboard buffer end |
0x0497 (byte) |
last keyboard LED/Shift key state |
You may see "maps" of the EBDA if you search the web. However, those maps are for the original IBM BIOS EBDA. They do not apply to any current EBDA, used by any current BIOS. The EBDA area is not standardized. It does contain data that your OS will need, but you must do a bytewise pattern search to find those tables. (See Plug-and-Play.)
start | end | size | region/exception | description |
---|---|---|---|---|
Standard usage of the ROM Area | ||||
0x000A0000 | 0x000BFFFF | 128 KiB | video RAM | VGA display memory |
0x000C0000 | 0x000C7FFF | 32 KiB (typically) | ROM | Video BIOS |
0x000C8000 | 0x000EFFFF | 160 KiB (typically) | ROMs and unusable space | Mapped hardware & Misc. |
0x000F0000 | 0x000FFFFF | 64 KiB | ROM |
Motherboard BIOS |
start | end | size | region/exception | description |
---|---|---|---|---|
High Memory | ||||
0x00100000 | 0x00EFFFFF | 0x00E00000 (14 MiB) | RAM -- free for use (if it exists) | Extended memory 1, 2 |
0x00F00000 | 0x00FFFFFF | 0x00100000 (1 MiB) | Possible memory mapped hardware | ISA Memory Hole 15-16MB 3 |
0x01000000 | ???????? | ???????? (whatever exists) | RAM -- free for use | More Extended memory 1 |
0xC0000000 (sometimes, depends on motherboard and devices) | 0xFFFFFFFF | 0x40000000 (1 GiB) | various (typically reserved for memory mapped devices) | Memory mapped PCI devices, PnP NVRAM?, IO APIC/s, local APIC/s, BIOS, ... |
0x0000000100000000 (possible memory above 4 GiB) | ???????????????? | ???????????????? (whatever exists) | RAM -- free for use (PAE/64bit) | More Extended memory 1 |
???????????????? | ???????????????? | ???????????????? | Possible memory mapped hardware | Potentially usable for memory mapped PCI devices in modern hardware (but typically not, due to backward compatibility) |
1: Different computers have different amounts of RAM, therefore the amount of extended memory you might find will vary and may be anything from "none" (e.g. an old 80386 system) to "lots".
2: Free for use except that your bootloader (ie. GRUB) may have loaded your "modules" here, and you don't want to overwrite those.可以随意使用包括了,你的bootloader如GRUB,很可能调入你的模块在这里,所以你不想覆盖它,
3: The "ISA Memory Hole" (from 0x00F00000 to 0x00FFFFFF) was used for memory mapped ISA devices (e.g. video cards). Modern computers have no need for this hole, but some chipsets still support it (as an optional feature) and some motherboards may still allow it to be enabled with BIOS options, so it may exist in a modern computers with no ISA devices.