I've been trying to write a boot loader compatible with both UEFI and legacy BIOS. So far, I've gotten UEFI working fine. As well, the boot sector works in virtual box. However, when I use Win32DiskImager (I'm on Windows with WSL) to put my ISO on a USB drive, only the UEFI boot works. My boot sector should do nothing. It jumps to the start of my code, then jumps to itself. In theory, when running my boot sector, nothing should happen. Instead, when I try to execute it, the cursor jumps around on the left of the screen before returning to the boot media selection menu.
Why would this be happening?
Also, I use the isohdpfx.bin file from the isolinux Debian package. My project is licensed under GPL 3. Is it legal for me to package that file in my project. Also, do I need to give credit? If so, where should I give credit?
As well, I use gnu-efi for the UEFI bootloader portion. To include it, there is a git clone inside my Makefile. Is that OK?
Here is the command I used to make the .iso:
Code:
$ xorriso -as mkisofs -c boot/bootcat -o out/os.iso \
-b boot/boot_sector.bin -no-emul-boot -boot-load-size 4 \
-isohybrid-mbr boot/isohdpfx.bin \
-eltorito-alt-boot -e boot/efi.img -no-emul-boot -isohybrid-gpt-basdat out/iso
I compiled the boot_sector.bin file with nasm:
Code:
$ nasm -f bin -o boot/boot_sector.bin boot_sector.asm
My boot sector is:
Code:
[org 0x7c00]
[bits 16]
Main:
jmp 0x0:.start
times 64 - ($ - $$) db 0
.start:
jmp $
The rest of my code can be found on my GitHub:
https://github.com/ljtpetersen/jpos/