// Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
// Copyright (C) 2002 MandrakeSoft S.A.
//
-// This file may be distributed under the terms of the GNU GPLv3 license.
+// This file may be distributed under the terms of the GNU LGPLv3 license.
#include "util.h" // irq_restore
#include "biosvar.h" // BIOS_CONFIG_TABLE
"2:\n"
// restore IDT to normal real-mode defaults
- "lidt %%cs:rmode_IDT_info\n"
+ "lidtw %%cs:rmode_IDT_info\n"
// Restore %ds (from %ss)
"movw %%ss, %%ax\n"
static void
handle_1588(struct bregs *regs)
{
- u32 rs = GET_EBDA(ram_size);
+ u32 rs = GET_GLOBAL(RamSize);
// According to Ralf Brown's interrupt the limit should be 15M,
// but real machines mostly return max. 63M.
static void
handle_15c1(struct bregs *regs)
{
- regs->es = GET_BDA(ebda_seg);
+ regs->es = get_ebda_seg();
set_success(regs);
}
// regs.u.r16.ax = 0;
// regs.u.r16.bx = 0;
- u32 rs = GET_EBDA(ram_size);
+ u32 rs = GET_GLOBAL(RamSize);
// Get the amount of extended memory (above 1M)
if (rs > 16*1024*1024) {
set_success(regs);
}
-#if MODE16
// Info on e820 map location and size.
-struct e820entry *e820_list VISIBLE16;
-int e820_count VISIBLE16;
-#endif
+struct e820entry *e820_list VAR16_32;
+int e820_count VAR16_32;
+// Amount of continuous ram under 4Gig
+u32 RamSize VAR16_32;
+// Amount of continuous ram >4Gig
+u64 RamSizeOver4G;
static void
handle_15e820(struct bregs *regs)
{
- int count = GET_VAR(CS, e820_count);
+ int count = GET_GLOBAL(e820_count);
if (regs->edx != 0x534D4150 || regs->bx >= count) {
set_code_fail(regs, RET_EUNSUPPORTED);
return;
}
- struct e820entry *l = GET_VAR(CS, e820_list);
+ struct e820entry *l = GET_GLOBAL(e820_list);
memcpy_far(MAKE_FARPTR(regs->es, regs->di), &l[regs->bx], sizeof(l[0]));
if (regs->bx == count-1)
regs->ebx = 0;
dprintf(3, "math cp init\n");
// 80x87 coprocessor installed
SETBITS_BDA(equipment_list_flags, 0x02);
- // Enable IRQ13 (handle_75)
- unmask_pic2(PIC2_IRQ13);
+ enable_hwirq(13, entry_75);
}
// INT 75 - IRQ13 - MATH COPROCESSOR EXCEPTION
// clear interrupt
eoi_pic2();
// legacy nmi call
- struct bregs br;
- memset(&br, 0, sizeof(br));
- call16_int(0x02, &br);
+ u32 eax=0, flags;
+ call16_simpint(0x02, &eax, &flags);
}