-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the brunix wiki!
http://wiki.osdev.org/Memory_Map_%28x86%29
+------------------+ <- 0xFFFFFFFF (4GB) | 32-bit | | memory mapped | | devices | | | //////////\
//////////
| |
| Unused |
| |
+------------------+ <- depends on amount of RAM
| |
| |
| Extended Memory |
| |
| |
+------------------+ <- 0x00100000 (1MB)
| BIOS ROM |
+------------------+ <- 0x000F0000 (960KB)
| 16-bit devices, |
| expansion ROMs |
+------------------+ <- 0x000C0000 (768KB)
| VGA Display |
+------------------+ <- 0x000A0000 (640KB)
| |
| Low Memory |
| |
+------------------+ <- 0x00000000
Figure from https://pdos.csail.mit.edu/6.828/2014/labs/lab1
The PC starts executing in REAL MODE with CS:IP [0xf000:0xfff0] (physical address 0x000ffff0), an address corresponding to the ROM BIOS. The next thing that the PC does is jump backwards to an earlier location in the BIOS [0xf000:0xe05b].
The BIOS prepares de env and then sets up a temporary stack: mov ss, 0 mov sp, 0x7000 and enables A20 gate (for addressing more than 1Mb of memory)
[f000:d248] 0xfd248: lidtw %cs:0x68f8
[f000:d24e] 0xfd24e: lgdtw %cs:0x68b4
[f000:d25e] 0xfd25e: ljmpl $0x8,$0xfd266
REFERENCIA: https://github.com/petroav/6.828/blob/master/lab/solutions/lab1.md
When the BIOS finds a bootable floppy or hard disk, it loads the 512-byte boot sector into memory at physical addresses 0x7c00 through 0x7dff, and then uses a jmp instruction to set the CS:IP to 0000:7c00, passing control to the boot loader.