If I set ems=false in my dosbox.conf, then type "mem" immediately upon running DOSBox, it indeed shows no expanded memory. So far so good.
However, if I then mount a drive (which, as far as I can tell, is pretty much necessary to really use DOSBox) and then switch to that drive, suddenly 1MB of expanded memory shows up when I type "mem".
The weird part is that this expanded memory disappears again if I switch back to Z:. What the heck? Why is DOSBox dynamically creating EMS when I go away from Z:? This has been the case for a while, and it still happens with DOSBox 0.70. I see nothing on this in the README; I'm running DB under Win98SE.
Doesn't happen for me and sounds quite weird, especially as if
ems really would be re-enabled for some reason it'd never be
at 1mb.
Please post screenshots (png) where the mounting is visible and the output of mem.
Yes, you have a point... But I was just doing that as a quick proof-of-concept demonstration. 😀 This is not my usual full DOSBox setup, I just got DOSBOX 0.70, and I am just trying this to see if this same weird EMS bug exists in this version (which it apparently does).
Nope, D: is my second hard drive... I only get the warning message when mounting C:\, but not any other letters or locations. Oh well, it's obviously kinda weird, but thanks anyway... And thanks for making the greatest program ever! 😁
Just as an update to anyone reading this thread: I tried a completely different install of Windows 98 with both DOSBox 0.70 and 0.65, but got exactly these same results. Seems like a Win98 thing. Is there seriously nobody else who has ever noticed this on Win98?
Well most people on these forums only use 98 on an older computer with DOS already included. Amount of 98 users here is pretty sparse. I have a couple of laptops that might have 98 on 'em, haven't booted them in about a year tho. If not then I might install 98 this weekend. (Probably not, gotta work).
I've got a Win98SE virtual machine lying around, tested it, no problems. I get no mysterious EMS. (clean install, default config except for ems/xms/umb=false)
It sounds a bit like a buffer overflow or something, but since it happens only on a few machines, could it be the video driver of your system or something like that messing around?
Why does DOSBox create EMS when switching from Z:? [edit: on Win98]
Dosbox v0.70 does not really 'create' any EMS memory with the 'ems=false' setting in the dosbox.conf file when changing to a mounted drive on the Win 98, Win 98SE and Win ME operating systems.
It just looks that way. 😁
While the problem can easily be fixed in the dos_programs.cpp file, the underlying problem would have to be corrected in the DOS_OpenFile function located in the dos_files.cpp file. A few more host file-system dependent functions would also probably have to be fixed to eliminate similar behavior in the future. Looks like another minor change for a possible v0.71 release.
Current Dosbox code is written such that any Dosbox created DOS devices are checked or filtered for the DOS_Openfile() function. This works quite well for DOS_OpenFile() on most all of the host operating systems which Dosbox supports, since DOS devices are not returned as existing by the underlying host file-system. However, this does not hold true for the Win9x family of Win32 operating systems, since for example the XMSXXXX0 and EMSXXXX0 DOS devices ARE returned as existing (or openable) by the Win9x host file-system to Dosbox on DOS_Openfile() calls. So even though the Dosbox EMSXXXX0 DOS device may not exist, the Win9x EMSXXXX0 DOS device will most certainly exist and hence the bogus information returned by the Dosbox internal MEM command on Win9x when the underlying host file-system is accessed.
Sitting on the Dosbox virtual drive "Z:" the MEM command does not display any EMS memory when executing on Win9x with the 'ems=false' dosbox.conf setting - as expected. Now mount a host file-system Win9x sub-directory to a Dosbox drive, change drives, then execute MEM and you will see the bogus 'EMS memory' report where no EMS memory should exist.
Bottom line: Not a Win9x problem, but a Dosbox coding problem which just became unmasked. Chalk it up to the low Win9x user-base. Only problems for the future is that all Win9x DOS devices might continue to 'leak' through to the Dosbox VM without some attention being paid to the DOS_xxx() functions.
Problem
File: dos_programs.cpp, line ~339 from Dosbox v0.70 source
1/* Test for and show free EMS */ 2Bit16u handle; 3char emm[9] = { 'E','M','M','X','X','X','X','0',0 }; 4if (DOS_OpenFile(emm,0,&handle)) { //DOS_FindDevice use instead! 5 DOS_CloseFile(handle); 6 reg_ah=0x42; 7 CALLBACK_RunRealInt(0x67); 8 WriteOut(MSG_Get("PROGRAM_MEM_EXPAND"),reg_bx*16); 9}
Fix
File: dos_programs.cpp, line ~339 from modified Dosbox v0.70 source
1/* Test for and show free EMS */ 2char emm[9] = { 'E','M','M','X','X','X','X','0',0 }; 3if (!(DOS_FindDevice(emm)==DOS_DEVICES)) { 4 reg_ah=0x42; 5 CALLBACK_RunRealInt(0x67); 6 WriteOut(MSG_Get("PROGRAM_MEM_EXPAND"),reg_bx*16); 7}
hmm yes. that should use dos_finddevice although
I wonder if it goes allright if a game tries to open emmxxx0 in dosbox on win98
We don't have an inactive list of devices.