Hi,
ive just completed a fat16 bootloader, but im trying to consider how to proceed. As the first few lines of the kernel are still in real mode (the fat16 bootloader lives entirely in the MBR and so has no space to switch to protected) i cannot place the kernel at 1MB, the standard location. Is there any problem with me loading it at somewhere earlier, e.g. the 1KB boundary, apart from having to jump around the EBDA and other annoyances? Or is there a workaround for this?
Thanks in advance
loading kernel to location other than 1MB?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: loading kernel to location other than 1MB?
There is no real issue with having a kernel below 1MB, other than having a limited amount of space for your kernel to fit in (some 500k), and your bootloader being in the middle (just below the 32k mark)
What most people do is use unreal mode, or a two-stage bootloader to make loading at 1M a lot easier. And some are able to fit it all in 512 bytes.
What most people do is use unreal mode, or a two-stage bootloader to make loading at 1M a lot easier. And some are able to fit it all in 512 bytes.
Re: loading kernel to location other than 1MB?
surely if i jmp instead of call to the kernel i can overwrite the bootloader in memory? seen as i wont be returning there.
[edit] never mind, i just realised that if the kernel overran the bootloader the jmp to the kernel would be overwritten and the kernel would begin execution halfway through.
[edit] never mind, i just realised that if the kernel overran the bootloader the jmp to the kernel would be overwritten and the kernel would begin execution halfway through.
Re: loading kernel to location other than 1MB?
My boot loader relocates itself to the 90000h area. It loads a 2nd stage loader, though, which doubles as half the kernel. The 2nd stage module loads in the range 40000h-70000h. When it runs, I loads the remainder above 1 Meg.
Re: loading kernel to location other than 1MB?
hmm im starting to get an idea of what ill do. as ive chosen a heavily abstracted microkernel as my design, i might load it to 0x10000/64kb and simply have the kernel parse the filesystem and load a bunch of drivers and such in over the 1MB boundary, then set them to work. Basically a mix of second stage bootloader and kernel.
Thanks for the advice
Thanks for the advice
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: loading kernel to location other than 1MB?
Which may very well be inside the EBDALoseThos wrote:My boot loader relocates itself to the 90000h area.