Home > database >  bochs: can not load bootloader using a floppy image
bochs: can not load bootloader using a floppy image

Time:07-23

I have a simple (probably the simplest) bootloader. Very similar to enter image description here

Nothing comes on the screen and after a bit I get that bochs is not responding.

My present approach to load the image is -

  1. nasm boot_simple.asm -f bin -o boot.bin

  2. dd if=boot.bin of=boot.img bs=512

  3. bochs -f /dev/null -q 'display_library: sdl2' 'boot:a' 'floppya: 1_44=boot.img, status=inserted'

I tried many other approaches (slight variations of the above) (even tried to compile and load a separate bootloader from enter image description here

This is my bochs config file -

romimage: file="/usr/share/seabios/bios.bin"
vgaromimage: file ="/usr/share/bochs/VGABIOS-lgpl-latest"
floppya: 1_44=floppy.img, status=inserted
boot: a
display_library: x,
log: bochsout.txt

With this option I am able to get rid of the not-responding part. A small advancement. (using seabios) but it still does not display anything. So, I have checked from the menu and it is detecting the floppy in fd0. I am suspecting the vgabios is also not working And hence I do not see anything? Well I am a bit lost to be frank. But as comments say, I think it is not a normal case.

CodePudding user response:

BOCHS will always stop at the first instruction in the BIOS when launched. The first instruction is at 0xf000:0xfff0 which is what you see in the output. This gives you a chance to set breakpoints ahead of time. For example b 0x7c00 would break at the first instruction of the bootloader if you wished. To start running just use the command c to continue.

  • Related