diff --git a/src/ints/bios_vhd.cpp b/src/ints/bios_vhd.cpp index 4de058ab56..ce902709ef 100644 --- a/src/ints/bios_vhd.cpp +++ b/src/ints/bios_vhd.cpp @@ -1,6 +1,6 @@ /* * -* Copyright (c) 2018 Shane Krueger. Fixes and upgrades (c) 2023 maxpat78. +* Copyright (c) 2018 Shane Krueger. Fixes and upgrades (c) 2023-24 maxpat78. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -970,20 +970,17 @@ uint64_t imageDiskVHD::scanMBR(uint8_t* mbr, Bitu sizes[], uint64_t disksize) { LOG_MSG("Invalid MBR, no signature"); return 0; } - - //search for the first DOS partition + //search for the first non-empty partition for(part = mbr + 0x1BE; part < mbr + 0x1FE; part += 16) { uint8_t partType = *((uint8_t*)(part + 4)); - if(partType != 1 && partType != 4 && partType != 6 && - partType != 11 && partType != 12 && partType != 14) continue; + if(partType == 0) continue; partFound = true; break; } if(!partFound) { - LOG_MSG("No DOS partition in MBR"); + LOG_MSG("No partition in use in MBR"); return 0; } - //partition end h = (unsigned)*(part + 5); s = (unsigned)*(part + 6) & 0x3F;