VirtualBox

Changeset 41580 in vbox


Ignore:
Timestamp:
Jun 5, 2012 2:26:59 PM (13 years ago)
Author:
vboxsync
Message:

PC/DevPcBios: Addition of info cmos and info cmos2 debugging commands

File:
1 edited

Legend:

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

    r41490 r41580  
    4242#define NET_BOOT_DEVS   4
    4343
     44#define CMOS_BANK_LOWER_LIMIT 0x0E
     45#define CMOS_BANK_UPPER_LIMIT 0x7F
     46#define CMOS_BANK2_LOWER_LIMIT 0x80
     47#define CMOS_BANK2_UPPER_LIMIT 0xFF
    4448
    4549/** @page pg_devbios_cmos_assign    CMOS Assignments (BIOS)
     
    257261}
    258262
     263/**
     264 * @callback_method_impl{FNDBGFHANDLERDEV,
     265 *      Dumps the cmos Bank Info.}
     266 */
     267static DECLCALLBACK(void) CMOSBankInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     268{
     269    const char *PChCMOSBank = "CMOS Bank Info 0x0E - 0x7F";
     270    uint16_t u16ByteCount = 0;
     271    uint8_t   u8CMOSByte;
     272    pHlp->pfnPrintf(pHlp, "%s\n" ,PChCMOSBank);
     273    for (u16ByteCount = CMOS_BANK_LOWER_LIMIT; u16ByteCount < CMOS_BANK_UPPER_LIMIT; u16ByteCount++)
     274    {
     275        u8CMOSByte  = pcbiosCmosRead(pDevIns, u16ByteCount);
     276        pHlp->pfnPrintf(pHlp, "Off: 0x%02x Val: 0x%02x\n",u16ByteCount, u8CMOSByte);
     277    }
     278}
     279
     280/**
     281 * @callback_method_impl{FNDBGFHANDLERDEV,
     282 *      Dumps the cmos Bank2 Info.}
     283 */
     284static DECLCALLBACK(void) CMOSBank2Info(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     285{
     286    const char *PChCMOSBank = "CMOS Bank2 Info 0x80 - 0xFF";
     287    uint16_t u16ByteCount = 0;
     288    uint8_t   u8CMOSByte;
     289    pHlp->pfnPrintf(pHlp, "%s\n" ,PChCMOSBank);
     290    for (u16ByteCount = CMOS_BANK2_LOWER_LIMIT; u16ByteCount < CMOS_BANK2_UPPER_LIMIT; u16ByteCount++)
     291    {
     292        u8CMOSByte  = pcbiosCmosRead(pDevIns, u16ByteCount);
     293        pHlp->pfnPrintf(pHlp, "Off: 0x%02x Val: 0x%02x\n",u16ByteCount, u8CMOSByte);
     294    }
     295       
     296}
    259297/* -=-=-=-=-=-=- based on code from pc.c -=-=-=-=-=-=- */
    260298
     
    14301468    if (pThis->uBootDelay > 15)
    14311469        pThis->uBootDelay = 15;
     1470     
     1471    /*
     1472     * Register debugger info callback.
     1473     */
     1474    PDMDevHlpDBGFInfoRegister(pDevIns, "cmos", "Display CMOS Bank 1 Info.. "
     1475                              "'cmos'. No argument.", CMOSBankInfo);
     1476    PDMDevHlpDBGFInfoRegister(pDevIns, "cmos2", "Display CMOS Bank 2 Info.. "
     1477                              "'cmos2'. No argument", CMOSBank2Info);
    14321478
    14331479    /*
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