1
0
Fork 0

zero reported extended memory size if xms/ems/dpmi is loaded

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1437
This commit is contained in:
Sjoerd van der Berg 2003-11-14 00:04:27 +00:00
parent b6a4b0fb5c
commit 8f5af81299
4 changed files with 18 additions and 6 deletions

View file

@ -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 <time.h>
#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);
}

View file

@ -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<Section_prop *>(sec);
if (!section->Get_bool("dpmi")) return;
BIOS_ZeroExtendedSize();
memset(&callback,0,sizeof(callback));
/* setup Real mode Callbacks */

View file

@ -583,6 +583,7 @@ static Bitu INT67_Handler(void) {
void EMS_Init(Section* sec) {
Section_prop * section=static_cast<Section_prop *>(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 */

View file

@ -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<Section_prop *>(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);