4 #include <reg-82801b.h>
6 #include "vga-overlay.h"
8 #include "../net/net.h"
10 extern int _bss, _bssend;
12 extern void timer_handler(smi_event_t ev);
13 extern void kbc_handler(smi_event_t ev);
14 extern void gbl_rls_handler(smi_event_t ev);
16 void __firstrun_start() {
20 smram = smram_save_state();
21 smram_tseg_set_state(SMRAM_TSEG_OPEN);
23 for (bp = (void *)&_bss; (void *)bp < (void *)&_bssend; bp++)
28 outputf("NetWatch running");
30 /* Try really hard to shut up USB_LEGKEY. */
31 pci_write16(0, 31, 2, 0xC0, pci_read16(0, 31, 2, 0xC0));
32 pci_write16(0, 31, 2, 0xC0, 0);
33 pci_write16(0, 31, 4, 0xC0, pci_read16(0, 31, 4, 0xC0));
34 pci_write16(0, 31, 4, 0xC0, 0);
36 /* Turn on the SMIs we want */
41 smi_register_handler(SMI_EVENT_FAST_TIMER, timer_handler);
42 smi_enable_event(SMI_EVENT_FAST_TIMER);
44 smi_register_handler(SMI_EVENT_DEVTRAP_KBC, kbc_handler);
45 smi_enable_event(SMI_EVENT_DEVTRAP_KBC);
47 smi_register_handler(SMI_EVENT_GBL_RLS, gbl_rls_handler);
48 smi_enable_event(SMI_EVENT_GBL_RLS);
54 smram_restore_state(smram);