3 #include <video_defines.h>
7 #include "vga-overlay.h"
10 unsigned int counter = 0;
11 unsigned long pcisave;
12 unsigned char vgasave;
16 static int curdev = 0; /* 0 if kbd, 1 if mouse */
27 b = inb(cts & 0xFFFF);
28 dologf("READ: %08x (%02x)", cts, b);
29 if ((cts & 0xFFFF) == 0x64)
30 curdev = (b & 0x20) ? 1 : 0;
31 if ((curdev == 0) && ((cts & 0xFFFF) == 0x60) && (b == 0x01))
33 *(unsigned char*)0xAFFD0 /* EAX */ = b;
40 b = *(unsigned char*)0xAFFD0 /* EAX */;
41 dologf("WRITE: %08x (%02x)", cts, b);
42 outb(cts & 0xFFFF, b);
46 dolog("Unhandled PCI cycle");
53 void timer_handler(smi_event_t ev)
55 static unsigned int ticks = 0;
57 smi_disable_event(SMI_EVENT_FAST_TIMER);
58 smi_enable_event(SMI_EVENT_FAST_TIMER);
60 outb(0x80, (ticks++) & 0xFF);
65 void kbc_handler(smi_event_t ev)
70 void gbl_rls_handler(smi_event_t ev)
74 ecx = *(unsigned long*)0xAFFD4;
76 packet_t * packet = check_packet(ecx);
79 dologf("WARN: bad packet at %08x", ecx);
83 dologf("Got packet: type %08x", packet->type);
85 if (packet->type == 42) {
86 dump_log((char *)packet->data);
87 *(unsigned long*)0xAFFD4 = 42;
89 *(unsigned long*)0xAFFD4 = 0x2BADD00D;
101 sprintf(statstr, "15-412! %08x %08x", smi_status(), counter);
102 strblit(statstr, 0, 0);
106 if (inl(0x840) & 0x1000)
115 outl(0xCF8, pcisave);
116 outb(0x3D4, vgasave);