3 #include <video_defines.h>
6 #include <pci-bother.h>
8 #include "../net/net.h"
9 #include "vga-overlay.h"
11 #include "pagetable.h"
13 unsigned int counter = 0;
14 unsigned int lastctr = 0;
15 unsigned long pcisave = 0;
16 unsigned char vgasave = 0;
18 void set_cr0(unsigned int);
22 register unsigned int _temp__; \
23 asm volatile("mov %%cr0, %0" : "=r" (_temp__)); \
28 #define set_cr3(value) \
30 register unsigned int _temp__ = (value); \
31 asm volatile("mov %0, %%cr3" : : "r" (_temp__)); \
33 #define CR0_PG 0x80000000
48 sprintf(statstr, "15-412! %08x %08x", smi_status(), counter);
50 strblit(statstr, 0, 0);
60 if (inl(0x840) & 0x1000)
78 void timer_handler(smi_event_t ev)
80 static unsigned int ticks = 0;
82 smi_disable_event(SMI_EVENT_FAST_TIMER);
83 smi_enable_event(SMI_EVENT_FAST_TIMER);
85 outb(0x80, (ticks++) & 0xFF);
91 void __firstrun_start() {
94 smram = smram_save_state();
95 smram_tseg_set_state(SMRAM_TSEG_OPEN);
99 smi_register_handler(SMI_EVENT_FAST_TIMER, timer_handler);
100 smi_enable_event(SMI_EVENT_FAST_TIMER);