Bootloader

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Therx

Bootloader

Post by Therx »

I've decided to write my own loader as I find GRUB annoying at times. It is loader by Chris GEise's FAT12 Loader (loads at 10000h and ORG value 100h) Using tutorials from around the place and my own knowledge I've managed to make it display a Splashscreen from a Bitmap file glued to the end of the loader. And now it successfully goes into PMode. But I have several problems.

1. I couldn't make it use a flat Code segment but for the time being I can settle with just using a flat data selector.

2. I've glued my kernel to the end of the file (ie STAGE2 + BITMAP + KERNEL) and in the code I try to copy it to the 1mb mark. But it crashes. I'm not sure whether that is because I haven't enabled A20 correctly or what. I've attached the code. I think it crashes at (checked with Bochs and the debug message afterwards is never printed even on real hardware):-

Code: Select all

mov esi, [kern_ptr]
mov edi, 0x100000
mov cx, KERN_SIZE
rep movsb
It compiles with:-

Code: Select all

nasm -f bin -o stage2.bin stage2.asm
copy /b /y stage2.bin + logo.bmp + kernel.bin load.bin
copy /y load.bin a:\
Where logo.bmp is 640x70x256. The kernel is known to work.

Pete

[attachment deleted by admin]
Post Reply