Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMM incompatibility problem in DOSBox-X #7

Open
JayQ2K opened this issue Feb 19, 2021 · 13 comments
Open

EMM incompatibility problem in DOSBox-X #7

JayQ2K opened this issue Feb 19, 2021 · 13 comments

Comments

@JayQ2K
Copy link

JayQ2K commented Feb 19, 2021

Changed a DOSBox-X setup I have to work with JEMMEX from the JEMM579B package.
Set the following parameters to false: XMS, EMS, UMB as all these are managed by JEMMEX.
Checking memory statistics I have a good amount of Conventional memory free and about 31MB of EMS.

When trying to run MEGAEM (v3.10, it's a Gravis UltraSound part) I get the following message:
ERROR: EMM incompatibility problem: EMM internal structure not recognized.

Tried the HIMEMX (v3.36, both X and X2 executables)/ JEMM386 combination, but that lead to the same issue.
When using EMM386 (v4.49)/ HIMEMX I don't get this problem and MEGAEM gets installed into memory. Therefore it seems JEMMEX does something different in structuring its memory blob then EMM386.
Tried the NOEMS options for both EMM386 (MEGAEM still works) and JEMMEX (same issue as above).

What am I missing in configuring that the above error shows up? Or is there programming wise something different that MEGAEM simply can't interpret correctly?

@Baron-von-Riedesel
Copy link
Owner

Or is there programming wise something different that MEGAEM simply can't interpret correctly?

Yes, most likely the program expects/uses some undocumented (parts of the) EMM386 API - for example, the "device driver" API, reading/writing from/to file EMMXXXX0.
You will have to use MS EMM386 in such cases.

@Baron-von-Riedesel Baron-von-Riedesel changed the title EMM incompatibility problem EMM incompatibility problem in DOSBox-X Feb 23, 2021
@JayQ2K
Copy link
Author

JayQ2K commented Feb 23, 2021

I know Jemm leaves about 8MB of EMS active when using the NOEMS switch. Is there a way to completely disable EMS support, but leave VCPI on? This more alignes to EMM386 behavior and also gives me an extra opportunity to check out whether MEGAEM works under that configuration. MEGAEM does not need EMS, but only VCPI.

@Baron-von-Riedesel
Copy link
Owner

I know Jemm leaves about 8MB of EMS active when using the NOEMS switch...
Is there a way to completely disable EMS support, but leave VCPI on? This more alignes to EMM386 behavior

AFAIK, this "feature" was implemented to COPY exactly what MS EMM386 does.

@JayQ2K
Copy link
Author

JayQ2K commented Jun 28, 2021

If behavior has not changed in recent versions then there is a difference. Maybe EMM386 is not acting according to specs, but you can based on the NOEMS switch completely disable the activation of EMS in EMM386.
Whichever action I tried in JEMM, I was always left with a minimum of 8MB of RAM switched as EMS.

Besides 5.79, I've also tested this on 5.80-pre9. Both show the same behavior.

@JayQ2K
Copy link
Author

JayQ2K commented Jun 28, 2021

jemm

Attached screenshot is output when I launch. The mostly is pretty much what I'm talking about.
Just tested with the recently released v5.80.

@Baron-von-Riedesel
Copy link
Owner

Maybe EMM386 is not acting according to specs, but you can based on the NOEMS switch completely
disable the activation of EMS in EMM386.

Well, I just tried MS EMM386 v4.95 with NOEMS parameter. And, believe it or not, I'm able to allocate EMS pages ( using FD DEBUG.COM) with the XA command - so quite apparently EMS is not "completely disable"d,

@JayQ2K
Copy link
Author

JayQ2K commented Jun 29, 2021 via email

@Baron-von-Riedesel
Copy link
Owner

I should have phrased it differently.

I'm afraid I understand your new phrasing even less than your old.

Please use tool EMSSTAT supplied with Jemm, and run it twice (with MS EMM386 loaded and with Jemm386 loaded) and then tell me what "reserved pages" you mean.

@JayQ2K
Copy link
Author

JayQ2K commented Jun 29, 2021

According to the readme that is supplied with JEMM, the following is stated about NOEMS:

  • NOEMS disables EMS support.

For EMM386 the following is stated on NOEMS:

  • NOEMS Provides access to the upper memory area but prevents access to expanded memory.

FreeDOS EMM386 mentions:

  • NOEMS Do not enable expanded memory. Use NOEMS to get more free UMBs if you need no EMS.

Also I found this:
If the NOEMS option is specified, all the holes in the adapter region A000-FFFF are used for UMBs, and EMM386.EXE does not provide any EMS.

If you take a look at the statistics programs (MEM, EMSSTAT) there will be memory showing up as EMS when running EMM386, which actually is XMS, but wrongly identified. Since the CPU switch into Virtual 8086 mode this however shows as EMM.
NOEMS should pretty much only move the CPU into Virtual 8086 mode with VCPI enabled (unless NOVCPI is switched as well).

Attached 2 files with output of EMM386 and JEMMEX on a 32MB system. What you'll notice is that the EMM386 one states it has NOEMS switched and almost 32MB EMS (again, actually XMS that is identified as EMS), but the JEMMEX one has around 8MB EMS with NOEMS switched.

EMM386.TXT
JEMMEX.TXT

So whether it was planned behavior, there is a difference in execution between the two Expanded Memory Managers. I cannot really explain the 32MB vs. 8MB in any other way for now.

@Baron-von-Riedesel
Copy link
Owner

What you'll notice is that the EMM386 one states it has NOEMS switched and almost 32MB EMS
but the JEMMEX one has around 8MB EMS with NOEMS switched.

Yes, this difference is "intentional" ; actually, Jemm did inherit this from FD EMM386. IMO this difference is irrelevant.

@JayQ2K
Copy link
Author

JayQ2K commented Jun 29, 2021

OK. So to get this straight JEMMEX 'reserves' about 8MB as incorrectly identified EMS en the rest remains identified as XMS, while EMM386 incorrectly identifies all memory as EMS, while it actually all is XMS.
Meaning that if you have a program that requires over 8MB of EMS you can't run that with NOEMS on JEMMEX? Or is it simply a very strange way of reporting the state of the memory under JEMMEX?

As a background, afaik LIM EMS 4.0 can trick an application into thinking the system has EMS available for running an application, while it actually immediately gets handed over to XMS for execution. Only some very old applications actually need the NOEMS switch removed to have 'real' expanded memory. NOEMS switch instructs EMM386 not to create an EMS page frame in the upper memory area, meaning more UMB left of application addressing.

@Baron-von-Riedesel
Copy link
Owner

JEMMEX 'reserves' about 8MB as incorrectly identified EMS en the rest remains identified as XMS

Actually, the amount of EMS is not "reserved", neither by Jemm nor MS EMM386 - the memory is (usually) allocated dynamically from the XMS memory pool. So if an application allocates all free XMS memory, there will be no free EMS memory left either ( that's why the MIN option exists ).

@JayQ2K
Copy link
Author

JayQ2K commented Jun 30, 2021

That's why I used reserved in quotes. It wasn't to describe what is happening in the background, but mainly to describe what you see when using e.g. MEM or EMSSTAT with NOEMS switched.

But that didn't really answer the part of when requiring over 8MB expanded memory for an application what would then happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants