]> Joshua Wise's Git repositories - netwatch.git/blob - aseg/firstrun.c
9589a13432cf30db6a88e3d6780032d15fa2da33
[netwatch.git] / aseg / firstrun.c
1 #include <io.h>
2 #include <smi.h>
3 #include <pci.h>
4 #include <reg-82801b.h>
5 #include "vga-overlay.h"
6 #include <smram.h>
7
8 extern int _bss, _bssend;
9
10 void __firstrun_start() {
11         unsigned char *bp;
12         smram_state_t smram;
13         
14         smram = smram_save_state();
15         smram_tseg_set_state(SMRAM_TSEG_OPEN);
16         
17         for (bp = (void *)&_bss; (void *)bp < (void *)&_bssend; bp++)
18                 *bp = 0;
19         
20         dologf("NetWatch running");
21
22         /* Try really hard to shut up USB_LEGKEY. */
23         pci_write16(0, 31, 2, 0xC0, pci_read16(0, 31, 2, 0xC0));
24         pci_write16(0, 31, 2, 0xC0, 0);
25         pci_write16(0, 31, 4, 0xC0, pci_read16(0, 31, 4, 0xC0));
26         pci_write16(0, 31, 4, 0xC0, 0);
27
28         /* Turn on the SMIs we want */
29         outb(0x830, inb(0x830) | ICH2_SMI_EN_SWSMI_TMR_EN);
30         outb(0x848, ICH2_DEVTRAP_EN_KBC_TRP_EN);
31         smi_enable();
32         
33         smram_restore_state(smram);
34 }
35
This page took 0.018247 seconds and 2 git commands to generate.