Changeset 6879 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Feb 10, 2008 11:41:03 PM (17 years ago)
- Location:
- trunk/src/VBox/Devices/PC/BIOS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/logo.c
r6870 r6879 586 586 { 587 587 Bit16u ebda_seg=read_word(0x0040,0x000E); 588 Bit8u actual_device; 589 Bit8u detected_devices = 0; 588 Bit8u actual_device = 0; 590 589 Bit8u first_ctrl_printed = 0; 591 590 Bit8u second_ctrl_printed = 0; 592 593 for (actual_device = 0; actual_device < BX_MAX_ATA_DEVICES; actual_device++) 591 Bit8u device; 592 593 device = read_byte(ebda_seg, &EbdaData->ata.hdidmap[actual_device]); 594 595 while ((actual_device < BX_MAX_ATA_DEVICES) && (device < BX_MAX_ATA_DEVICES)) 594 596 { 595 597 Bit8u device_position; 596 Bit8u device = read_byte(ebda_seg, &EbdaData->ata.devices[actual_device].device); 597 598 if (device == 0xff) /* logo.c is included before ATA_DEVICE_HD is defined */ 599 { 600 if ((actual_device < 4) && (first_ctrl_printed == 0)) 601 { 602 printf("IDE controller:\n"); 603 first_ctrl_printed = 1; 604 } 605 else if ((actual_device >= 4) && (second_ctrl_printed == 0)) 606 { 607 printf("AHCI controller:\n"); 608 second_ctrl_printed = 1; 609 } 610 611 detected_devices++; 612 613 printf("\n %d) ", detected_devices); 614 615 /* If actual_device bigger than or equal 4 616 * this is the next controller and 617 * the positions start at the beginning. 618 */ 619 device_position = actual_device; 620 if (actual_device >= 4) 621 device_position -= 4; 622 623 if (device_position / 2) 624 printf("Secondary "); 625 else 626 printf("Primary "); 627 628 if (device_position % 2) 629 printf("Slave"); 630 else 631 printf("Master"); 632 } 598 599 device_position = device; 600 601 if ((device_position < 4) && (first_ctrl_printed == 0)) 602 { 603 printf("IDE controller:\n"); 604 first_ctrl_printed = 1; 605 } 606 else if ((device_position >= 4) && (second_ctrl_printed == 0)) 607 { 608 printf("\n\nAHCI controller:\n"); 609 second_ctrl_printed = 1; 610 } 611 612 printf("\n %d) ", actual_device+1); 613 614 /* 615 * If actual_device is bigger than or equal 4 616 * this is the next controller and 617 * the positions start at the beginning. 618 */ 619 if (device_position >= 4) 620 device_position -= 4; 621 622 if (device_position / 2) 623 printf("Primary "); 624 else 625 printf("Secondary "); 626 627 if (device_position % 2) 628 printf("Slave"); 629 else 630 printf("Master"); 631 632 actual_device++; 633 device = read_byte(ebda_seg, &EbdaData->ata.hdidmap[actual_device]); 633 634 } 634 635 … … 645 646 for (actual_device = 0; actual_device < BX_MAX_ATA_DEVICES; actual_device++) 646 647 { 647 Bit8u device = read_byte(ebda_seg, &EbdaData->ata.devices[actual_device].device); 648 649 if (device == 0xff) /* logo.c is included before ATA_DEVICE_HD is defined */ 650 detected_devices++; 651 } 652 653 if ((scode-0x01) <= detected_devices) 654 return scode-0x02; 648 Bit8u device = read_byte(ebda_seg, &EbdaData->ata.hdidmap[actual_device]); 649 650 if (device < BX_MAX_ATA_DEVICES) 651 { 652 scode--; 653 if (scode == 0x01) 654 return actual_device; 655 } 656 } 655 657 656 658 /* Scancode is higher than number of available devices */ -
trunk/src/VBox/Devices/PC/BIOS/rombios.c
r6870 r6879 2371 2371 sc = inb(iobase1+ATA_CB_SC); 2372 2372 sn = inb(iobase1+ATA_CB_SN); 2373 2373 2374 if ((sc==0x01) && (sn==0x01)) { 2374 2375 cl = inb(iobase1+ATA_CB_CL); … … 2452 2453 else 2453 2454 { 2455 Bit32u temp_sectors = sectors; 2456 2457 //FIXME: only valid for LBA translation 2458 lspt = 63; 2459 temp_sectors /= 63; 2460 lheads = temp_sectors / 1024; 2461 if (lheads>128) lheads = 255; 2462 else if (lheads>64) lheads = 128; 2463 else if (lheads>32) lheads = 64; 2464 else if (lheads>16) lheads = 32; 2465 else lheads=16; 2466 lcylinders = temp_sectors / lheads; 2467 2468 // clip to 1024 cylinders 2469 if (lcylinders > 1024) lcylinders=1024; 2470 2471 #if 0 2454 2472 lcylinders = 0; 2455 2473 lheads = 0; 2456 2474 lspt = 0; 2475 #endif 2457 2476 } 2458 2477 BX_INFO("ata%d-%d: PCHS=%u/%d/%d LCHS=%u/%u/%u\n", channel, slave, cylinders, heads, spt, lcylinders, lheads, lspt);
Note:
See TracChangeset
for help on using the changeset viewer.