Changeset 62301 in vbox for trunk/src/VBox
- Timestamp:
- Jul 18, 2016 1:41:02 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/floppy.c
r59115 r62301 122 122 #endif /* !VBOX_WITH_FLOPPY_IRQ_POLLING */ 123 123 124 void floppy_reset_controller( void)124 void floppy_reset_controller(uint16_t drive) 125 125 { 126 126 uint8_t val8; … … 135 135 val8 = inb(0x3f4); 136 136 } while ( (val8 & 0xc0) != 0x80 ); 137 138 // Mark media in drive as unknown 139 val8 = read_byte(0x0040, 0x0090 + drive); 140 val8 &= ~0x10; 141 write_byte(0x0040, 0x90 + drive, val8); 142 137 143 } 138 144 … … 523 529 // see if drive exists 524 530 if (floppy_drive_exists(drive) == 0) { 531 BX_DEBUG_INT13_FL("failed (not ready)\n"); 525 532 SET_AH(0x80); // not responding 526 533 set_diskette_ret_status(0x80); … … 533 540 if (floppy_media_known(drive) == 0) { 534 541 if (floppy_media_sense(drive) == 0) { 542 BX_DEBUG_INT13_FL("media not found\n"); 535 543 SET_AH(0x0C); // Media type not found 536 544 set_diskette_ret_status(0x0C); … … 584 592 outb(0x0005, base_count>>8); 585 593 BX_DEBUG_INT13_FL("xfer buf %x bytes at %x:%x\n", 586 base_count , page, base_address);594 base_count + 1, page, base_address); 587 595 588 596 // port 0b: DMA-1 Mode Register … … 614 622 outb(0x03f5, 0); // Gap length 615 623 outb(0x03f5, 0xff); // Gap length 624 BX_DEBUG_INT13_FL("read initiated\n"); 616 625 617 626 #ifdef VBOX_WITH_FLOPPY_IRQ_POLLING … … 623 632 val8 = read_byte(0x0040, 0x0040); 624 633 if (val8 == 0) { 625 floppy_reset_controller(); 634 BX_DEBUG_INT13_FL("failed (not ready)\n"); 635 floppy_reset_controller(drive); 626 636 SET_AH(0x80); // drive not ready (timeout) 627 637 set_diskette_ret_status(0x80); … … 645 655 val8 = floppy_wait_for_interrupt_or_timeout(); 646 656 if (val8 == 0) { /* Note! Interrupts enabled in this branch. */ 647 floppy_reset_controller(); 657 BX_DEBUG_INT13_FL("failed (not ready)\n"); 658 floppy_reset_controller(drive); 648 659 SET_AH(0x80); // drive not ready (timeout) 649 660 set_diskette_ret_status(0x80); … … 666 677 667 678 if ( (return_status[0] & 0xc0) != 0 ) { 679 BX_DEBUG_INT13_FL("failed (FDC failure)\n"); 680 floppy_reset_controller(drive); 668 681 SET_AH(0x20); 669 682 set_diskette_ret_status(0x20); … … 676 689 rep_movsw(ES :> BX, ES :> BX, num_sectors * 512 / 2); 677 690 #endif 691 BX_DEBUG_INT13_FL("success!\n"); 678 692 // ??? should track be new val from return_status[3] ? 679 693 set_diskette_current_cyl(drive, track); … … 760 774 val8 = read_byte(0x0040, 0x0040); 761 775 if (val8 == 0) { 762 floppy_reset_controller( );776 floppy_reset_controller(drive); 763 777 SET_AH(0x80); // drive not ready (timeout) 764 778 set_diskette_ret_status(0x80); … … 781 795 val8 = floppy_wait_for_interrupt_or_timeout(); 782 796 if (val8 == 0) { /* Note! Interrupts enabled in this branch. */ 783 floppy_reset_controller( );797 floppy_reset_controller(drive); 784 798 SET_AH(0x80); // drive not ready (timeout) 785 799 set_diskette_ret_status(0x80); … … 927 941 val8 = read_byte(0x0040, 0x0040); 928 942 if (val8 == 0) { 929 floppy_reset_controller( );943 floppy_reset_controller(drive); 930 944 SET_AH(0x80); // drive not ready (timeout) 931 945 set_diskette_ret_status(0x80); … … 947 961 val8 = floppy_wait_for_interrupt_or_timeout(); 948 962 if (val8 == 0) { /* Note! Interrupts enabled in this branch. */ 949 floppy_reset_controller( );963 floppy_reset_controller(drive); 950 964 SET_AH(0x80); // drive not ready (timeout) 951 965 set_diskette_ret_status(0x80);
Note:
See TracChangeset
for help on using the changeset viewer.