Changeset 41582 in vbox
- Timestamp:
- Jun 5, 2012 3:07:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r41580 r41582 46 46 #define CMOS_BANK2_LOWER_LIMIT 0x80 47 47 #define CMOS_BANK2_UPPER_LIMIT 0xFF 48 49 #define CMOS_RTC_OFFSET_SEC 0x0 50 #define CMOS_RTC_OFFSET_MIN 0x02 51 #define CMOS_RTC_OFFSET_HR 0x04 52 #define CMOS_RTC_OFFSET_DAY 0x07 53 #define CMOS_RTC_OFFSET_MONTH 0x08 54 #define CMOS_RTC_OFFSET_YEAR 0x09 48 55 49 56 /** @page pg_devbios_cmos_assign CMOS Assignments (BIOS) … … 232 239 233 240 241 static uint8_t bcd2bin(uint8_t val) 242 { 243 return (val & 0x0f) + (val >>4) *10; 244 } 245 234 246 /** 235 247 * Write to CMOS memory. … … 293 305 pHlp->pfnPrintf(pHlp, "Off: 0x%02x Val: 0x%02x\n",u16ByteCount, u8CMOSByte); 294 306 } 295 296 } 307 } 308 309 310 /** 311 * @callback_method_impl{FNDBGFHANDLERDEV, 312 * Dumps the cmos RTC Info.} 313 */ 314 static DECLCALLBACK(void) CMOSRTCInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) 315 { 316 uint8_t u8Sec; 317 uint8_t u8Min; 318 uint8_t u8Hr; 319 uint8_t u8Day; 320 uint8_t u8Month; 321 uint8_t u8Year; 322 323 u8Sec = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_SEC); 324 u8Min = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_MIN); 325 u8Min = bcd2bin(u8Min); 326 u8Hr = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_HR); 327 328 u8Day = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_DAY); 329 u8Month = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_MONTH); 330 331 u8Year = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_YEAR); 332 u8Year = bcd2bin(u8Year); 333 pHlp->pfnPrintf(pHlp, "Day:%u Month:%u Year:%u, Time: Hr:%u Min:%u Sec%u\n",u8Day, u8Month, u8Year, u8Hr, u8Min, u8Sec); 334 335 336 } 337 297 338 /* -=-=-=-=-=-=- based on code from pc.c -=-=-=-=-=-=- */ 298 339 … … 1476 1517 PDMDevHlpDBGFInfoRegister(pDevIns, "cmos2", "Display CMOS Bank 2 Info.. " 1477 1518 "'cmos2'. No argument", CMOSBank2Info); 1519 PDMDevHlpDBGFInfoRegister(pDevIns, "rtc", "Display CMOS RTC info " 1520 "'rtc'. No argument", CMOSRTCInfo); 1478 1521 1479 1522 /*
Note:
See TracChangeset
for help on using the changeset viewer.