diff --git a/src/ints/bios.cpp b/src/ints/bios.cpp index 63b65afd..00d6c78b 100644 --- a/src/ints/bios.cpp +++ b/src/ints/bios.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: bios.cpp,v 1.22 2003-09-30 13:49:34 finsterr Exp $ */ +/* $Id: bios.cpp,v 1.23 2003-11-14 00:04:25 harekiet Exp $ */ #include #include "dosbox.h" @@ -30,6 +30,7 @@ static Bitu call_int1a,call_int11,call_int8,call_int17,call_int12,call_int15,call_int1c; static Bitu call_int1,call_int70; +static Bit16u size_extended; static Bitu INT70_Handler(void) { /* Acknowledge irq with cmos */ @@ -243,10 +244,7 @@ static Bitu INT15_Handler(void) { break; } case 0x88: /* SYSTEM - GET EXTENDED MEMORY SIZE (286+) */ - IO_Write(0x70,0x30); - reg_al=IO_Read(0x71); - IO_Write(0x70,0x31); - reg_ah=IO_Read(0x71); + reg_ax=size_extended; LOG(LOG_BIOS,LOG_NORMAL)("INT15:Function 0x88 Remaining %04X kb",reg_ax); CALLBACK_SCF(false); break; @@ -284,6 +282,10 @@ static Bitu INT1_Single_Step(void) { return CBRET_NONE; } +void BIOS_ZeroExtendedSize(void) { + size_extended=0; +} + void BIOS_SetupKeyboard(void); void BIOS_SetupDisks(void); @@ -353,6 +355,12 @@ void BIOS_Init(Section* sec) { #else mem_writew(BIOS_CONFIGURATION,0xc821); //1 Floppy,FPU,2 serial, 1 parallel #endif + /* Setup extended memory size */ + IO_Write(0x70,0x30); + size_extended=IO_Read(0x71); + IO_Write(0x70,0x31); + size_extended|=(IO_Read(0x71) << 8); + } diff --git a/src/ints/dpmi.cpp b/src/ints/dpmi.cpp index 92029586..13a47707 100644 --- a/src/ints/dpmi.cpp +++ b/src/ints/dpmi.cpp @@ -37,6 +37,7 @@ #include "setup.h" #include "inout.h" #include "cpu.h" +#include "bios.h" #include "paging.h" #include "debug.h" @@ -2520,6 +2521,7 @@ void DPMI_Init(Section* sec) Section_prop * section=static_cast(sec); if (!section->Get_bool("dpmi")) return; + BIOS_ZeroExtendedSize(); memset(&callback,0,sizeof(callback)); /* setup Real mode Callbacks */ diff --git a/src/ints/ems.cpp b/src/ints/ems.cpp index 6efb5131..5f4d753c 100644 --- a/src/ints/ems.cpp +++ b/src/ints/ems.cpp @@ -583,6 +583,7 @@ static Bitu INT67_Handler(void) { void EMS_Init(Section* sec) { Section_prop * section=static_cast(sec); if (!section->Get_bool("ems")) return; + BIOS_ZeroExtendedSize(); call_int67=CALLBACK_Allocate(); CALLBACK_Setup(call_int67,&INT67_Handler,CB_IRET); /* Register the ems device */ diff --git a/src/ints/xms.cpp b/src/ints/xms.cpp index f610ef94..a02177c6 100644 --- a/src/ints/xms.cpp +++ b/src/ints/xms.cpp @@ -26,6 +26,7 @@ #include "setup.h" #include "inout.h" #include "xms.h" +#include "bios.h" #define XMS_HANDLES 50 /* 50 XMS Memory Blocks */ #define XMS_VERSION 0x0300 /* version 3.00 */ @@ -334,7 +335,7 @@ void XMS_Init(Section* sec) { Section_prop * section=static_cast(sec); if (!section->Get_bool("xms")) return; Bitu i; - + BIOS_ZeroExtendedSize(); DOS_AddMultiplexHandler(multiplex_xms); call_xms=CALLBACK_Allocate(); CALLBACK_Setup(call_xms,&XMS_Handler,CB_RETF);