VirtualBox

Changeset 38220 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Jul 28, 2011 2:09:57 PM (13 years ago)
Author:
vboxsync
Message:

DevPcBios: Checksum basic CMOS data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r37917 r38220  
    5050 * @verbatim
    5151  First CMOS bank (offsets 0x00 to 0x7f):
     52    Floppy drive type:
     53         0x10
     54    Hard disk type (old):
     55         0x12
     56    Equipment byte:
     57         0x14
    5258    Base memory:
    5359         0x15
     
    5864         0x30
    5965         0x31
     66    First IDE HDD:
     67         0x19
     68         0x1e - 0x25
     69    Second IDE HDD:
     70         0x1a
     71         0x26 - 0x2d
     72    Checksum of 0x10-0x2d:
     73         0x2e
     74         0x2f
    6075    Amount of memory above 16M and below 4GB in 64KB units:
    6176         0x34
    6277         0x35
    63     Boot device (BOCHS bios specific):
    64          0x3d
     78    Boot device (BOCHS BIOS specific):
    6579         0x38
    6680         0x3c
     81         0x3d
    6782    PXE debug:
    6883         0x3f
    69     Floppy drive type:
    70          0x10
    71     Equipment byte:
    72          0x14
    73     First HDD:
    74          0x19
    75          0x1e - 0x25
    76     Second HDD:
    77          0x1a
    78          0x26 - 0x2d
    79     Third HDD:
    80          0x67 - 0x6e
    81     Fourth HDD:
    82          0x70 - 0x77
    83     Extended:
    84          0x12
    85     First Sata HDD:
     84    First SATA HDD:
    8685         0x40 - 0x47
    87     Second Sata HDD:
     86    Second SATA HDD:
    8887         0x48 - 0x4f
    89     Third Sata HDD:
     88    Third SATA HDD:
    9089         0x50 - 0x57
    91     Fourth Sata HDD:
     90    Fourth SATA HDD:
    9291         0x58 - 0x5f
    9392    Number of CPUs:
     
    9594    RAM above 4G in 64KB units:
    9695         0x61 - 0x65
     96    Third IDE HDD:
     97         0x67 - 0x6e
     98    Fourth IDE HDD:
     99         0x70 - 0x77
    97100
    98101  Second CMOS bank (offsets 0x80 to 0xff):
     
    238241}
    239242
     243/**
     244 * Read from CMOS memory.
     245 * This is used by the init complete code.
     246 */
     247static uint8_t pcbiosCmosRead(PPDMDEVINS pDevIns, int off)
     248{
     249    uint8_t     u8val;
     250
     251    Assert(off < 256);
     252
     253    int rc = PDMDevHlpCMOSRead(pDevIns, off, &u8val);
     254    AssertRC(rc);
     255
     256    return u8val;
     257}
     258
    240259/* -=-=-=-=-=-=- based on code from pc.c -=-=-=-=-=-=- */
    241260
     
    631650        }
    632651    }
     652
     653    /* Calculate and store AT-style CMOS checksum. */
     654    uint16_t    cksum = 0;
     655    for (i = 0x10; i < 0x2e; ++i)
     656        cksum += pcbiosCmosRead(pDevIns, i);
     657    pcbiosCmosWrite(pDevIns, 0x2e, cksum >> 8);
     658    pcbiosCmosWrite(pDevIns, 0x2f, cksum & 0xff);
    633659
    634660    LogFlow(("%s: returns VINF_SUCCESS\n", __FUNCTION__));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette