- Timestamp:
- Jul 8, 2013 12:26:47 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmifs.h
r46933 r47036 894 894 /** 2.88MB 3 1/2" floppy drive. */ 895 895 PDMBLOCKTYPE_FLOPPY_2_88, 896 /** Fake drive that can take up to 15.6 MB images. 897 * C=255, H=2, S=63. */ 898 PDMBLOCKTYPE_FLOPPY_FAKE_15_6, 899 /** Fake drive that can take up to 63.5 MB images. 900 * C=255, H=2, S=255. */ 901 PDMBLOCKTYPE_FLOPPY_FAKE_63_5, 896 902 /** CDROM drive. */ 897 903 PDMBLOCKTYPE_CDROM, … … 902 908 } PDMBLOCKTYPE; 903 909 910 /** Check if the given block type is a floppy. */ 911 #define PDMBLOCKTYPE_IS_FLOPPY(a_enmType) ( (a_enmType) >= PDMBLOCKTYPE_FLOPPY_360 && (a_enmType) <= PDMBLOCKTYPE_FLOPPY_2_88 ) 904 912 905 913 /** -
trunk/src/VBox/Devices/PC/BIOS/floppy.c
r46947 r47036 392 392 retval = 1; 393 393 } 394 else if ( drive_type == 14 || drive_type == 15 ) { 395 // 15.6 MB 3.5" (fake) || 63.5 MB 3.5" (fake) - report same as 2.88 MB. 396 config_data = 0xCC; // 1100 1100 397 media_state = 0xD7; // 1101 0111 398 retval = 1; 399 } 394 400 else { 395 401 // not recognized … … 1026 1032 SET_AL(0); 1027 1033 SET_DL(num_floppies); 1034 SET_DH(1); // max head # 1028 1035 1029 1036 switch (drive_type) { … … 1035 1042 case 1: // 360KB, 5.25" 1036 1043 CX = 0x2709; // 40 tracks, 9 sectors 1037 SET_DH(1); // max head #1038 1044 break; 1039 1045 1040 1046 case 2: // 1.2MB, 5.25" 1041 1047 CX = 0x4f0f; // 80 tracks, 15 sectors 1042 SET_DH(1); // max head #1043 1048 break; 1044 1049 1045 1050 case 3: // 720KB, 3.5" 1046 1051 CX = 0x4f09; // 80 tracks, 9 sectors 1047 SET_DH(1); // max head #1048 1052 break; 1049 1053 1050 1054 case 4: // 1.44MB, 3.5" 1051 1055 CX = 0x4f12; // 80 tracks, 18 sectors 1052 SET_DH(1); // max head #1053 1056 break; 1054 1057 1055 1058 case 5: // 2.88MB, 3.5" 1056 1059 CX = 0x4f24; // 80 tracks, 36 sectors 1057 SET_DH(1); // max head #1058 1060 break; 1059 1061 … … 1070 1072 case 8: // 320k, 5.25" 1071 1073 CX = 0x2708; // 40 tracks, 8 sectors 1072 SET_DH(1); // max head # 1073 break; 1074 1074 break; 1075 1076 case 14: // 15.6 MB 3.5" (fake) 1077 CX = 0xfe3f; // 255 tracks, 63 sectors 1078 break; 1079 1080 case 15: // 63.5 MB 3.5" (fake) 1081 CX = 0xfeff; // 255 tracks, 255 sectors - This works because the cylinder 1082 break; // and sectors limits/encoding aren't checked by the BIOS 1083 // due to copy protection schemes and such stuff. 1084 1075 1085 default: // ? 1076 1086 BX_PANIC("%s: bad floppy type\n", __func__); -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r46356 r47036 502 502 PUVM pUVM = PDMDevHlpGetUVM(pDevIns); AssertRelease(pUVM); 503 503 PPDMIBLOCKBIOS apHDs[4] = {0}; 504 PPDMIBLOCKBIOS apFDs[2] = {0};505 504 LogFlow(("pcbiosInitComplete:\n")); 506 505 … … 587 586 * Floppy drive type. 588 587 */ 589 for (i = 0; i < RT_ELEMENTS(apFDs); i++) 588 uint32_t cFDs = 0; 589 u32 = 0; 590 for (i = 0; i < 2; i++) 590 591 { 591 592 PPDMIBASE pBase; 592 593 int rc = PDMR3QueryLun(pUVM, pThis->pszFDDevice, 0, i, &pBase); 593 594 if (RT_SUCCESS(rc)) 594 apFDs[i] = PDMIBASE_QUERY_INTERFACE(pBase, PDMIBLOCKBIOS); 595 } 596 u32 = 0; 597 if (apFDs[0]) 598 switch (apFDs[0]->pfnGetType(apFDs[0])) 599 { 600 case PDMBLOCKTYPE_FLOPPY_360: u32 |= 1 << 4; break; 601 case PDMBLOCKTYPE_FLOPPY_1_20: u32 |= 2 << 4; break; 602 case PDMBLOCKTYPE_FLOPPY_720: u32 |= 3 << 4; break; 603 case PDMBLOCKTYPE_FLOPPY_1_44: u32 |= 4 << 4; break; 604 case PDMBLOCKTYPE_FLOPPY_2_88: u32 |= 5 << 4; break; 605 default: AssertFailed(); break; 606 } 607 if (apFDs[1]) 608 switch (apFDs[1]->pfnGetType(apFDs[1])) 609 { 610 case PDMBLOCKTYPE_FLOPPY_360: u32 |= 1; break; 611 case PDMBLOCKTYPE_FLOPPY_1_20: u32 |= 2; break; 612 case PDMBLOCKTYPE_FLOPPY_720: u32 |= 3; break; 613 case PDMBLOCKTYPE_FLOPPY_1_44: u32 |= 4; break; 614 case PDMBLOCKTYPE_FLOPPY_2_88: u32 |= 5; break; 615 default: AssertFailed(); break; 616 } 595 { 596 PPDMIBLOCKBIOS pFD = PDMIBASE_QUERY_INTERFACE(pBase, PDMIBLOCKBIOS); 597 if (pFD) 598 { 599 cFDs++; 600 unsigned cShift = i == 0 ? 4 : 0; 601 switch (pFD->pfnGetType(pFD)) 602 { 603 case PDMBLOCKTYPE_FLOPPY_360: u32 |= 1 << cShift; break; 604 case PDMBLOCKTYPE_FLOPPY_1_20: u32 |= 2 << cShift; break; 605 case PDMBLOCKTYPE_FLOPPY_720: u32 |= 3 << cShift; break; 606 case PDMBLOCKTYPE_FLOPPY_1_44: u32 |= 4 << cShift; break; 607 case PDMBLOCKTYPE_FLOPPY_2_88: u32 |= 5 << cShift; break; 608 case PDMBLOCKTYPE_FLOPPY_FAKE_15_6: u32 |= 14 << cShift; break; 609 case PDMBLOCKTYPE_FLOPPY_FAKE_63_5: u32 |= 15 << cShift; break; 610 default: AssertFailed(); break; 611 } 612 } 613 } 614 } 617 615 pcbiosCmosWrite(pDevIns, 0x10, u32); /* 10h - Floppy Drive Type */ 618 616 … … 620 618 * Equipment byte. 621 619 */ 622 u32 = !!apFDs[0] + !!apFDs[1]; 623 switch (u32) 624 { 625 case 1: u32 = 0x01; break; /* floppy installed, 2 drives. */ 626 default:u32 = 0; break; /* floppy not installed. */ 627 } 620 if (cFDs > 0) 621 u32 = 0x01; /* floppy installed, 2 drives. */ 622 else 623 u32 = 0x00; /* floppy not installed. */ 628 624 u32 |= RT_BIT(1); /* math coprocessor installed */ 629 625 u32 |= RT_BIT(2); /* keyboard enabled (or mouse?) */ -
trunk/src/VBox/Devices/Storage/DevFdc.cpp
r46339 r47036 122 122 FDRIVE_DRV_120 = 0x02, /* 1.2 MB 5"25 drive */ 123 123 FDRIVE_DRV_NONE = 0x03 /* No drive connected */ 124 #ifdef VBOX 125 , FDRIVE_DRV_FAKE_15_6 = 0x0e /* Fake 15.6 MB drive. */ 126 , FDRIVE_DRV_FAKE_63_5 = 0x0f /* Fake 63.5 MB drive. */ 127 #endif 124 128 } fdrive_type_t; 125 129 … … 184 188 #define NUM_SIDES(drv) (drv->flags & FDISK_DBL_SIDES ? 2 : 1) 185 189 186 static void fd_init(fdrive_t *drv )190 static void fd_init(fdrive_t *drv, bool fInit) 187 191 { 188 192 /* Drive */ 193 #ifndef VBOX 189 194 drv->drive = FDRIVE_DRV_NONE; 195 #else /* VBOX */ 196 if (fInit) { 197 /* Fixate the drive type at init time if possible. */ 198 if (drv->pDrvBlock) { 199 PDMBLOCKTYPE enmType = drv->pDrvBlock->pfnGetType(drv->pDrvBlock); 200 switch (enmType) { 201 case PDMBLOCKTYPE_FLOPPY_360: 202 case PDMBLOCKTYPE_FLOPPY_1_20: 203 drv->drive = FDRIVE_DRV_120; 204 break; 205 case PDMBLOCKTYPE_FLOPPY_720: 206 case PDMBLOCKTYPE_FLOPPY_1_44: 207 drv->drive = FDRIVE_DRV_144; 208 break; 209 default: 210 AssertFailed(); 211 case PDMBLOCKTYPE_FLOPPY_2_88: 212 drv->drive = FDRIVE_DRV_288; 213 break; 214 case PDMBLOCKTYPE_FLOPPY_FAKE_15_6: 215 drv->drive = FDRIVE_DRV_FAKE_15_6; 216 break; 217 case PDMBLOCKTYPE_FLOPPY_FAKE_63_5: 218 drv->drive = FDRIVE_DRV_FAKE_63_5; 219 break; 220 } 221 } else { 222 drv->drive = FDRIVE_DRV_NONE; 223 } 224 } /* else: The BIOS (and others) get the drive type via the CMOS, so 225 don't change it after the VM has been constructed. */ 226 #endif /* VBOX */ 190 227 drv->perpendicular = 0; 191 228 /* Disk */ … … 267 304 fdrive_type_t drive; 268 305 fdisk_type_t disk; 269 uint8_t last_sect; 270 uint8_t max_track; 271 uint8_t max_head; 306 uint8_t last_sect; /**< Number of sectors. */ 307 uint8_t max_track; /**< Number of tracks. */ 308 uint8_t max_head; /**< Max head number. */ 272 309 fdrive_rate_t rate; 273 310 const char *str; … … 317 354 /* 360 kB must match 5"1/4 better than 3"1/2... */ 318 355 { FDRIVE_DRV_144, FDRIVE_DISK_720, 9, 80, 0, FDRIVE_RATE_250K, "360 kB 3\"1/2", }, 356 #ifdef VBOX /* For larger than real life floppy images (see DrvBlock.cpp). */ 357 /* 15.6 MB fake floppy disk (just need something big). */ 358 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_USER, 63, 255, 1, FDRIVE_RATE_1M, "15.6 MB 3\"1/2", }, 359 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_288, 36, 80, 1, FDRIVE_RATE_1M, "2.88 MB 3\"1/2", }, 360 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_288, 39, 80, 1, FDRIVE_RATE_1M, "3.12 MB 3\"1/2", }, 361 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_288, 40, 80, 1, FDRIVE_RATE_1M, "3.2 MB 3\"1/2", }, 362 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_288, 44, 80, 1, FDRIVE_RATE_1M, "3.52 MB 3\"1/2", }, 363 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_288, 48, 80, 1, FDRIVE_RATE_1M, "3.84 MB 3\"1/2", }, 364 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_144, 18, 80, 1, FDRIVE_RATE_500K, "1.44 MB 3\"1/2", }, 365 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_144, 20, 80, 1, FDRIVE_RATE_500K, "1.6 MB 3\"1/2", }, 366 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_144, 21, 80, 1, FDRIVE_RATE_500K, "1.68 MB 3\"1/2", }, 367 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_144, 21, 82, 1, FDRIVE_RATE_500K, "1.72 MB 3\"1/2", }, 368 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_144, 21, 83, 1, FDRIVE_RATE_500K, "1.74 MB 3\"1/2", }, 369 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_144, 22, 80, 1, FDRIVE_RATE_500K, "1.76 MB 3\"1/2", }, 370 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_144, 23, 80, 1, FDRIVE_RATE_500K, "1.84 MB 3\"1/2", }, 371 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_144, 24, 80, 1, FDRIVE_RATE_500K, "1.92 MB 3\"1/2", }, 372 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_720, 9, 80, 1, FDRIVE_RATE_250K, "720 kB 3\"1/2", }, 373 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_720, 10, 80, 1, FDRIVE_RATE_250K, "800 kB 3\"1/2", }, 374 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_720, 10, 82, 1, FDRIVE_RATE_250K, "820 kB 3\"1/2", }, 375 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_720, 10, 83, 1, FDRIVE_RATE_250K, "830 kB 3\"1/2", }, 376 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_720, 13, 80, 1, FDRIVE_RATE_250K, "1.04 MB 3\"1/2", }, 377 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_720, 14, 80, 1, FDRIVE_RATE_250K, "1.12 MB 3\"1/2", }, 378 { FDRIVE_DRV_FAKE_15_6, FDRIVE_DISK_720, 9, 80, 0, FDRIVE_RATE_250K, "360 kB 3\"1/2", }, 379 /* 63.5 MB fake floppy disk (just need something big). */ 380 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_USER, 255, 255, 1, FDRIVE_RATE_1M, "63.5 MB 3\"1/2", }, 381 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_USER, 63, 255, 1, FDRIVE_RATE_1M, "15.6 MB 3\"1/2", }, 382 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_288, 36, 80, 1, FDRIVE_RATE_1M, "2.88 MB 3\"1/2", }, 383 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_288, 39, 80, 1, FDRIVE_RATE_1M, "3.12 MB 3\"1/2", }, 384 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_288, 40, 80, 1, FDRIVE_RATE_1M, "3.2 MB 3\"1/2", }, 385 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_288, 44, 80, 1, FDRIVE_RATE_1M, "3.52 MB 3\"1/2", }, 386 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_288, 48, 80, 1, FDRIVE_RATE_1M, "3.84 MB 3\"1/2", }, 387 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_144, 18, 80, 1, FDRIVE_RATE_500K, "1.44 MB 3\"1/2", }, 388 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_144, 20, 80, 1, FDRIVE_RATE_500K, "1.6 MB 3\"1/2", }, 389 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_144, 21, 80, 1, FDRIVE_RATE_500K, "1.68 MB 3\"1/2", }, 390 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_144, 21, 82, 1, FDRIVE_RATE_500K, "1.72 MB 3\"1/2", }, 391 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_144, 21, 83, 1, FDRIVE_RATE_500K, "1.74 MB 3\"1/2", }, 392 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_144, 22, 80, 1, FDRIVE_RATE_500K, "1.76 MB 3\"1/2", }, 393 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_144, 23, 80, 1, FDRIVE_RATE_500K, "1.84 MB 3\"1/2", }, 394 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_144, 24, 80, 1, FDRIVE_RATE_500K, "1.92 MB 3\"1/2", }, 395 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_720, 9, 80, 1, FDRIVE_RATE_250K, "720 kB 3\"1/2", }, 396 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_720, 10, 80, 1, FDRIVE_RATE_250K, "800 kB 3\"1/2", }, 397 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_720, 10, 82, 1, FDRIVE_RATE_250K, "820 kB 3\"1/2", }, 398 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_720, 10, 83, 1, FDRIVE_RATE_250K, "830 kB 3\"1/2", }, 399 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_720, 13, 80, 1, FDRIVE_RATE_250K, "1.04 MB 3\"1/2", }, 400 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_720, 14, 80, 1, FDRIVE_RATE_250K, "1.12 MB 3\"1/2", }, 401 { FDRIVE_DRV_FAKE_63_5, FDRIVE_DISK_720, 9, 80, 0, FDRIVE_RATE_250K, "360 kB 3\"1/2", }, 402 #endif 319 403 /* end */ 320 404 { FDRIVE_DRV_NONE, FDRIVE_DISK_NONE, (uint8_t)-1, (uint8_t)-1, 0, (fdrive_rate_t)0, NULL, }, … … 335 419 bdrv_get_geometry_hint(drv->bs, &nb_heads, &max_track, &last_sect); 336 420 #else /* VBOX */ 337 if ( drv->pDrvBlock421 if ( drv->pDrvBlock 338 422 && drv->pDrvMount 339 423 && drv->pDrvMount->pfnIsMounted (drv->pDrvMount)) { … … 740 824 { 741 825 if (!(fdctrl->sra & FD_SRA_INTPEND)) { 826 FLOPPY_DPRINTF("Raising interrupt...\n"); 742 827 #ifdef VBOX 743 828 PDMDevHlpISASetIrq (fdctrl->pDevIns, fdctrl->irq_lvl, 1); … … 2363 2448 * @param drv The drive in question. 2364 2449 * @param pDevIns The driver instance. 2450 * @param fInit Set if we're at init time and can change the drive type. 2365 2451 */ 2366 static int fdConfig (fdrive_t *drv, PPDMDEVINS pDevIns)2452 static int fdConfig(fdrive_t *drv, PPDMDEVINS pDevIns, bool fInit) 2367 2453 { 2368 2454 static const char * const s_apszDesc[] = {"Floppy Drive A:", "Floppy Drive B"}; … … 2388 2474 drv->pDrvMount = PDMIBASE_QUERY_INTERFACE(drv->pDrvBase, PDMIMOUNT); 2389 2475 if (drv->pDrvMount) { 2390 fd_init(drv );2476 fd_init(drv, fInit); 2391 2477 } else { 2392 2478 AssertMsgFailed (("Configuration error: LUN#%d without mountable interface!\n", drv->iLUN)); … … 2467 2553 AssertRelease (!drv->pDrvMount); 2468 2554 2469 rc = fdConfig (drv, pDevIns );2555 rc = fdConfig (drv, pDevIns, false /*fInit*/); 2470 2556 AssertMsg (rc != VERR_PDM_NO_ATTACHED_DRIVER, 2471 2557 ("Configuration error: failed to configure drive %d, rc=%Rrc\n", rc)); … … 2670 2756 { 2671 2757 fdrive_t *pDrv = &pThis->drives[i]; 2672 rc = fdConfig(pDrv, pDevIns );2758 rc = fdConfig(pDrv, pDevIns, true /*fInit*/); 2673 2759 if ( RT_FAILURE(rc) 2674 2760 && rc != VERR_PDM_NO_ATTACHED_DRIVER) -
trunk/src/VBox/Devices/Storage/DrvBlock.cpp
r44528 r47036 775 775 } 776 776 777 777 778 /** 778 779 * Reset notification. … … 787 788 pThis->fLocked = false; 788 789 } 790 791 792 /** 793 * Translates a PDMBLOCKTYPE value into a string. 794 * 795 * @returns Read only string. 796 * @param enmType The type value. 797 */ 798 static const char *drvblockGetTypeName(PDMBLOCKTYPE enmType) 799 { 800 switch (enmType) 801 { 802 case PDMBLOCKTYPE_ERROR: return "ERROR"; 803 case PDMBLOCKTYPE_FLOPPY_360: return "FLOPPY_360"; 804 case PDMBLOCKTYPE_FLOPPY_720: return "FLOPPY_720"; 805 case PDMBLOCKTYPE_FLOPPY_1_20: return "FLOPPY_1_20"; 806 case PDMBLOCKTYPE_FLOPPY_1_44: return "FLOPPY_1_44"; 807 case PDMBLOCKTYPE_FLOPPY_2_88: return "FLOPPY_2_88"; 808 case PDMBLOCKTYPE_FLOPPY_FAKE_15_6: return "FLOPPY_FAKE_15_6"; 809 case PDMBLOCKTYPE_FLOPPY_FAKE_63_5: return "FLOPPY_FAKE_63_5"; 810 case PDMBLOCKTYPE_CDROM: return "CDROM"; 811 case PDMBLOCKTYPE_DVD: return "DVD"; 812 case PDMBLOCKTYPE_HARD_DISK: return "HARD_DISK"; 813 default: return "Unknown"; 814 815 } 816 } 817 789 818 790 819 /** … … 890 919 else if (!strcmp(psz, "Floppy 360")) 891 920 pThis->enmType = PDMBLOCKTYPE_FLOPPY_360; 921 else if (!strcmp(psz, "Floppy 15.6")) 922 pThis->enmType = PDMBLOCKTYPE_FLOPPY_FAKE_15_6; 923 else if (!strcmp(psz, "Floppy 63.5")) 924 pThis->enmType = PDMBLOCKTYPE_FLOPPY_FAKE_63_5; 892 925 else 893 926 { … … 1008 1041 if (pThis->enmType == PDMBLOCKTYPE_HARD_DISK) 1009 1042 pThis->pDrvMedia->pfnGetUuid(pThis->pDrvMedia, &pThis->Uuid); 1043 } 1044 1045 /* 1046 * Automatically upgrade the floppy drive if the specified one is too 1047 * small to represent the whole boot time image. (We cannot do this later 1048 * since the BIOS (and others) gets the info via CMOS.) 1049 * 1050 * This trick should make 2.88 images as well as the fake 15.6 and 63.5 MB 1051 * images despite the hardcoded default 1.44 drive. 1052 */ 1053 if ( PDMBLOCKTYPE_IS_FLOPPY(pThis->enmType) 1054 && pThis->pDrvMedia) 1055 { 1056 uint64_t const cbFloppyImg = pThis->pDrvMedia->pfnGetSize(pThis->pDrvMedia); 1057 PDMBLOCKTYPE const enmCfgType = pThis->enmType; 1058 switch (enmCfgType) 1059 { 1060 default: 1061 AssertFailed(); 1062 case PDMBLOCKTYPE_FLOPPY_360: 1063 if (cbFloppyImg > 40 * 2 * 9 * 512) 1064 pThis->enmType = PDMBLOCKTYPE_FLOPPY_360; 1065 /* fall thru */ 1066 case PDMBLOCKTYPE_FLOPPY_720: 1067 if (cbFloppyImg > 80 * 2 * 14 * 512) 1068 pThis->enmType = PDMBLOCKTYPE_FLOPPY_1_20; 1069 /* fall thru */ 1070 case PDMBLOCKTYPE_FLOPPY_1_20: 1071 if (cbFloppyImg > 80 * 2 * 20 * 512) 1072 pThis->enmType = PDMBLOCKTYPE_FLOPPY_1_44; 1073 /* fall thru */ 1074 case PDMBLOCKTYPE_FLOPPY_1_44: 1075 if (cbFloppyImg > 80 * 2 * 24 * 512) 1076 pThis->enmType = PDMBLOCKTYPE_FLOPPY_2_88; 1077 /* fall thru */ 1078 case PDMBLOCKTYPE_FLOPPY_2_88: 1079 if (cbFloppyImg > 80 * 2 * 48 * 512) 1080 pThis->enmType = PDMBLOCKTYPE_FLOPPY_FAKE_15_6; 1081 /* fall thru */ 1082 case PDMBLOCKTYPE_FLOPPY_FAKE_15_6: 1083 if (cbFloppyImg > 255 * 2 * 63 * 512) 1084 pThis->enmType = PDMBLOCKTYPE_FLOPPY_FAKE_63_5; 1085 case PDMBLOCKTYPE_FLOPPY_FAKE_63_5: 1086 if (cbFloppyImg > 255 * 2 * 255 * 512) 1087 LogRel(("Warning: Floppy image is larger that 63.5 MB! (%llu bytes)\n", cbFloppyImg)); 1088 break; 1089 } 1090 if (pThis->enmType != enmCfgType) 1091 LogRel(("Automatically upgraded floppy drive from %s to %s to better support the %u byte image\n", 1092 drvblockGetTypeName(enmCfgType), drvblockGetTypeName(pThis->enmType), cbFloppyImg)); 1010 1093 } 1011 1094 -
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r46625 r47036 2080 2080 case PDMBLOCKTYPE_FLOPPY_1_44: 2081 2081 case PDMBLOCKTYPE_FLOPPY_2_88: 2082 case PDMBLOCKTYPE_FLOPPY_FAKE_15_6: 2083 case PDMBLOCKTYPE_FLOPPY_FAKE_63_5: 2082 2084 if (uDriveType != DRIVE_REMOVABLE) 2083 2085 {
Note:
See TracChangeset
for help on using the changeset viewer.