Changeset 103864 in vbox
- Timestamp:
- Mar 15, 2024 9:13:46 AM (12 months ago)
- svn:sync-xref-src-repo-rev:
- 162235
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/VBoxBs3Linker.cpp
r102285 r103864 739 739 * sided 5.25" floppy with 40 tracks, while the BIOS keeps reporting a 740 740 * 1.44MB 3.5" floppy. So, just avoid those sizes too. 741 * 742 * There are many problem sizes like 400kB, 820kB; see fd_formats[] in 743 * src/VBox/Devices/Storage/DevFdc.cpp. Every size in the table is an 744 * even number of kB; let's just pad to an odd number number of kB. 745 * 746 * Controller-recognized sizes cause boot failure in bs3-bootsector.asm. 747 * When avoiding 64kB DMA boundaries it tries to read a sector outside the 748 * guessed geometry, receiving a hard I/O error. 741 749 */ 742 750 uint32_t cbOutput = ftell(pOutput); 751 #if 1 752 uint32_t uBoundary = cbOutput % (2 * 1024); 753 if (uBoundary != 1024) 754 { 755 static uint8_t const s_abZeroBytes[2 * 1024] = { 0 }; 756 uint32_t cbPaddingNeeded = (uBoundary < 1024) ? 1024 - uBoundary : 3 * 1024 - uBoundary; 757 758 if (fwrite(s_abZeroBytes, sizeof(uint8_t), cbPaddingNeeded, pOutput) != cbPaddingNeeded) 759 return RTMsgErrorExitFailure("fwrite failed (padding)"); 760 } 761 #else 743 762 if ( cbOutput == 512 * 8 * 40 * 1 /* 160kB 5"1/4 SS */ 744 763 || cbOutput == 512 * 9 * 40 * 1 /* 180kB 5"1/4 SS */ … … 750 769 return RTMsgErrorExitFailure("fwrite failed (padding)"); 751 770 } 771 #endif 752 772 753 773 return RTEXITCODE_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.