Changeset 5353 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Oct 17, 2007 1:36:00 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/rombios.c
r5263 r5353 6905 6905 write_byte(0x40,0x40, BX_FLOPPY_ON_CNT); 6906 6906 6907 #ifdef VBOX 6908 // program data rate 6909 val8 = read_byte(0x0040, 0x008b); 6910 val8 >>= 6; 6911 outb(0x03f7, val8); 6912 #endif 6913 6907 6914 // wait for drive readiness 6908 6915 do { … … 7977 7984 Bit8u bootlan; 7978 7985 #endif /* VBOX */ 7979 #ifndef VBOX7980 7986 Bit8u bootchk; 7981 #endif /* !VBOX */7982 7987 Bit16u bootseg; 7983 7988 Bit16u status; … … 8182 8187 // have a 55AAh signature. UNIX boot floppies typically have no such 8183 8188 // signature. In general, it is impossible to tell a valid bootsector 8184 // from an invalid one; some heuristic would be needed - a JMP instruction 8185 // in one of the first few bytes, absence of long sequences of identical 8186 // bytes at the start or beginning or boot sector etc. 8187 // The risk of attempting to boot an invalid floppy is low, certainly 8188 // lower than the risk of refusing to boot a valid floppy. 8189 #else /* !VBOX */ 8189 // from an invalid one. 8190 // NB: It is somewhat common for failed OS installs to have the 8191 // 0x55AA signature and a valid partition table but zeros in the 8192 // rest of the boot sector. We do a quick check by comparing the first 8193 // two words of boot sector; if identical, the boot sector is 8194 // extremely unlikely to be valid. 8195 #endif 8190 8196 // check signature if instructed by cmos reg 0x38, only for floppy 8191 8197 // bootchk = 1 : signature check disabled 8192 8198 // bootchk = 0 : signature check enabled 8193 8199 if (bootdrv != 0) bootchk = 0; 8200 #ifdef VBOX 8201 else bootchk = 1; /* disable 0x55AA signature check on drive A: */ 8202 #else 8194 8203 else bootchk = inb_cmos(0x38) & 0x01; 8204 #endif 8195 8205 8196 8206 #if BX_ELTORITO_BOOT … … 8201 8211 8202 8212 if (bootchk == 0) { 8203 if (read_word(bootseg,0x1fe) != 0xaa55) { 8213 if (read_word(bootseg,0x1fe) != 0xaa55 || 8214 read_word(bootseg,0) == read_word(bootseg,2)) { 8204 8215 #ifdef VBOX 8205 8216 print_boot_failure(bootcd, bootlan, bootdrv, 0, lastdrive); … … 8210 8221 } 8211 8222 } 8212 #endif /* !VBOX */8213 8223 8214 8224 #if BX_ELTORITO_BOOT
Note:
See TracChangeset
for help on using the changeset viewer.