]> Joshua Wise's Git repositories - netwatch.git/blame - aseg/firstrun.c
Add ich2-timer.
[netwatch.git] / aseg / firstrun.c
CommitLineData
e5d94488 1#include <io.h>
85bc8ca6 2#include <smi.h>
36ce375d 3#include <pci.h>
4fb81ad0 4#include <reg-82801b.h>
ce91287c 5#include <output.h>
d71d9872 6#include "vga-overlay.h"
f2b87dd6 7#include <smram.h>
3b3161a1 8#include "3c905.h"
f2b87dd6
JW
9
10extern int _bss, _bssend;
e5d94488 11
07d1dd26 12extern void timer_handler(smi_event_t ev);
8a677ebb 13extern void kbc_handler(smi_event_t ev);
73fb9b4c 14extern void gbl_rls_handler(smi_event_t ev);
07d1dd26 15
e5d94488 16void __firstrun_start() {
f2b87dd6
JW
17 unsigned char *bp;
18 smram_state_t smram;
19
20 smram = smram_save_state();
21 smram_tseg_set_state(SMRAM_TSEG_OPEN);
22
23 for (bp = (void *)&_bss; (void *)bp < (void *)&_bssend; bp++)
24 *bp = 0;
25
ce91287c 26 outputf("NetWatch running");
e5d94488
JP
27
28 /* Try really hard to shut up USB_LEGKEY. */
29 pci_write16(0, 31, 2, 0xC0, pci_read16(0, 31, 2, 0xC0));
30 pci_write16(0, 31, 2, 0xC0, 0);
31 pci_write16(0, 31, 4, 0xC0, pci_read16(0, 31, 4, 0xC0));
32 pci_write16(0, 31, 4, 0xC0, 0);
33
34 /* Turn on the SMIs we want */
07d1dd26 35 smi_disable();
8a677ebb 36
3b3161a1 37 eth_init();
ce91287c 38
07d1dd26
JW
39 smi_register_handler(SMI_EVENT_FAST_TIMER, timer_handler);
40 smi_enable_event(SMI_EVENT_FAST_TIMER);
8a677ebb
JW
41
42 smi_register_handler(SMI_EVENT_DEVTRAP_KBC, kbc_handler);
43 smi_enable_event(SMI_EVENT_DEVTRAP_KBC);
73fb9b4c
JW
44
45 smi_register_handler(SMI_EVENT_GBL_RLS, gbl_rls_handler);
46 smi_enable_event(SMI_EVENT_GBL_RLS);
8a677ebb 47
85bc8ca6 48 smi_enable();
f2b87dd6
JW
49
50 smram_restore_state(smram);
e5d94488
JP
51}
52
This page took 0.032741 seconds and 4 git commands to generate.