Hello. I've just finished developing the ISO9660 stage 1 bootloader. But i don't know where to put stage 2.
Stage 1 locates at 0x0000:0x7c00 - 0x0000:0x8400.
So, where is the optimal place to put the stage 2 bootloader?
Where to put stage 2?
Re: Where to put stage 2?
Hi,
Short answer: wherever you like.
If it's a normal sized stage 2, why not place in in RAM immediately after stage 1? You have all that space up to the start of the BDA. If your stage 2 is more like a kernel, you will want somewhere above 1MiB.
The wiki article [wiki]Memory Map (x86)[/wiki] tells you of a few areas that are guaranteed free. You are also generally safe in the area from 1MiB - 14MiB if the RAM exists and you don't intend to place your kernel there. It's also worth generating a system memory map early on.
Cheers,
Adam
Short answer: wherever you like.
If it's a normal sized stage 2, why not place in in RAM immediately after stage 1? You have all that space up to the start of the BDA. If your stage 2 is more like a kernel, you will want somewhere above 1MiB.
The wiki article [wiki]Memory Map (x86)[/wiki] tells you of a few areas that are guaranteed free. You are also generally safe in the area from 1MiB - 14MiB if the RAM exists and you don't intend to place your kernel there. It's also worth generating a system memory map early on.
Cheers,
Adam
Re: Where to put stage 2?
OK. Thanks for the answer.AJ wrote:Hi,
Short answer: wherever you like.
If it's a normal sized stage 2, why not place in in RAM immediately after stage 1? You have all that space up to the start of the BDA. If your stage 2 is more like a kernel, you will want somewhere above 1MiB.
The wiki article [wiki]Memory Map (x86)[/wiki] tells you of a few areas that are guaranteed free. You are also generally safe in the area from 1MiB - 14MiB if the RAM exists and you don't intend to place your kernel there. It's also worth generating a system memory map early on.
Cheers,
Adam