Bootloader that reads sectors problem
Posted: Sat Feb 05, 2011 7:20 am
Hi,
I've been reading several assembler tutorials about printing text to the screen (The one here on OSDev was the main one I used ) and also how to load sectors from a floppy into memory. After getting the text working, I went onto resetting the FDC and then *attempting* to load some sectors and then jump to them.
However, it seems to be having problems. As far as I can tell, it resets the FDC and reads the sectors OK, but seems to never execute what has been loaded into memory (I assume this is relevant: Bochs takes about 30 seconds from the message "Loading sectors into memory..." and "Done!", and then displays "Jumping to memory..." and at this point the loaded program should display "Hello, World!" but it never gets this far. QEMU displays a load of random ASCII characters where the word "Jumping" should be).
I've tried many different things to get it working, but with no luck! I've attached the code in the hope that someone can tell me what I'm doing wrong (I wouldn't be surprised if it was something obvious to anyone else who has written a bootloader, but this is my first attempt).
Thank you very much
Lloyd
PS: I use to concatenate the files, and then I use to write it to the floppy.
I've been reading several assembler tutorials about printing text to the screen (The one here on OSDev was the main one I used ) and also how to load sectors from a floppy into memory. After getting the text working, I went onto resetting the FDC and then *attempting* to load some sectors and then jump to them.
However, it seems to be having problems. As far as I can tell, it resets the FDC and reads the sectors OK, but seems to never execute what has been loaded into memory (I assume this is relevant: Bochs takes about 30 seconds from the message "Loading sectors into memory..." and "Done!", and then displays "Jumping to memory..." and at this point the loaded program should display "Hello, World!" but it never gets this far. QEMU displays a load of random ASCII characters where the word "Jumping" should be).
I've tried many different things to get it working, but with no luck! I've attached the code in the hope that someone can tell me what I'm doing wrong (I wouldn't be surprised if it was something obvious to anyone else who has written a bootloader, but this is my first attempt).
Thank you very much
Lloyd
PS: I use
Code: Select all
cat boot.bin boot2.bin > fullboot.bin
Code: Select all
dd if=/home/lloyd/fullboot.bin of=/dev/fd0