added code and option params to enable/disable the UMB block when you

boot an operating system. Mainline DOSBox behavior is to leave it up
there, while DOSBox-X now defaults to unmapping the UMB (since the OS
will not know it's there and will probably confuse it with adapter ROM).
This commit is contained in:
Jonathan Campbell 2014-01-18 20:35:24 -08:00
parent d7bfa9dd8f
commit c5592a17d5
3 changed files with 26 additions and 1 deletions

View File

@ -861,6 +861,12 @@ public:
WriteOut(MSG_Get("PROGRAM_BOOT_BOOT"), drive);
for(i=0;i<512;i++) real_writeb(0, 0x7c00 + i, bootarea.rawdata[i]);
extern bool keep_umb_on_boot;
/* remove UMB block */
void RemoveUMBBlock();
if (!keep_umb_on_boot) RemoveUMBBlock();
/* revector some dos-allocated interrupts */
real_writed(0,0x01*4,0xf000ff53);
real_writed(0,0x03*4,0xf000ff53);

View File

@ -1112,6 +1112,9 @@ void DOSBOX_Init(void) {
Phex = secprop->Add_hex("umb end",Property::Changeable::OnlyAtStart,0); /* <- (0=auto) 0xEFFF is mainline DOSBox compatible (where base=0xD000 and size=0x2000) */
Phex->Set_help("UMB region last segment");
Pbool = secprop->Add_bool("keep umb on boot",Property::Changeable::OnlyAtStart,0);
Pbool->Set_help("If emulating UMBs, keep the UMB around after boot (Mainline DOSBox behavior). If clear, UMB is unmapped when you boot an operating system.");
Pbool = secprop->Add_bool("automount",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Enable automatic mount.");

View File

@ -117,7 +117,8 @@ Bitu XMS_GetEnabledA20(void) {
}
static RealPt xms_callback;
static bool umb_available;
static bool umb_available = false;
static bool umb_init = false;
static XMS_Block xms_handles[XMS_HANDLES];
@ -417,11 +418,24 @@ Bitu XMS_Handler(void) {
return CBRET_NONE;
}
bool keep_umb_on_boot;
extern bool mainline_compatible_mapping;
Bitu GetEMSType(Section_prop * section);
void DOS_GetMemory_Choose();
bool MEM_unmap_physmem(Bitu start,Bitu end);
void RemoveUMBBlock() {
/* FIXME: Um... why is umb_available == false even when set to true below? */
if (umb_init) {
fprintf(stderr,"Removing UMB block %04x-%04x\n",first_umb_seg,first_umb_seg+first_umb_size-1);
MEM_unmap_physmem(first_umb_seg<<4,((first_umb_seg+first_umb_size)<<4)-1);
umb_init = false;
}
}
class XMS: public Module_base {
private:
CALLBACK_HandlerObject callbackhandler;
@ -454,6 +468,7 @@ public:
xms_handles[0].free = false;
/* Set up UMB chain */
keep_umb_on_boot=section->Get_bool("keep umb on boot");
umb_available=section->Get_bool("umb");
first_umb_seg=section->Get_hex("umb start");
first_umb_size=section->Get_hex("umb end");
@ -499,6 +514,7 @@ public:
bool ems_available = GetEMSType(section)>0;
DOS_BuildUMBChain(umb_available,ems_available);
umb_init = true;
}
~XMS(){