9 int08(regcontext_t *REGS)
11 *(u_long *)&BIOSDATA[0x6c] += 1; /* ticks since midnight */
12 while (*(u_long *)&BIOSDATA[0x6c] >= 24*60*6*182) {
13 *(u_long *)&BIOSDATA[0x6c] -= 24*60*6*182;
14 BIOSDATA[0x70]++; /* # times past mn */
16 /* What is the real BIOS' sequence? */
22 int1c(regcontext_t *REGS)
44 vec = insert_hardint_trampoline();
46 register_callback(vec, int08, "int 08");
48 vec = insert_softint_trampoline();
50 register_callback(vec, int1c, "int 1c");
52 define_input_port_handler(0x42, inb_timer);
53 define_input_port_handler(0x40, inb_timer);
55 /* Initialize time counter BIOS variable. */
56 gettimeofday(&tv, &tz);
58 tm = *localtime(&tv_sec);
59 *(u_long *)&BIOSDATA[0x6c] =
60 (((tm.tm_hour * 60 + tm.tm_min) * 60) + tm.tm_sec) * 182 / 10;
62 itv.it_interval.tv_sec = 0;
63 itv.it_interval.tv_usec = 54925; /* 1193182/65536 times per second */
64 itv.it_value.tv_sec = 0;
65 itv.it_value.tv_usec = 54925; /* 1193182/65536 times per second */
67 setitimer(ITIMER_REAL, &itv, 0);