VirtualBox

Ignore:
Timestamp:
Apr 3, 2012 10:59:59 AM (13 years ago)
Author:
vboxsync
Message:

BIOS: Do a basic sanity check on floppy boot sectors, too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS-new/boot.c

    r38699 r40754  
    297297    }
    298298   
    299     // Don't check boot sectors on floppies and don't read CMOS - byte
    300     // 0x38 in CMOS always has the low bit clear.
    301     // There is *no* requirement whatsoever for a valid boot sector to
    302     // have a 55AAh signature. UNIX boot floppies typically have no such
     299    // There is *no* requirement whatsoever for a valid floppy boot sector
     300    // to have a 55AAh signature. UNIX boot floppies typically have no such
    303301    // signature. In general, it is impossible to tell a valid bootsector
    304302    // from an invalid one.
     
    317315#endif // BX_ELTORITO_BOOT
    318316   
    319     if (bootchk == 0) {
    320         if (read_word(bootseg,0x1fe) != 0xaa55 ||
    321             read_word(bootseg,0) == read_word(bootseg,2)) {
    322             print_boot_failure(bootcd, bootlan, bootdrv, 0, lastdrive);
    323             return 0x00000000;
    324         }
     317    if (read_word(bootseg,0) == read_word(bootseg,2)
     318      || (bootchk == 0 && read_word(bootseg,0x1fe) != 0xaa55))
     319    {
     320        print_boot_failure(bootcd, bootlan, bootdrv, 0, lastdrive);
     321        return 0x00000000;
    325322    }
    326323   
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette