-void clock_irq(registers_t *regs, byte_t irq_num)
-{
- bool_t pm = FALSE;
-
- cpu_write_port_byte(CMOS_CMD_PORT, CMOS_RTC_SECONDS_REG);
- byte_t seconds = cpu_read_port_byte(CMOS_DATA_PORT);
- cpu_write_port_byte(CMOS_CMD_PORT, CMOS_RTC_MINUTES_REG);
- byte_t minutes = cpu_read_port_byte(CMOS_DATA_PORT);
- cpu_write_port_byte(CMOS_CMD_PORT, CMOS_RTC_HOURS_REG);
- byte_t hours = cpu_read_port_byte(CMOS_DATA_PORT);
- cpu_write_port_byte(CMOS_CMD_PORT, CMOS_RTC_DAY_REG);
- byte_t day = cpu_read_port_byte(CMOS_DATA_PORT);
- cpu_write_port_byte(CMOS_CMD_PORT, CMOS_RTC_MONTH_REG);
- byte_t month = cpu_read_port_byte(CMOS_DATA_PORT);
- cpu_write_port_byte(CMOS_CMD_PORT, CMOS_RTC_YEAR_REG);
- byte_t year = cpu_read_port_byte(CMOS_DATA_PORT);
-
- if (hours & CLOCK_PM_BIT) pm = TRUE;
- hours &= ~CLOCK_PM_BIT;
-
- if (!(clock_settings & CLOCK_BINARY_MODE))
- {
- hours = (hours >> 4) * 10 + (hours & 0x0F);
- minutes = (minutes >> 4) * 10 + (minutes & 0x0F);
- seconds = (seconds >> 4) * 10 + (seconds & 0x0F);
- day = (day >> 4) * 10 + (day & 0x0F);
- month = (month >> 4) * 10 + (month & 0x0F);
- year = (year >> 4) * 10 + (year & 0x0F);
- }