Rolling Your Own Bootloader: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
[unchecked revision][unchecked revision]
m (Killing "PlusPlus" for "C++ Bare Bones" too)
mNo edit summary
Line 27:
You will have to decide where in memory you are going to load your kernel. Your kernel generally depends on it.
 
In RealModeReal Mode, 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).
Line 79:
If you're loading above 1MB, you should proceed in 2 steps: first using BIOS to load in the "conventional" area, and then performing a <tt>rep movsd</tt> to place the data where they ultimately should go.
 
== Loaded. Gathering InformationsInformation ==
 
The next step consist of collecting as much information as you can/need: [[How Do I Determine The Amount Of RAM|amount of installed RAM]], available [[Getting VBE Mode Info|video modes]] and things alike are easier to do in real mode, so better do them while in [[Real Mode]] than trying to come back to real mode for a trip later. Of course the exact requirements depend on your kernel.
 
A very simple solution here is to organize your informationsinformation as a flat table (ala [[BIOS|BIOS data area]]). An alternative could be to add those informationsinformation as a structured flow: you keep an index at a well-known address (or at some address you'll pass to the kernel when loaded) and that index gives for each "key" the address of the corresponding data structure. E.g.
 
<pre>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu