Changeset 47036 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Jul 8, 2013 12:26:47 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 87069
- Location:
- trunk/src/VBox/Devices/PC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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?) */
Note:
See TracChangeset
for help on using the changeset viewer.