1

I was playing around with my own bootloader in QEMU for x32 bit systems and tried booting from iso file with not setting 0xAA55 as the last two bytes of the sector and 0x2233 instead
But QEMU still booted and showed the same results as it did before
Without the correct signature shouldnt QEMU fail to recognize my disk as bootable device? How is it still booting?
Heres my bootloader.asm :

org     0x7c00              ; We are loaded by BIOS at 0x7C00
 
bits    16                  ; We are still in 16 bit Real Mode
 
Start:
 
    cli                 ; Clear all Interrupts
    hlt                 ; halt the system
    
times 510 - ($-$$) db 0             ; We have to be 512 bytes. Clear the rest of the bytes with 0
 
dw 0x2233                   ; Boot Signiture

I followed this question to make the iso file to boot from and even tried with changing the signature of asm code of the question, and QEMU again recognized it as a bootable media and printed "This is my cool new OS!" on screen

  • 1
    Looks like QEMU doesn't care about the boot signature. After all it's pretty much useless anyways... – Marco Bonelli Jun 06 '22 at 22:32
  • 2
    I think QEMU checks for a bootloader signature for legacy floppy disk media, not for bootloader embedded in a CD-ROM image. What happens if you try booting with QEMu using `-fda disk.img` where disk.img is a floppy image? – Michael Petch Jun 07 '22 at 00:34
  • @MichaelPetch Yes you are correct, the boot failed, QEMU was unable to recognize any bootable media, turns out it only checks for boot signature for floppy disk image, but not for CD-ROM. Any idea as to why is it so? – user13675319 Jun 07 '22 at 06:04
  • 2
    @user13675319 Because you are already using a "signature" when making an ISO. Read about El Torito. – Margaret Bloom Jun 07 '22 at 10:39

0 Answers0