Changeset 92290 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Nov 9, 2021 12:49:35 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148136
- Location:
- trunk/src/VBox/Devices/PC/BIOS
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/ahci.c
r89364 r92290 751 751 if (idxCmosChsBase && inb_cmos(idxCmosChsBase+7)) 752 752 { 753 lgeo.cylinders = inb_cmos(idxCmosChsBase + 0) + (inb_cmos(idxCmosChsBase + 1) << 8);753 lgeo.cylinders = get_cmos_word(idxCmosChsBase /*, idxCmosChsBase+1*/); 754 754 lgeo.heads = inb_cmos(idxCmosChsBase + 2); 755 755 lgeo.spt = inb_cmos(idxCmosChsBase + 7); -
trunk/src/VBox/Devices/PC/BIOS/ata.c
r89364 r92290 588 588 if (chsgeo_base) 589 589 { 590 lgeo.cylinders = inb_cmos(chsgeo_base) + (inb_cmos(chsgeo_base + 1) << 8);590 lgeo.cylinders = get_cmos_word(chsgeo_base /*, chsgeo_base + 1*/); 591 591 lgeo.heads = inb_cmos(chsgeo_base + 2); 592 592 lgeo.spt = inb_cmos(chsgeo_base + 7); -
trunk/src/VBox/Devices/PC/BIOS/bios.c
r84752 r92290 82 82 outb(cmos_port, cmos_reg); 83 83 outb(cmos_port + 1, val); 84 } 85 86 /** 87 * Reads two adjacent cmos bytes and return their values as a 16-bit word. 88 */ 89 uint16_t get_cmos_word(uint8_t idxFirst) 90 { 91 return ((uint16_t)inb_cmos(idxFirst + 1) << 8) 92 | inb_cmos(idxFirst); 84 93 } 85 94 -
trunk/src/VBox/Devices/PC/BIOS/biosint.h
r84752 r92290 268 268 extern uint8_t inb_cmos(uint8_t cmos_reg); 269 269 extern void outb_cmos(uint8_t cmos_reg, uint8_t val); 270 extern uint16_t get_cmos_word(uint8_t idxFirst); 270 271 extern uint16_t cdrom_boot(void); 271 272 extern void show_logo(void); -
trunk/src/VBox/Devices/PC/BIOS/scsi.c
r89364 r92290 387 387 { 388 388 /* If provided, grab the logical geometry from CMOS. */ 389 cylinders = inb_cmos(cmos_base + 0) + (inb_cmos(cmos_base + 1) << 8);389 cylinders = get_cmos_word(cmos_base /*, cmos_base + 1*/); 390 390 heads = inb_cmos(cmos_base + 2); 391 391 sectors_per_track = inb_cmos(cmos_base + 7); -
trunk/src/VBox/Devices/PC/BIOS/system.c
r92288 r92290 468 468 // Get the amount of extended memory (above 1M) 469 469 #if VBOX_BIOS_CPU >= 80286 470 AX = (inb_cmos(0x31) << 8) | inb_cmos(0x30);470 AX = get_cmos_word(0x30 /*, 0x31*/); 471 471 472 472 #if VBOX_BIOS_CPU >= 80386 … … 613 613 fpRange->xlen = c64k_above_4G_high; 614 614 fpRange->type = 1; /* type is usable */ 615 }616 617 /**618 * Reads two adjacent cmos bytes and return their values as a 16-bit word.619 */620 static uint16_t get_cmos_word(uint8_t idxFirst)621 {622 return ((uint16_t)inb_cmos(idxFirst + 1) << 8)623 | inb_cmos(idxFirst);624 615 } 625 616 … … 655 646 656 647 /* Go for the amount of memory above 16MB first. */ 657 extended_memory_size = get_cmos_word(0x34 /* +0x35*/);648 extended_memory_size = get_cmos_word(0x34 /*, 0x35*/); 658 649 if (extended_memory_size > 0) 659 650 { … … 664 655 { 665 656 /* No memory above 16MB, query memory above 1MB ASSUMING we have at least 1MB. */ 666 extended_memory_size = get_cmos_word(0x30 /* +0x31*/);657 extended_memory_size = get_cmos_word(0x30 /*, 0x31*/); 667 658 extended_memory_size += _1M / _1K; 668 659 extended_memory_size *= _1K; … … 671 662 /* This is the amount of memory above 4GB measured in 64KB units. 672 663 Note! 0x65 can be used when we need to go beyond 255 TiB */ 673 c64k_above_4G_low = get_cmos_word(0x61 /* +0x62*/);674 c64k_above_4G_high = get_cmos_word(0x63 /* +0x64*/);664 c64k_above_4G_low = get_cmos_word(0x61 /*, 0x62*/); 665 c64k_above_4G_high = get_cmos_word(0x63 /*, 0x64*/); 675 666 676 667 #ifdef BIOS_WITH_MCFG_E820 /** @todo Actually implement the mcfg reporting. */ … … 776 767 777 768 // Get the amount of extended memory (above 1M) 778 CX = (inb_cmos(0x31) << 8) | inb_cmos(0x30);769 CX = get_cmos_word(0x30 /*, 0x31*/); 779 770 780 771 // limit to 15M … … 783 774 784 775 // Get the amount of extended memory above 16M in 64k blocks 785 DX = (inb_cmos(0x35) << 8) | inb_cmos(0x34);776 DX = get_cmos_word(0x34 /*, 0x35*/); 786 777 787 778 // Set configured memory equal to extended memory
Note:
See TracChangeset
for help on using the changeset viewer.