I'm learning Operating System programming and I would like to try my programs/codes on a physical machine instead of virtual ones.
I tried the simplest real mode program (show below):
jmp $ ; will loop forever
times 510-($-$$) db 0 ; padding
dw 0xaa55 ; magic boot sector number
this works fine ont the x86 emulator Bochs after I compiled it and created a floppy disk image using the following instructions:
sudo nasm $1 -f bin -o boot.bin
sudo dd status=noxfer conv=notrunc if=boot.bin of=floopy_image.flp
Everything worked fine so I wanted it to go through further testing so I tried it one VMware Player and Oracle VM VirtualBox after adding the following conversion instructions:
sudo mkdir -p iso
sudo cp floopy_image.flp iso/floopy_image.flp
sudo mkdir -p binaries
sudo cp floopy_image.flp binaries/floopy_image.flp
sudo rm -f floopy_image.flp
sudo mkisofs -no-emul-boot -boot-load-size 4 -input-charset cp437 -o binaries/cdrom_image.iso -b floopy_image.flp iso/
I this point I had an ISO image version of the floppy image. The ISO image worked as well on both virtualization software.
Quite happy with myself I though "Now the final test : Running it on a physical machine". So I tried flashing a flash drive with the ISO file with Balena Etcher and I got an error stating:
It looks like this is not a bootable image.
The image does not appear to contain a partition table, and might not be recognized or bootable by your device
I pressed continue to flash de stick and try it anyway... The computer said there was no bootable device and I should connect one and press any key to continue.
Also not that it didn't work with Rufus either, which gave me the error message:
This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...
I had to cover my bases.
One think to keep in mind though is that when I mount the ISO image on windows I can access it and see two files: "Boot.cat" (I believe windows XP had such a file in it installation disc) and "Floopy_I.flp"