Changeset 48947 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Oct 7, 2013 9:41:00 PM (11 years ago)
- Location:
- trunk/src/VBox/Devices/PC
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/bios.c
r44528 r48947 100 100 // interrupt level. 101 101 uint8_t isrA, isrB, imr, last_int = 0xFF; 102 102 103 103 outb(PIC_MASTER, PIC_CMD_RD_ISR); // Read master ISR 104 104 isrA = inb(PIC_MASTER); … … 175 175 176 176 /* Avoid using preprocessing directives within macro arguments. */ 177 bios_conf = 177 bios_conf = 178 178 #ifdef __WATCOMC__ 179 179 "watcom " -
trunk/src/VBox/Devices/PC/BIOS/eltorito.c
r45791 r48947 135 135 // --------------------------------------------------------------------------- 136 136 137 // !! TODO !! convert EBDA accesses to far pointers 137 // !! TODO !! convert EBDA accesses to far pointers 138 138 139 139 extern int diskette_param_table; … … 144 144 // @TODO: a macro or a function for getting the EBDA segment 145 145 uint16_t ebda_seg = read_word(0x0040,0x000E); 146 146 147 147 // the only important data is this one for now 148 148 write_byte(ebda_seg,(uint16_t)&EbdaData->cdemu.active, 0x00); … … 153 153 // @TODO: a macro or a function for getting the EBDA segment 154 154 uint16_t ebda_seg = read_word(0x0040,0x000E); 155 155 156 156 return read_byte(ebda_seg,(uint16_t)&EbdaData->cdemu.active); 157 157 } … … 161 161 // @TODO: a macro or a function for getting the EBDA segment 162 162 uint16_t ebda_seg = read_word(0x0040,0x000E); 163 163 164 164 return read_byte(ebda_seg,(uint16_t)&EbdaData->cdemu.emulated_drive); 165 165 } … … 177 177 cdemu = ebda_seg :> &EbdaData->cdemu; 178 178 179 179 180 180 BX_DEBUG_INT13_ET("%s: AX=%04x BX=%04x CX=%04x DX=%04x ES=%04x\n", __func__, AX, BX, CX, DX, ES); 181 181 // BX_DEBUG_INT13_ET("%s: SS=%04x DS=%04x ES=%04x DI=%04x SI=%04x\n", __func__, get_SS(), DS, ES, DI, SI); 182 182 183 183 switch (GET_AH()) { 184 184 … … 206 206 write_byte(DS,SI+0x11,cdemu->vdevice.spt); 207 207 write_byte(DS,SI+0x12,cdemu->vdevice.heads); 208 208 209 209 // If we have to terminate emulation 210 210 if(GET_AL() == 0x00) { … … 244 244 { 245 245 bio_dsk_t __far *bios_dsk; 246 246 247 247 bios_dsk = read_word(0x0040, 0x000E) :> &EbdaData->bdisk; 248 248 249 249 if (device >= BX_MAX_STORAGE_DEVICES) 250 250 return 0; 251 251 252 252 // if (bios_dsk->devices[device].type != DSK_TYPE_ATAPI) 253 253 // return 0; 254 254 255 255 if (bios_dsk->devices[device].device != DSK_DEVICE_CDROM) 256 256 return 0; 257 257 258 258 return 1; 259 259 } … … 390 390 cdemu->ilba = lba; 391 391 392 BX_DEBUG_ELTORITO("Emulate drive %02x, type %02x, LBA %lu\n", 392 BX_DEBUG_ELTORITO("Emulate drive %02x, type %02x, LBA %lu\n", 393 393 cdemu->emulated_drive, cdemu->media, cdemu->ilba); 394 394 … … 410 410 return 13; 411 411 412 BX_DEBUG_ELTORITO("Emulate drive %02x, type %02x, LBA %lu\n", 412 BX_DEBUG_ELTORITO("Emulate drive %02x, type %02x, LBA %lu\n", 413 413 cdemu->emulated_drive, cdemu->media, cdemu->ilba); 414 414 /* Set up emulated drive geometry based on the media type. */ … … 481 481 482 482 /* at this point, we are emulating a floppy/harddisk */ 483 483 484 484 // Recompute the device number 485 485 device = cdemu->controller_index * 2; 486 486 device += cdemu->device_spec; 487 487 488 488 SET_DISK_RET_STATUS(0x00); 489 489 490 490 /* basic checks : emulation should be active, dl should equal the emulated drive */ 491 491 if (!cdemu->active || (cdemu->emulated_drive != GET_DL())) { … … 493 493 goto int13_fail; 494 494 } 495 495 496 496 switch (GET_AH()) { 497 497 … … 525 525 SET_AH(status); 526 526 SET_DISK_RET_STATUS(0); 527 527 528 528 /* set CF if error status read */ 529 529 if (status) … … 539 539 vheads = cdemu->vdevice.heads; 540 540 ilba = cdemu->ilba; 541 541 542 542 sector = GET_CL() & 0x003f; 543 543 cylinder = (GET_CL() & 0x00c0) << 2 | GET_CH(); … … 553 553 if(nbsectors==0) 554 554 goto int13_success; 555 555 556 556 // sanity checks sco openserver needs this! 557 557 if ((sector > vspt) … … 560 560 goto int13_fail; 561 561 } 562 562 563 563 // After validating the input, verify does nothing 564 564 if (GET_AH() == 0x04) 565 565 goto int13_success; 566 566 567 567 segment = ES+(BX / 16); 568 568 offset = BX % 16; 569 569 570 570 // calculate the virtual lba inside the image 571 571 vlba=((((uint32_t)cylinder*(uint32_t)vheads)+(uint32_t)head)*(uint32_t)vspt)+((uint32_t)(sector-1)); 572 572 573 573 // In advance so we don't lose the count 574 574 SET_AL(nbsectors); 575 575 576 576 // start lba on cd 577 577 slba = (uint32_t)vlba / 4; 578 578 before = (uint32_t)vlba % 4; 579 579 580 580 // end lba on cd 581 581 elba = (uint32_t)(vlba + nbsectors - 1) / 4; … … 603 603 goto int13_fail_noah; 604 604 } 605 605 606 606 goto int13_success; 607 607 break; … … 611 611 vcylinders = cdemu->vdevice.cylinders - 1; 612 612 vheads = cdemu->vdevice.heads - 1; 613 613 614 614 SET_AL( 0x00 ); 615 615 SET_BL( 0x00 ); … … 694 694 695 695 bios_dsk = ebda_seg :> &EbdaData->bdisk; 696 696 697 697 BX_DEBUG_INT13_CD("%s: AX=%04x BX=%04x CX=%04x DX=%04x ES=%04x\n", __func__, AX, BX, CX, DX, ES); 698 698 699 699 SET_DISK_RET_STATUS(0x00); 700 700 701 701 /* basic check : device should be 0xE0+ */ 702 702 if( (GET_ELDL() < 0xE0) || (GET_ELDL() >= 0xE0 + BX_MAX_STORAGE_DEVICES) ) { … … 704 704 goto int13_fail; 705 705 } 706 706 707 707 // Get the ata channel 708 708 device = bios_dsk->cdidmap[GET_ELDL()-0xE0]; 709 709 710 710 /* basic check : device has to be valid */ 711 711 if (device >= BX_MAX_STORAGE_DEVICES) { -
trunk/src/VBox/Devices/PC/BIOS/floppy.c
r48069 r48947 125 125 { 126 126 uint8_t val8; 127 127 128 128 // Reset controller 129 129 val8 = inb(0x03f2); 130 130 outb(0x03f2, val8 & ~0x04); 131 131 outb(0x03f2, val8 | 0x04); 132 132 133 133 // Wait for controller to come out of reset 134 134 do { … … 140 140 { 141 141 uint8_t val8, dor, prev_reset; 142 142 143 143 // set 40:3e bit 7 to 0 144 144 val8 = read_byte(0x0040, 0x003e); 145 145 val8 &= 0x7f; 146 146 write_byte(0x0040, 0x003e, val8); 147 147 148 148 // turn on motor of selected drive, DMA & int enabled, normal operation 149 149 prev_reset = inb(0x03f2) & 0x04; … … 155 155 dor |= drive; 156 156 outb(0x03f2, dor); 157 157 158 158 // reset the disk motor timeout value of INT 08 159 159 write_byte(0x0040,0x0040, BX_FLOPPY_ON_CNT); 160 160 161 161 // program data rate 162 162 val8 = read_byte(0x0040, 0x008b); 163 163 val8 >>= 6; 164 164 outb(0x03f7, val8); 165 165 166 166 // wait for drive readiness 167 167 do { 168 168 val8 = inb(0x3f4); 169 169 } while ( (val8 & 0xc0) != 0x80 ); 170 170 171 171 if (prev_reset == 0) { 172 172 #ifdef VBOX_WITH_FLOPPY_IRQ_POLLING … … 190 190 uint8_t val8; 191 191 uint16_t media_state_offset; 192 192 193 193 val8 = read_byte(0x0040, 0x003e); // diskette recal status 194 194 if (drive) … … 197 197 if (val8 == 0) 198 198 return 0; 199 199 200 200 media_state_offset = 0x0090; 201 201 if (drive) 202 202 media_state_offset += 1; 203 203 204 204 val8 = read_byte(0x0040, media_state_offset); 205 205 val8 = (val8 >> 4) & 0x01; 206 206 if (val8 == 0) 207 207 return 0; 208 208 209 209 // checks passed, return KNOWN 210 210 return 1; … … 218 218 uint8_t return_status[7]; 219 219 int i; 220 220 221 221 floppy_prepare_controller(drive); 222 222 223 223 // send Read ID command (2 bytes) to controller 224 224 outb(0x03f5, 0x4a); // 4a: Read ID (MFM) 225 225 outb(0x03f5, drive); // 0=drive0, 1=drive1, head always 0 226 226 227 227 #ifdef VBOX_WITH_FLOPPY_IRQ_POLLING 228 228 // turn on interrupts 229 229 int_enable(); 230 230 231 231 // wait on 40:3e bit 7 to become 1 232 232 do { 233 233 val8 = (read_byte(0x0040, 0x003e) & 0x80); 234 234 } while ( val8 == 0 ); 235 235 236 236 val8 = 0; // separate asm from while() loop 237 237 // turn off interrupts … … 240 240 floppy_wait_for_interrupt(); 241 241 #endif 242 242 243 243 // read 7 return status bytes from controller 244 244 for (i = 0; i < 7; ++i) { 245 245 return_status[i] = inb(0x3f5); 246 246 } 247 247 248 248 if ( (return_status[0] & 0xc0) != 0 ) 249 249 return 0; … … 256 256 uint8_t val8; 257 257 uint16_t curr_cyl_offset; 258 258 259 259 floppy_prepare_controller(drive); 260 260 261 261 // send Recalibrate command (2 bytes) to controller 262 262 outb(0x03f5, 0x07); // 07: Recalibrate 263 263 outb(0x03f5, drive); // 0=drive0, 1=drive1 264 264 265 265 #ifdef VBOX_WITH_FLOPPY_IRQ_POLLING 266 266 // turn on interrupts 267 267 int_enable(); 268 268 269 269 // wait on 40:3e bit 7 to become 1 270 270 do { 271 271 val8 = (read_byte(0x0040, 0x003e) & 0x80); 272 272 } while ( val8 == 0 ); 273 273 274 274 val8 = 0; // separate asm from while() loop 275 275 // turn off interrupts … … 293 293 write_byte(0x0040, 0x003e, val8); 294 294 write_byte(0x0040, curr_cyl_offset, 0); // current cylinder is 0 295 295 296 296 return 1; 297 297 } … … 303 303 uint16_t media_state_offset; 304 304 uint8_t drive_type, config_data, media_state; 305 305 306 306 if (floppy_drive_recal(drive) == 0) 307 307 return 0; 308 308 309 309 // Try the diskette data rates in the following order: 310 310 // 1 Mbps -> 500 Kbps -> 300 Kbps -> 250 Kbps 311 311 // The 1 Mbps rate is only tried for 2.88M drives. 312 312 313 313 // ** config_data ** 314 314 // Bitfields for diskette media control: … … 320 320 // 3-2 {data rate at start of operation} 321 321 // 1-0 reserved 322 322 323 323 // ** media_state ** 324 324 // Bitfields for diskette drive media state: … … 388 388 retval = 0; 389 389 } 390 390 391 391 write_byte(0x0040, 0x008B, config_data); 392 392 while (!floppy_read_id(drive)) { … … 408 408 write_byte(0x0040, 0x008B, config_data); 409 409 } 410 410 411 411 if (drive == 0) 412 412 media_state_offset = 0x0090; … … 415 415 write_byte(0x0040, 0x008B, config_data); 416 416 write_byte(0x0040, media_state_offset, media_state); 417 417 418 418 return retval; 419 419 } … … 423 423 { 424 424 uint8_t drive_type; 425 425 426 426 // check CMOS to see if drive exists 427 427 // @todo: break out drive type determination … … 456 456 uint16_t last_addr; 457 457 int i; 458 458 459 459 BX_DEBUG_INT13_FL("%s: AX=%04x BX=%04x CX=%04x DX=%04x ES=%04x\n", __func__, AX, BX, CX, DX, ES); 460 460 461 461 ah = GET_AH(); 462 462 463 463 switch ( ah ) { 464 464 case 0x00: // diskette controller reset … … 483 483 return; 484 484 } 485 485 486 486 // force re-calibration etc. 487 487 write_byte(0x0040, 0x003e, 0); 488 488 489 489 SET_AH(0); 490 490 set_diskette_ret_status(0); … … 492 492 set_diskette_current_cyl(drive, 0); // current cylinder 493 493 return; 494 494 495 495 case 0x01: // Read Diskette Status 496 496 CLEAR_CF(); … … 501 501 } 502 502 return; 503 503 504 504 case 0x02: // Read Diskette Sectors 505 505 case 0x03: // Write Diskette Sectors … … 510 510 head = GET_DH(); 511 511 drive = GET_ELDL(); 512 512 513 513 if ( (drive > 1) || (head > 1) || 514 514 (num_sectors == 0) || (num_sectors > 72) ) { … … 520 520 return; 521 521 } 522 522 523 523 // see if drive exists 524 524 if (floppy_drive_exists(drive) == 0) { … … 529 529 return; 530 530 } 531 531 532 532 // see if media in drive, and type is known 533 533 if (floppy_media_known(drive) == 0) { … … 540 540 } 541 541 } 542 542 543 543 if (ah == 0x02) { 544 544 // Read Diskette Sectors 545 545 546 546 //----------------------------------- 547 547 // set up DMA controller for transfer 548 548 //----------------------------------- 549 549 550 550 // es:bx = pointer to where to place information from diskette 551 551 // port 04: DMA-1 base and current address, channel 2 … … 561 561 } 562 562 base_count = (num_sectors * 512) - 1; 563 563 564 564 // check for 64K boundary overrun 565 565 last_addr = base_address + base_count; … … 571 571 return; 572 572 } 573 573 574 574 BX_DEBUG_INT13_FL("masking DMA-1 c2\n"); 575 575 outb(0x000a, 0x06); 576 576 577 577 BX_DEBUG_INT13_FL("clear flip-flop\n"); 578 578 outb(0x000c, 0x00); // clear flip-flop … … 584 584 outb(0x0005, base_count>>8); 585 585 BX_DEBUG_INT13_FL("xfer buf at %x:%x\n", page, base_address); 586 586 587 587 // port 0b: DMA-1 Mode Register 588 588 mode_register = 0x46; // single mode, increment, autoinit disable, … … 590 590 BX_DEBUG_INT13_FL("setting mode register\n"); 591 591 outb(0x000b, mode_register); 592 592 593 593 BX_DEBUG_INT13_FL("setting page register\n"); 594 594 // port 81: DMA-1 Page Register, channel 2 595 595 outb(0x0081, page); 596 596 597 597 BX_DEBUG_INT13_FL("unmask chan 2\n"); 598 598 outb(0x000a, 0x02); // unmask channel 2 599 599 600 600 BX_DEBUG_INT13_FL("unmasking DMA-1 c2\n"); 601 601 outb(0x000a, 0x02); 602 602 603 603 //-------------------------------------- 604 604 // set up floppy controller for transfer 605 605 //-------------------------------------- 606 606 floppy_prepare_controller(drive); 607 607 608 608 // send read-normal-data command (9 bytes) to controller 609 609 outb(0x03f5, 0xe6); // e6: read normal data … … 616 616 outb(0x03f5, 0); // Gap length 617 617 outb(0x03f5, 0xff); // Gap length 618 618 619 619 #ifdef VBOX_WITH_FLOPPY_IRQ_POLLING 620 620 // turn on interrupts 621 621 int_enable(); 622 622 623 623 // wait on 40:3e bit 7 to become 1 or timeout (latter isn't armed so it won't happen) 624 624 do { … … 634 634 val8 = (read_byte(0x0040, 0x003e) & 0x80); 635 635 } while ( val8 == 0 ); 636 636 637 637 val8 = 0; // separate asm from while() loop 638 638 // turn off interrupts … … 655 655 } 656 656 #endif 657 657 658 658 // check port 3f4 for accessibility to status bytes 659 659 val8 = inb(0x3f4); … … 666 666 write_byte(0x0040, 0x0042 + i, return_status[i]); 667 667 } 668 668 669 669 if ( (return_status[0] & 0xc0) != 0 ) { 670 670 SET_AH(0x20); … … 686 686 } else if (ah == 0x03) { 687 687 // Write Diskette Sectors 688 688 689 689 //----------------------------------- 690 690 // set up DMA controller for transfer 691 691 //----------------------------------- 692 692 693 693 // es:bx = pointer to where to place information from diskette 694 694 // port 04: DMA-1 base and current address, channel 2 … … 704 704 } 705 705 base_count = (num_sectors * 512) - 1; 706 706 707 707 // check for 64K boundary overrun 708 708 last_addr = base_address + base_count; … … 714 714 return; 715 715 } 716 716 717 717 BX_DEBUG_INT13_FL("masking DMA-1 c2\n"); 718 718 outb(0x000a, 0x06); 719 719 720 720 outb(0x000c, 0x00); // clear flip-flop 721 721 outb(0x0004, base_address); … … 725 725 outb(0x0005, base_count>>8); 726 726 BX_DEBUG_INT13_FL("xfer buf at %x:%x\n", page, base_address); 727 727 728 728 // port 0b: DMA-1 Mode Register 729 729 mode_register = 0x4a; // single mode, increment, autoinit disable, 730 730 // transfer type=read, channel 2 731 731 outb(0x000b, mode_register); 732 732 733 733 // port 81: DMA-1 Page Register, channel 2 734 734 outb(0x0081, page); 735 735 736 736 BX_DEBUG_INT13_FL("unmasking DMA-1 c2\n"); 737 737 outb(0x000a, 0x02); 738 738 739 739 //-------------------------------------- 740 740 // set up floppy controller for transfer 741 741 //-------------------------------------- 742 742 floppy_prepare_controller(drive); 743 743 744 744 // send write-normal-data command (9 bytes) to controller 745 745 outb(0x03f5, 0xc5); // c5: write normal data … … 752 752 outb(0x03f5, 0); // Gap length 753 753 outb(0x03f5, 0xff); // Gap length 754 754 755 755 #ifdef VBOX_WITH_FLOPPY_IRQ_POLLING 756 756 // turn on interrupts 757 757 int_enable(); 758 758 759 759 // wait on 40:3e bit 7 to become 1 760 760 do { … … 770 770 val8 = (read_byte(0x0040, 0x003e) & 0x80); 771 771 } while ( val8 == 0 ); 772 772 773 773 val8 = 0; // separate asm from while() loop @todo: why?? 774 774 // turn off interrupts … … 790 790 } 791 791 #endif 792 792 793 793 // check port 3f4 for accessibility to status bytes 794 794 val8 = inb(0x3f4); 795 795 if ( (val8 & 0xc0) != 0xc0 ) 796 796 BX_PANIC("%s: ctrl not ready\n", __func__); 797 797 798 798 // read 7 return status bytes from controller and store in BDA 799 799 for (i = 0; i < 7; ++i) { … … 801 801 write_byte(0x0040, 0x0042 + i, return_status[i]); 802 802 } 803 803 804 804 if ( (return_status[0] & 0xc0) != 0 ) { 805 805 if ( (return_status[1] & 0x02) != 0 ) { … … 815 815 return; 816 816 } 817 817 818 818 // ??? should track be new val from return_status[3] ? 819 819 set_diskette_current_cyl(drive, track); … … 824 824 } else { // if (ah == 0x04) 825 825 // Verify Diskette Sectors 826 826 827 827 // ??? should track be new val from return_status[3] ? 828 828 set_diskette_current_cyl(drive, track); … … 833 833 } 834 834 break; 835 835 836 836 case 0x05: // format diskette track 837 837 BX_DEBUG_INT13_FL("floppy f05\n"); 838 838 839 839 num_sectors = GET_AL(); 840 840 track = GET_CH(); 841 841 head = GET_DH(); 842 842 drive = GET_ELDL(); 843 843 844 844 if ((drive > 1) || (head > 1) || (track > 79) || 845 845 (num_sectors == 0) || (num_sectors > 18)) { … … 848 848 SET_CF(); // error occurred 849 849 } 850 850 851 851 // see if drive exists 852 852 if (floppy_drive_exists(drive) == 0) { … … 856 856 return; 857 857 } 858 858 859 859 // see if media in drive, and type is known 860 860 if (floppy_media_known(drive) == 0) { … … 867 867 } 868 868 } 869 869 870 870 // set up DMA controller for transfer 871 871 // @todo: merge/factor out pointer normalization … … 879 879 } 880 880 base_count = (num_sectors * 4) - 1; 881 881 882 882 // check for 64K boundary overrun 883 883 last_addr = base_address + base_count; … … 889 889 return; 890 890 } 891 891 892 892 outb(0x000a, 0x06); 893 893 outb(0x000c, 0x00); // clear flip-flop … … 903 903 outb(0x0081, page); 904 904 outb(0x000a, 0x02); 905 905 906 906 // set up floppy controller for transfer 907 907 floppy_prepare_controller(drive); 908 908 909 909 // send format-track command (6 bytes) to controller 910 910 outb(0x03f5, 0x4d); // 4d: format track … … 918 918 // turn on interrupts 919 919 int_enable(); 920 920 921 921 // wait on 40:3e bit 7 to become 1 922 922 do { … … 931 931 val8 = (read_byte(0x0040, 0x003e) & 0x80); 932 932 } while ( val8 == 0 ); 933 933 934 934 val8 = 0; // separate asm from while() loop 935 935 // turn off interrupts … … 955 955 if ( (val8 & 0xc0) != 0xc0 ) 956 956 BX_PANIC("%s: ctrl not ready\n", __func__); 957 957 958 958 // read 7 return status bytes from controller and store in BDA 959 959 for (i = 0; i < 7; ++i) { … … 961 961 write_byte(0x0040, 0x0042 + i, return_status[i]); 962 962 } 963 963 964 964 if ( (return_status[0] & 0xc0) != 0 ) { 965 965 if ( (return_status[1] & 0x02) != 0 ) { … … 974 974 } 975 975 } 976 976 977 977 SET_AH(0); 978 978 set_diskette_ret_status(0); … … 980 980 CLEAR_CF(); // successful 981 981 return; 982 983 982 983 984 984 case 0x08: // read diskette drive parameters 985 985 BX_DEBUG_INT13_FL("floppy f08\n"); 986 986 drive = GET_ELDL(); 987 987 988 988 if (drive > 1) { 989 989 AX = 0; … … 997 997 return; 998 998 } 999 999 1000 1000 // @todo: break out drive type determination 1001 1001 drive_type = inb_cmos(0x10); … … 1005 1005 if (drive_type & 0x0f) 1006 1006 num_floppies++; 1007 1007 1008 1008 if (drive == 0) 1009 1009 drive_type >>= 4; 1010 1010 else 1011 1011 drive_type &= 0x0f; 1012 1012 1013 1013 SET_BH(0); 1014 1014 SET_BL(drive_type); … … 1017 1017 SET_DL(num_floppies); 1018 1018 SET_DH(1); // max head # 1019 1019 1020 1020 switch (drive_type) { 1021 1021 case 0: // none … … 1023 1023 SET_DH(0); // max head # 1024 1024 break; 1025 1025 1026 1026 case 1: // 360KB, 5.25" 1027 1027 CX = 0x2709; // 40 tracks, 9 sectors 1028 1028 break; 1029 1029 1030 1030 case 2: // 1.2MB, 5.25" 1031 1031 CX = 0x4f0f; // 80 tracks, 15 sectors 1032 1032 break; 1033 1033 1034 1034 case 3: // 720KB, 3.5" 1035 1035 CX = 0x4f09; // 80 tracks, 9 sectors 1036 1036 break; 1037 1037 1038 1038 case 4: // 1.44MB, 3.5" 1039 1039 CX = 0x4f12; // 80 tracks, 18 sectors 1040 1040 break; 1041 1041 1042 1042 case 5: // 2.88MB, 3.5" 1043 1043 CX = 0x4f24; // 80 tracks, 36 sectors 1044 1044 break; 1045 1045 1046 1046 case 14: // 15.6 MB 3.5" (fake) 1047 1047 CX = 0xfe3f; // 255 tracks, 63 sectors … … 1056 1056 BX_PANIC("%s: bad floppy type\n", __func__); 1057 1057 } 1058 1058 1059 1059 /* set es & di to point to 11 byte diskette param table in ROM */ 1060 1060 ES = 0xF000; // @todo: any way to make this relocatable? … … 1063 1063 /* disk status not changed upon success */ 1064 1064 return; 1065 1065 1066 1066 case 0x15: // read diskette drive type 1067 1067 BX_DEBUG_INT13_FL("floppy f15\n"); … … 1087 1087 SET_AH(1); // drive present, does not support change line 1088 1088 } 1089 1089 1090 1090 return; 1091 1091 1092 1092 case 0x16: // get diskette change line status 1093 1093 BX_DEBUG_INT13_FL("floppy f16\n"); … … 1099 1099 return; 1100 1100 } 1101 1101 1102 1102 SET_AH(0x06); // change line not supported 1103 1103 set_diskette_ret_status(0x06); 1104 1104 SET_CF(); 1105 1105 return; 1106 1106 1107 1107 case 0x17: // set diskette type for format(old) 1108 1108 BX_DEBUG_INT13_FL("floppy f17\n"); … … 1112 1112 SET_CF(); 1113 1113 return; 1114 1114 1115 1115 case 0x18: // set diskette type for format(new) 1116 1116 BX_DEBUG_INT13_FL("floppy f18\n"); … … 1119 1119 SET_CF(); 1120 1120 return; 1121 1121 1122 1122 default: 1123 1123 BX_INFO("%s: unsupported AH=%02x\n", __func__, GET_AH()); 1124 1124 1125 1125 // if ( (ah==0x20) || ((ah>=0x41) && (ah<=0x49)) || (ah==0x4e) ) { 1126 1126 SET_AH(0x01); // ??? … … 1137 1137 { 1138 1138 uint8_t val8; 1139 1139 1140 1140 switch ( GET_AH() ) { 1141 1141 1142 1142 case 0x01: // Read Diskette Status 1143 1143 CLEAR_CF(); … … 1148 1148 } 1149 1149 return; 1150 1150 1151 1151 default: 1152 1152 SET_CF(); … … 1162 1162 { 1163 1163 uint8_t val8, DOR, ctrl_info; 1164 1164 1165 1165 ctrl_info = read_byte(0x0040, 0x008F); 1166 1166 if (drive==1) … … 1188 1188 if (val8 != 0x80) 1189 1189 BX_PANIC("d_f_m: MRQ bit not set\n"); 1190 1190 1191 1191 // change line 1192 1192 1193 1193 // existing BDA values 1194 1194 1195 1195 // turn on drive motor 1196 1196 outb(0x03f2, DOR); // Digital Output Register -
trunk/src/VBox/Devices/PC/BIOS/pcibios.c
r45710 r48947 80 80 * enabled during execution, and that the routines are re-entrant. 81 81 * 82 * Implementation notes: 82 * Implementation notes: 83 83 * - The PCI BIOS interface already uses certain 32-bit registers even in 84 84 * 16-bit mode. To simplify matters, all 32-bit GPRs are saved/restored and … … 232 232 BX_DEBUG_PCI("PCI: Find class %08lX index %u\n", 233 233 search_item, index); 234 } else 235 BX_DEBUG_PCI("PCI: Find device %04X:%04X index %u\n", 234 } else 235 BX_DEBUG_PCI("PCI: Find device %04X:%04X index %u\n", 236 236 (uint16_t)search_item, (uint16_t)(search_item >> 16), index); 237 237 … … 261 261 262 262 /* If the header type indicates a bus, we're interested. The secondary 263 * and subordinate bus numbers will indicate which buses are present; 264 * thus we can determine the highest bus number. In the common case, 263 * and subordinate bus numbers will indicate which buses are present; 264 * thus we can determine the highest bus number. In the common case, 265 265 * there will be only the primary bus (i.e. bus 0) and we can avoid 266 266 * looking at the remaining 255 theoretically present buses. This check … … 317 317 318 318 SET_AH(SUCCESSFUL); /* Assume success. */ 319 CLEAR_CF(); 319 CLEAR_CF(); 320 320 321 321 switch (GET_AL()) { -
trunk/src/VBox/Devices/PC/BIOS/vds.h
r42202 r48947 38 38 } u; 39 39 } vds_edds; 40 40 41 41 42 42 /* VDS services */ -
trunk/src/VBox/Devices/PC/DevACPI.cpp
-
Property svn:keywords
changed from
Id
toId Revision
-
Property svn:keywords
changed from
-
trunk/src/VBox/Devices/PC/DevAPIC.cpp
-
Property svn:keywords
changed from
Id
toId Revision
-
Property svn:keywords
changed from
-
trunk/src/VBox/Devices/PC/DevDMA.cpp
-
Property svn:keywords
changed from
Id
toId Revision
r48046 r48947 454 454 *pu32, port, DMAPG2CX(reg))); 455 455 return VINF_SUCCESS; 456 } 456 } 457 457 458 458 if (cb == 2) … … 482 482 u32, port, DMAPG2CX(reg))); 483 483 } 484 else if (cb == 2) 484 else if (cb == 2) 485 485 { 486 486 Assert(!(u32 & ~0xffff)); /* Check for garbage in high bits. */ … … 567 567 /* Set the TC (Terminal Count) bit if transfer was completed. */ 568 568 if (ch->u16CurCount == ch->u16BaseCount + 1) 569 switch (opmode) 569 switch (opmode) 570 570 { 571 571 case DMODE_DEMAND: -
Property svn:keywords
changed from
-
trunk/src/VBox/Devices/PC/DevFwCommon.cpp
r48755 r48947 811 811 pProcessorInf->u8CoreEnabled = cCpus; 812 812 pProcessorInf->u8ThreadCount = 1; 813 pProcessorInf->u16ProcessorCharacteristics 813 pProcessorInf->u16ProcessorCharacteristics 814 814 = RT_BIT(2); /* 64-bit capable */ 815 815 pProcessorInf->u16ProcessorFamily2 = 0; -
trunk/src/VBox/Devices/PC/DevHPET.cpp
r45839 r48947 1059 1059 if (u64Period) { 1060 1060 hpetAdjustComparator(pHpetTimer, u64CurTick); 1061 1061 1062 1062 u64Diff = hpetComputeDiff(pHpetTimer, u64CurTick); 1063 1063 1064 1064 Log4(("HPET: periodic: next in %llu\n", hpetTicksToNs(pThis, u64Diff))); 1065 1065 TMTimerSetNano(pTimer, hpetTicksToNs(pThis, u64Diff)); -
trunk/src/VBox/Devices/PC/DevIoApic.cpp
-
Property svn:keywords
changed from
Id
toId Revision
-
Property svn:keywords
changed from
-
trunk/src/VBox/Devices/PC/DevPIC.cpp
-
Property svn:keywords
changed from
Id
toId Revision
-
Property svn:keywords
changed from
-
trunk/src/VBox/Devices/PC/DevPcArch.cpp
-
Property svn:keywords
changed from
Id
toId Revision
-
Property svn:keywords
changed from
-
trunk/src/VBox/Devices/PC/DevPcBios.cpp
-
Property svn:keywords
changed from
Id
toId Revision
-
Property svn:keywords
changed from
-
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
-
Property svn:keywords
changed from
Id
toId Revision
-
Property svn:keywords
changed from
-
trunk/src/VBox/Devices/PC/DevRTC.cpp
-
Property svn:keywords
changed from
Id
toId Revision
-
Property svn:keywords
changed from
-
trunk/src/VBox/Devices/PC/DrvACPI.cpp
-
Property svn:keywords
changed from
Id
toId Revision
-
Property svn:keywords
changed from
Note:
See TracChangeset
for help on using the changeset viewer.