4 #include <reg-82801b.h>
5 #include "vga-overlay.h"
8 extern int _bss, _bssend;
10 extern void timer_handler(smi_event_t ev);
12 void __firstrun_start() {
16 smram = smram_save_state();
17 smram_tseg_set_state(SMRAM_TSEG_OPEN);
19 for (bp = (void *)&_bss; (void *)bp < (void *)&_bssend; bp++)
22 dologf("NetWatch running");
24 /* Try really hard to shut up USB_LEGKEY. */
25 pci_write16(0, 31, 2, 0xC0, pci_read16(0, 31, 2, 0xC0));
26 pci_write16(0, 31, 2, 0xC0, 0);
27 pci_write16(0, 31, 4, 0xC0, pci_read16(0, 31, 4, 0xC0));
28 pci_write16(0, 31, 4, 0xC0, 0);
30 /* Turn on the SMIs we want */
32 smi_register_handler(SMI_EVENT_FAST_TIMER, timer_handler);
33 smi_enable_event(SMI_EVENT_FAST_TIMER);
34 outb(0x848, ICH2_DEVTRAP_EN_KBC_TRP_EN);
37 smram_restore_state(smram);