4 #include <reg-82801b.h>
5 #include "vga-overlay.h"
8 extern int _bss, _bssend;
10 extern void timer_handler(smi_event_t ev);
11 extern void kbc_handler(smi_event_t ev);
13 void __firstrun_start() {
17 smram = smram_save_state();
18 smram_tseg_set_state(SMRAM_TSEG_OPEN);
20 for (bp = (void *)&_bss; (void *)bp < (void *)&_bssend; bp++)
23 dologf("NetWatch running");
25 /* Try really hard to shut up USB_LEGKEY. */
26 pci_write16(0, 31, 2, 0xC0, pci_read16(0, 31, 2, 0xC0));
27 pci_write16(0, 31, 2, 0xC0, 0);
28 pci_write16(0, 31, 4, 0xC0, pci_read16(0, 31, 4, 0xC0));
29 pci_write16(0, 31, 4, 0xC0, 0);
31 /* Turn on the SMIs we want */
34 smi_register_handler(SMI_EVENT_FAST_TIMER, timer_handler);
35 smi_enable_event(SMI_EVENT_FAST_TIMER);
37 smi_register_handler(SMI_EVENT_DEVTRAP_KBC, kbc_handler);
38 smi_enable_event(SMI_EVENT_DEVTRAP_KBC);
42 smram_restore_state(smram);