Bootloader: Difference between revisions

m
fixed wikilink
[unchecked revision][unchecked revision]
(ported Rolling your own bootloader)
 
m (fixed wikilink)
Line 15:
In RealMode, the easiest is to stay below the 1MB barrier, which means you practically have 512KB of memory to load things. You may wish the kernel to be loaded at a well-known position, say 0x10000 physical (es=0x1000, bx=0 when calling INT13h).
 
If your kernel is bigger (or is expected to grow bigger) than this, you'll probably prefer to have the kernel above the 1MB barrier, which means you need to activate [[A20 Line|A20 gate]] and switch to [[Unreal Mode]] to load the kernel (with A20 alone, you cannot have more than 64K above 1MB).
 
Note that BIOS will still be unable to write to memory above 1MB, so you need to read stuff in a buffer below 1MB and then perform a rep movsd to place the data where they ultimately should go.
Line 46:
=== Establishing an environment ===
Most kernels require protected mode. For these kernels you'll have to
* Enable [[A20 Line|A20]]
* Load a [[GDT]]
* Enter [[Protected mode]]
1,490

edits