blob: 7c871008576562f0ea6d4a6f497178e9188d47d6 [file] [log] [blame]
Kevin O'Connorf076a3e2008-02-25 22:25:15 -05001// 16bit system callbacks
2//
3// Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
4// Copyright (C) 2002 MandrakeSoft S.A.
5//
6// This file may be distributed under the terms of the GNU GPLv3 license.
7
8#include "util.h" // irq_restore
9#include "biosvar.h" // CONFIG_BIOS_TABLE
10#include "ioport.h" // inb
11#include "cmos.h" // inb_cmos
12
Kevin O'Connore2e5f012008-03-08 10:27:39 -050013#define E820_RAM 1
14#define E820_RESERVED 2
15#define E820_ACPI 3
16#define E820_NVS 4
17#define E820_UNUSABLE 5
18
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050019// Use PS2 System Control port A to set A20 enable
20static inline u8
21set_a20(u8 cond)
22{
23 // get current setting first
24 u8 newval, oldval = inb(PORT_A20);
25 if (cond)
26 newval = oldval | 0x02;
27 else
28 newval = oldval & ~0x02;
29 outb(newval, PORT_A20);
30
31 return (newval & 0x02) != 0;
32}
33
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050034static void
35handle_152400(struct bregs *regs)
36{
37 set_a20(0);
Kevin O'Connor6c781222008-03-09 12:19:23 -040038 set_code_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050039}
40
41static void
42handle_152401(struct bregs *regs)
43{
44 set_a20(1);
Kevin O'Connor6c781222008-03-09 12:19:23 -040045 set_code_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050046}
47
48static void
49handle_152402(struct bregs *regs)
50{
51 regs->al = !!(inb(PORT_A20) & 0x20);
Kevin O'Connor6c781222008-03-09 12:19:23 -040052 set_code_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050053}
54
55static void
56handle_152403(struct bregs *regs)
57{
58 regs->bx = 3;
Kevin O'Connor6c781222008-03-09 12:19:23 -040059 set_code_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050060}
61
62static void
63handle_1524XX(struct bregs *regs)
64{
Kevin O'Connor6c781222008-03-09 12:19:23 -040065 set_code_fail(regs, RET_EUNSUPPORTED);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050066}
67
Kevin O'Connoradb6b372008-03-01 13:38:38 -050068static void
69handle_1524(struct bregs *regs)
70{
71 switch (regs->al) {
72 case 0x00: handle_152400(regs); break;
73 case 0x01: handle_152401(regs); break;
74 case 0x02: handle_152402(regs); break;
75 case 0x03: handle_152403(regs); break;
76 default: handle_1524XX(regs); break;
77 }
78}
79
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050080// removable media eject
81static void
82handle_1552(struct bregs *regs)
83{
Kevin O'Connor6c781222008-03-09 12:19:23 -040084 set_code_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050085}
86
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050087// Wait for CX:DX microseconds. currently using the
88// refresh request port 0x61 bit4, toggling every 15usec
89static void
90handle_1586(struct bregs *regs)
91{
92 irq_enable();
93 usleep((regs->cx << 16) | regs->dx);
94 irq_disable();
95}
96
97static void
98handle_1587(struct bregs *regs)
99{
100 // +++ should probably have descriptor checks
101 // +++ should have exception handlers
102
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500103 u8 prev_a20_enable = set_a20(1); // enable A20 line
104
105 // 128K max of transfer on 386+ ???
106 // source == destination ???
107
108 // ES:SI points to descriptor table
109 // offset use initially comments
110 // ==============================================
111 // 00..07 Unused zeros Null descriptor
112 // 08..0f GDT zeros filled in by BIOS
113 // 10..17 source ssssssss source of data
114 // 18..1f dest dddddddd destination of data
115 // 20..27 CS zeros filled in by BIOS
116 // 28..2f SS zeros filled in by BIOS
117
118 //es:si
119 //eeee0
120 //0ssss
121 //-----
122
123// check for access rights of source & dest here
124
125 // Initialize GDT descriptor
Kevin O'Connor67c00dd2008-03-09 16:10:19 -0400126 SET_SEG(ES, regs->es);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500127 u16 si = regs->si;
128 u16 base15_00 = (regs->es << 4) + si;
129 u16 base23_16 = regs->es >> 12;
Kevin O'Connor67c00dd2008-03-09 16:10:19 -0400130 if (base15_00 < (u16)(regs->es<<4))
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500131 base23_16++;
132 SET_VAR(ES, *(u16*)(si+0x08+0), 47); // limit 15:00 = 6 * 8bytes/descriptor
133 SET_VAR(ES, *(u16*)(si+0x08+2), base15_00);// base 15:00
134 SET_VAR(ES, *(u8 *)(si+0x08+4), base23_16);// base 23:16
135 SET_VAR(ES, *(u8 *)(si+0x08+5), 0x93); // access
136 SET_VAR(ES, *(u16*)(si+0x08+6), 0x0000); // base 31:24/reserved/limit 19:16
137
138 // Initialize CS descriptor
139 SET_VAR(ES, *(u16*)(si+0x20+0), 0xffff);// limit 15:00 = normal 64K limit
140 SET_VAR(ES, *(u16*)(si+0x20+2), 0x0000);// base 15:00
141 SET_VAR(ES, *(u8 *)(si+0x20+4), 0x000f);// base 23:16
142 SET_VAR(ES, *(u8 *)(si+0x20+5), 0x9b); // access
143 SET_VAR(ES, *(u16*)(si+0x20+6), 0x0000);// base 31:24/reserved/limit 19:16
144
145 // Initialize SS descriptor
146 u16 ss = GET_SEG(SS);
147 base15_00 = ss << 4;
148 base23_16 = ss >> 12;
149 SET_VAR(ES, *(u16*)(si+0x28+0), 0xffff); // limit 15:00 = normal 64K limit
150 SET_VAR(ES, *(u16*)(si+0x28+2), base15_00);// base 15:00
151 SET_VAR(ES, *(u8 *)(si+0x28+4), base23_16);// base 23:16
152 SET_VAR(ES, *(u8 *)(si+0x28+5), 0x93); // access
153 SET_VAR(ES, *(u16*)(si+0x28+6), 0x0000); // base 31:24/reserved/limit 19:16
154
Kevin O'Connor2cdd8b62008-03-09 23:37:04 -0400155 u16 count = regs->cx;
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500156 asm volatile(
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500157 // Load new descriptor tables
Kevin O'Connor67c00dd2008-03-09 16:10:19 -0400158 "lgdtw %%es:0x8(%%si)\n"
159 "lidtw %%cs:pmode_IDT_info\n"
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500160
161 // set PE bit in CR0
162 "movl %%cr0, %%eax\n"
163 "orb $0x01, %%al\n"
164 "movl %%eax, %%cr0\n"
165
166 // far jump to flush CPU queue after transition to protected mode
Kevin O'Connoradb6b372008-03-01 13:38:38 -0500167 "ljmpw $0x0020, $1f\n"
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500168 "1:\n"
169
170 // GDT points to valid descriptor table, now load DS, ES
171 "movw $0x10, %%ax\n" // 010 000 = 2nd descriptor in table, TI=GDT, RPL=00
172 "movw %%ax, %%ds\n"
173 "movw $0x18, %%ax\n" // 011 000 = 3rd descriptor in table, TI=GDT, RPL=00
174 "movw %%ax, %%es\n"
175
176 // move CX words from DS:SI to ES:DI
177 "xorw %%si, %%si\n"
178 "xorw %%di, %%di\n"
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500179 "rep movsw\n"
180
181 // reset PG bit in CR0 ???
182 "movl %%cr0, %%eax\n"
183 "andb $0xfe, %%al\n"
184 "movl %%eax, %%cr0\n"
185
186 // far jump to flush CPU queue after transition to real mode
187 "ljmpw $0xf000, $2f\n"
188 "2:\n"
189
190 // restore IDT to normal real-mode defaults
191 "lidt %%cs:rmode_IDT_info\n"
192
Kevin O'Connore20ed9f2008-03-01 14:25:44 -0500193 // Restore %ds (from %ss)
194 "movw %%ss, %%ax\n"
195 "movw %%ax, %%ds\n"
Kevin O'Connor2cdd8b62008-03-09 23:37:04 -0400196 : "+c"(count), "+S"(si)
Kevin O'Connor67c00dd2008-03-09 16:10:19 -0400197 : : "eax", "di"); // XXX - also clobbers %es
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500198
199 set_a20(prev_a20_enable);
200
Kevin O'Connor6c781222008-03-09 12:19:23 -0400201 set_code_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500202}
203
204// Get the amount of extended memory (above 1M)
205static void
206handle_1588(struct bregs *regs)
207{
Kevin O'Connore09b9822008-03-06 19:16:37 -0500208 regs->al = inb_cmos(CMOS_MEM_EXTMEM_LOW);
209 regs->ah = inb_cmos(CMOS_MEM_EXTMEM_HIGH);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500210 // According to Ralf Brown's interrupt the limit should be 15M,
211 // but real machines mostly return max. 63M.
212 if (regs->ax > 0xffc0)
213 regs->ax = 0xffc0;
Kevin O'Connor6c781222008-03-09 12:19:23 -0400214 set_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500215}
216
217// Device busy interrupt. Called by Int 16h when no key available
218static void
219handle_1590(struct bregs *regs)
220{
221}
222
223// Interrupt complete. Called by Int 16h when key becomes available
224static void
225handle_1591(struct bregs *regs)
226{
227}
228
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500229// keyboard intercept
230static void
231handle_154f(struct bregs *regs)
232{
Kevin O'Connor6c781222008-03-09 12:19:23 -0400233 // set_fail(regs); -- don't report this failure.
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500234 set_cf(regs, 1);
235}
236
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500237static void
238handle_15c0(struct bregs *regs)
239{
240 regs->es = SEG_BIOS;
241 regs->bx = (u16)&BIOS_CONFIG_TABLE;
Kevin O'Connor6c781222008-03-09 12:19:23 -0400242 set_code_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500243}
244
245static void
246handle_15c1(struct bregs *regs)
247{
248 regs->es = GET_BDA(ebda_seg);
Kevin O'Connor6c781222008-03-09 12:19:23 -0400249 set_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500250}
251
252static void
253handle_15e801(struct bregs *regs)
254{
255 // my real system sets ax and bx to 0
256 // this is confirmed by Ralph Brown list
257 // but syslinux v1.48 is known to behave
258 // strangely if ax is set to 0
259 // regs.u.r16.ax = 0;
260 // regs.u.r16.bx = 0;
261
262 // Get the amount of extended memory (above 1M)
Kevin O'Connore09b9822008-03-06 19:16:37 -0500263 regs->cl = inb_cmos(CMOS_MEM_EXTMEM_LOW);
264 regs->ch = inb_cmos(CMOS_MEM_EXTMEM_HIGH);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500265
266 // limit to 15M
267 if (regs->cx > 0x3c00)
268 regs->cx = 0x3c00;
269
270 // Get the amount of extended memory above 16M in 64k blocs
Kevin O'Connore09b9822008-03-06 19:16:37 -0500271 regs->dl = inb_cmos(CMOS_MEM_EXTMEM2_LOW);
272 regs->dh = inb_cmos(CMOS_MEM_EXTMEM2_HIGH);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500273
274 // Set configured memory equal to extended memory
275 regs->ax = regs->cx;
276 regs->bx = regs->dx;
277
Kevin O'Connor6c781222008-03-09 12:19:23 -0400278 set_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500279}
280
Kevin O'Connor47baa3c2008-03-08 13:17:16 -0500281#define ACPI_DATA_SIZE 0x00010000L
282
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500283static void
Kevin O'Connor983d6192008-03-09 12:23:42 -0400284set_e820_range(struct bregs *regs, u32 start, u32 end, u16 type, int last)
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500285{
Kevin O'Connor983d6192008-03-09 12:23:42 -0400286 SET_FARVAR(regs->es, *(u16*)(regs->di+0), start);
287 SET_FARVAR(regs->es, *(u16*)(regs->di+2), start >> 16);
288 SET_FARVAR(regs->es, *(u16*)(regs->di+4), 0x00);
289 SET_FARVAR(regs->es, *(u16*)(regs->di+6), 0x00);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500290
291 end -= start;
Kevin O'Connor983d6192008-03-09 12:23:42 -0400292 SET_FARVAR(regs->es, *(u16*)(regs->di+8), end);
293 SET_FARVAR(regs->es, *(u16*)(regs->di+10), end >> 16);
294 SET_FARVAR(regs->es, *(u16*)(regs->di+12), 0x0000);
295 SET_FARVAR(regs->es, *(u16*)(regs->di+14), 0x0000);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500296
Kevin O'Connor983d6192008-03-09 12:23:42 -0400297 SET_FARVAR(regs->es, *(u16*)(regs->di+16), type);
298 SET_FARVAR(regs->es, *(u16*)(regs->di+18), 0x0);
299
300 if (last)
301 regs->ebx = 0;
302 else
303 regs->ebx++;
304 regs->eax = 0x534D4150;
305 regs->ecx = 0x14;
306 set_success(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500307}
308
309// XXX - should create e820 memory map in post and just copy it here.
310static void
311handle_15e820(struct bregs *regs)
312{
313 if (regs->edx != 0x534D4150) {
Kevin O'Connor6c781222008-03-09 12:19:23 -0400314 set_code_fail(regs, RET_EUNSUPPORTED);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500315 return;
316 }
317
Kevin O'Connore09b9822008-03-06 19:16:37 -0500318 u32 extended_memory_size = inb_cmos(CMOS_MEM_EXTMEM2_HIGH);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500319 extended_memory_size <<= 8;
Kevin O'Connore09b9822008-03-06 19:16:37 -0500320 extended_memory_size |= inb_cmos(CMOS_MEM_EXTMEM2_LOW);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500321 extended_memory_size *= 64;
322 // greater than EFF00000???
323 if (extended_memory_size > 0x3bc000)
324 // everything after this is reserved memory until we get to 0x100000000
325 extended_memory_size = 0x3bc000;
326 extended_memory_size *= 1024;
327 extended_memory_size += (16L * 1024 * 1024);
328
329 if (extended_memory_size <= (16L * 1024 * 1024)) {
Kevin O'Connore09b9822008-03-06 19:16:37 -0500330 extended_memory_size = inb_cmos(CMOS_MEM_EXTMEM_HIGH);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500331 extended_memory_size <<= 8;
Kevin O'Connore09b9822008-03-06 19:16:37 -0500332 extended_memory_size |= inb_cmos(CMOS_MEM_EXTMEM_LOW);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500333 extended_memory_size *= 1024;
334 }
335
336 switch (regs->bx) {
337 case 0:
Kevin O'Connor983d6192008-03-09 12:23:42 -0400338 set_e820_range(regs, 0x0000000L, 0x0009fc00L, E820_RAM, 0);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500339 break;
340 case 1:
Kevin O'Connor983d6192008-03-09 12:23:42 -0400341 set_e820_range(regs, 0x0009fc00L, 0x000a0000L, E820_RESERVED, 0);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500342 break;
343 case 2:
Kevin O'Connor983d6192008-03-09 12:23:42 -0400344 set_e820_range(regs, 0x000e8000L, 0x00100000L, E820_RESERVED, 0);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500345 break;
346 case 3:
Kevin O'Connor983d6192008-03-09 12:23:42 -0400347 set_e820_range(regs, 0x00100000L,
348 extended_memory_size - ACPI_DATA_SIZE, E820_RAM, 0);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500349 break;
350 case 4:
Kevin O'Connor983d6192008-03-09 12:23:42 -0400351 set_e820_range(regs,
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500352 extended_memory_size - ACPI_DATA_SIZE,
Kevin O'Connor983d6192008-03-09 12:23:42 -0400353 extended_memory_size, E820_ACPI, 0);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500354 break;
355 case 5:
356 /* 256KB BIOS area at the end of 4 GB */
Kevin O'Connor983d6192008-03-09 12:23:42 -0400357 set_e820_range(regs, 0xfffc0000L, 0x00000000L, E820_RESERVED, 1);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500358 break;
359 default: /* AX=E820, DX=534D4150, BX unrecognized */
Kevin O'Connor6c781222008-03-09 12:19:23 -0400360 set_code_fail(regs, RET_EUNSUPPORTED);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500361 }
362}
363
364static void
365handle_15e8XX(struct bregs *regs)
366{
Kevin O'Connor6c781222008-03-09 12:19:23 -0400367 set_code_fail(regs, RET_EUNSUPPORTED);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500368}
369
370static void
Kevin O'Connoradb6b372008-03-01 13:38:38 -0500371handle_15e8(struct bregs *regs)
372{
373 switch (regs->al) {
374 case 0x01: handle_15e801(regs); break;
375 case 0x20: handle_15e820(regs); break;
376 default: handle_15e8XX(regs); break;
377 }
378}
379
380static void
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500381handle_15XX(struct bregs *regs)
382{
Kevin O'Connor6c781222008-03-09 12:19:23 -0400383 set_code_fail(regs, RET_EUNSUPPORTED);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500384}
385
386// INT 15h System Services Entry Point
Kevin O'Connor19786762008-03-05 21:09:59 -0500387void VISIBLE16
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500388handle_15(struct bregs *regs)
389{
Kevin O'Connoradb6b372008-03-01 13:38:38 -0500390 //debug_enter(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500391 switch (regs->ah) {
Kevin O'Connoradb6b372008-03-01 13:38:38 -0500392 case 0x24: handle_1524(regs); break;
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500393 case 0x4f: handle_154f(regs); break;
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500394 case 0x52: handle_1552(regs); break;
Kevin O'Connorbdce35f2008-02-26 21:33:14 -0500395 case 0x53: handle_1553(regs); break;
396 case 0x83: handle_1583(regs); break;
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500397 case 0x86: handle_1586(regs); break;
398 case 0x87: handle_1587(regs); break;
399 case 0x88: handle_1588(regs); break;
400 case 0x90: handle_1590(regs); break;
401 case 0x91: handle_1591(regs); break;
402 case 0xc0: handle_15c0(regs); break;
403 case 0xc1: handle_15c1(regs); break;
404 case 0xc2: handle_15c2(regs); break;
Kevin O'Connoradb6b372008-03-01 13:38:38 -0500405 case 0xe8: handle_15e8(regs); break;
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500406 default: handle_15XX(regs); break;
407 }
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500408}
409
410// INT 12h Memory Size Service Entry Point
Kevin O'Connor19786762008-03-05 21:09:59 -0500411void VISIBLE16
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500412handle_12(struct bregs *regs)
413{
414 debug_enter(regs);
415 regs->ax = GET_BDA(mem_size_kb);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500416}
417
418// INT 11h Equipment List Service Entry Point
Kevin O'Connor19786762008-03-05 21:09:59 -0500419void VISIBLE16
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500420handle_11(struct bregs *regs)
421{
422 debug_enter(regs);
423 regs->ax = GET_BDA(equipment_list_flags);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500424}
425
426// INT 05h Print Screen Service Entry Point
Kevin O'Connor19786762008-03-05 21:09:59 -0500427void VISIBLE16
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500428handle_05(struct bregs *regs)
429{
430 debug_enter(regs);
431}
432
433// INT 10h Video Support Service Entry Point
Kevin O'Connor19786762008-03-05 21:09:59 -0500434void VISIBLE16
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500435handle_10(struct bregs *regs)
436{
437 debug_enter(regs);
438 // dont do anything, since the VGA BIOS handles int10h requests
439}
440
Kevin O'Connor19786762008-03-05 21:09:59 -0500441void VISIBLE16
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500442handle_nmi(struct bregs *regs)
443{
Kevin O'Connorc65a3802008-03-02 13:58:23 -0500444 debug_isr(regs);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500445 // XXX
446}
447
448// INT 75 - IRQ13 - MATH COPROCESSOR EXCEPTION
Kevin O'Connor19786762008-03-05 21:09:59 -0500449void VISIBLE16
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500450handle_75(struct bregs *regs)
451{
Kevin O'Connorc65a3802008-03-02 13:58:23 -0500452 debug_isr(regs);
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500453
454 // clear irq13
455 outb(0, PORT_MATH_CLEAR);
456 // clear interrupt
457 eoi_both_pics();
458 // legacy nmi call
459 struct bregs br;
460 memset(&br, 0, sizeof(br));
461 call16_int(0x02, &br);
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500462}