ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Definition at line 25 of file pcrtc.c.

Referenced by PcMachInit().

{
    static TIMEINFO TimeInfo;
    REGS Regs;

    for (;;)
    {
        /* Some BIOSes, such as the 1998/07/25 system ROM
         * in the Compaq Deskpro EP/SB, leave CF unchanged
         * if successful, so CF should be cleared before
         * calling this function. */
        Regs.x.eflags = 0;
//        __writeeflags(__readeflags() & ~EFLAGS_CF);

        /* Int 1Ah AH=04h
         * TIME - GET REAL-TIME CLOCK DATE (AT,XT286,PS)
         *
         * AH = 04h
         * CF clear to avoid bug
         * Return:
         * CF clear if successful
         * CH = century (BCD)
         * CL = year (BCD)
         * DH = month (BCD)
         * DL = day (BCD)
         * CF set on error
         */
        Regs.b.ah = 0x04;
        Int386(0x1A, &Regs, &Regs);

        if (!INT386_SUCCESS(Regs)) continue;

        TimeInfo.Year = 100 * BCD_INT(Regs.b.ch) + BCD_INT(Regs.b.cl);
        TimeInfo.Month = BCD_INT(Regs.b.dh);
        TimeInfo.Day = BCD_INT(Regs.b.dl);

        /* Some BIOSes leave CF unchanged if successful,
         * so CF should be cleared before calling this function. */
        Regs.x.eflags = 0;
//        __writeeflags(__readeflags() & ~EFLAGS_CF);

        /* Int 1Ah AH=02h
         * TIME - GET REAL-TIME CLOCK TIME (AT,XT286,PS)
         *
         * AH = 02h
         * CF clear to avoid bug
         * Return:
         * CF clear if successful
         * CH = hour (BCD)
         * CL = minutes (BCD)
         * DH = seconds (BCD)
         * DL = daylight savings flag (00h standard time, 01h daylight time)
         * CF set on error (i.e. clock not running or in middle of update)
         */
        Regs.b.ah = 0x02;
        Int386(0x1A, &Regs, &Regs);

        if (!INT386_SUCCESS(Regs)) continue;

        TimeInfo.Hour = BCD_INT(Regs.b.ch);
        TimeInfo.Minute = BCD_INT(Regs.b.cl);
        TimeInfo.Second = BCD_INT(Regs.b.dh);

        break;
    }
    return &TimeInfo;
}

Generated on Fri May 25 2012 04:46:15 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.