Remove PCem specific limits

This commit is contained in:
shermp
2018-11-15 14:02:38 +13:00
parent d9ab4482c5
commit ff6d78bb13
2 changed files with 8 additions and 7 deletions

View File

@@ -329,13 +329,12 @@ VHDGeom vhd_calc_chs(uint32_t sz_mb)
VHDGeom chs;
uint32_t ts = ((uint64_t)sz_mb * 1024 * 1024) / VHD_SECTOR_SZ;
uint32_t spt, heads, cyl, cth;
/* PCem does not currently support spt > 63 */
// if (ts > 65535 * 16 * 255)
// ts = 65535 * 16 * 255;
if (ts > 65535 * 16 * 255)
ts = 65535 * 16 * 255;
if (ts >= 65535 * 16 * 63)
{
ts = 65535 * 16 * 63;
spt = 63;
spt = 255;
heads = 16;
cth = ts / spt;
}

View File

@@ -49,10 +49,12 @@
#define VHD_SPARSE_BLK 0xffffffff
#define VHD_DEF_BLOCK_SZ 2097152
#define VHD_START_TS 946684800
// #define MAX_BAT_SIZE_BYTES 16896
#define VHD_MAX_BAT_SIZE_BYTES 64512 /* Enough entries for largest VHD PCem can create */
/* Enough entries for largest VHD MiniVHD can create.
Calculated by ceil(65535 * 16 * 255 / 4096) * 4 */
#define VHD_MAX_BAT_SIZE_BYTES 261120
#define VHD_MAX_CYL 65535 /* VHD stores the cylinders as a 16-bit unsigned int */
#define VHD_MAX_SZ_MB 32255 /* Using max (65535 * 16 * 63) geom */
#define VHD_MAX_SZ_MB 130559 /* Using max (65535 * 16 * 255) geom */
/* Win 10 appears to add 7 sectors of zero padding between blocks, and before the footer. */
#define VHD_BLK_PADDING 3584