[DOS/4GW] Help needed. We are almost there, the perfect DOS machine

User avatar
luishg
Posts: 31
Joined: Sun May 24, 2020 7:21 pm
Been thanked: 3 times
Contact:

[DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by luishg »

Hi all,

AO486 and MiSTer are awesome, and we are amost there to get the perfect replacement for an entire era machines.

As most of you already know, there are some memory bug causing a significant difference between MiSTer and a real DOS machine. We are trying to document this in several ways to get some clues [https://github.com/MiSTer-devel/ao486_MiSTer/issues/45]. This thread is just a way to follow this problem outside Github and look for help.

The issue is particulary tricky, AO486 can fully run complex OSs like Win95/98 prefectly but fails running one of the most basic and popular DOS tools, the memory extension library DOS/4GW https://en.wikipedia.org/wiki/DOS/4G.

We are aware this is probably a problem of the DOS4G original implementation, but any compatible computer then were able to solve this, so would be great to get a similar behaviour (even if it's some bad or less strict/proper core response).

Of course, you can use other memory management programs, more modern tools like DOS32 replacements or even freeDOS or DOS7.1, so we agree this is not strictly a problem of the core. But IMO we should aim for compatibility, not speed, new features or running OSs designed for other processors. Arcade or console cores have their own performance metrics to be compared, but AO486 should be more a matter of having a real "low level" compatible machine for DOS sofware.

Any help is appreciated https://github.com/MiSTer-devel/ao486_MiSTer/issues
Best,
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by Caldor »

Yup. I am the one in that thread mentioning using Dos32a as a workaround... but would be nice if it could be solved in the core. Sorgelig does seem to have a suggestion as to what the cause could be... and it gave me the idea to try the 16MB RAM mode, as that might actually limit the RAM to 16MB in several ways that is more helpful for the memory management. Sorg said something about AO486 always allowing the max amount of RAM which meant the software might believe there to be a full 256mb of RAM available, even when it is not the case... or something. For both EMS and XMS..?

Something about memory limits anyway. Also reminds me of a solution that worked for Aladdin before we got the 16MB option, some DOS software that made sure most of the RAM above 16MB was being used, so that the game would not try to access it. That might also be a solution here.
User avatar
aberu
Core Developer
Posts: 1144
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 244 times
Been thanked: 388 times
Contact:

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by aberu »

256MB of RAM on a 386/486 era PC is definitely overboard if that is the case, if that means it's being seen to the ao486 core that way. I had a "top of the line" 3000 dollar 486dx4 pc that was the fastest in my neighborhood as a kid, and it had 16MB of RAM, so it's more than enough RAM to run things like Warcraft 2, Command and Conquer, Terminal Velocity, etc... which are probably the higher end target for games compatibility with ao486.
birdybro~
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by Caldor »

Indeed... I think its just a "why not" since its possible. It does make it possible for us to create huge RAM disks and other stuff with the RAM.

But also there still is the 16MB option. I think I will try to see if this option might help the games that have issues with DOS4GW.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by Caldor »

Someone commented in the Git issue that some versions of DOS/4GW only supports addressing 64MB RAM. So that might confirm the suspicion that the issue might simply be that there is 256MB RAM available.

So one solution might be the 16MB RAM option, but I also think I might want to try to see if we get some of these same DOS4GW bugs when using PCem and configure it to run as a 256MB DOS machine.
User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by pgimeno »

Has anyone checked if there's a DOS/4GW program that runs fine with 16 MB but fails with 256 MB?
throAU
Posts: 181
Joined: Fri Sep 11, 2020 1:06 am
Has thanked: 229 times
Been thanked: 27 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by throAU »

For DOS stuff, 8-16 MB is more than enough. Pretty sure that the largest DOS games ever were 4-8 MB required.

By the time more RAM was required, windows games were a thing. And even most windows 98 stuff ran fine with 16 MB
flynnsbit
Top Contributor
Posts: 550
Joined: Sun May 24, 2020 8:07 pm
Has thanked: 179 times
Been thanked: 307 times
Contact:

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by flynnsbit »

Please don't help if you haven't tested any of this. 16MB is not near enough for what we are doing here. Yes, it is enough for a sample of games but not when you have large packs where you are trying to get maximum compatibility. Follow the github bug, use the resources that were provided to duplicate or use my pack, and test it, see if you can find something that works without replacing the games provided dos4gw with a newer version or dos32a. That is what we are looking for. I do think that 32MB would be a viable and usable memory space.

1. the 16MB option in the MiSTer AO486 core is not enough memory.
2. If you set 16MB, you obviously are not going to see this issue, as it will not manafest itself if you stay within the bounds of the 16MB block.
3. Yes we need more that 16MB of memory to have any kind of large compatibility with misterfs, mouse, tdl loaded into extended memory while a game is playing, cd rom drivers, and so on, and so on.
Televicious
Posts: 93
Joined: Mon May 25, 2020 8:23 pm
Been thanked: 4 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by Televicious »

I had 32 Mb of RAM in my 486 in 95 and it was noticably more efficient. I'd set that as a baseline. Anything higher probably wouldn't be utilized and anything lower will cut it short.
rhester72
Top Contributor
Posts: 1107
Joined: Thu Jun 11, 2020 2:31 am
Has thanked: 13 times
Been thanked: 169 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by rhester72 »

Erm...why not set the limit just below what breaks the extender?
flynnsbit
Top Contributor
Posts: 550
Joined: Sun May 24, 2020 8:07 pm
Has thanked: 179 times
Been thanked: 307 times
Contact:

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by flynnsbit »

rhester72 wrote: Sun Dec 13, 2020 2:09 pm Erm...why not set the limit just below what breaks the extender?
To what end?
breiztiger
Top Contributor
Posts: 427
Joined: Sun May 24, 2020 7:17 pm
Has thanked: 23 times
Been thanked: 93 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by breiztiger »

dos/4Gw has 64mo limit
CPC-Power Staff
flynnsbit
Top Contributor
Posts: 550
Joined: Sun May 24, 2020 8:07 pm
Has thanked: 179 times
Been thanked: 307 times
Contact:

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by flynnsbit »

breiztiger wrote: Sun Dec 13, 2020 3:58 pm dos/4Gw has 64mo limit
Yup, correct. And dos32a can allocate up to 256MB of memory. Evertually we are all going to get there together! It's like this has all been tested and verified.
breiztiger
Top Contributor
Posts: 427
Joined: Sun May 24, 2020 7:17 pm
Has thanked: 23 times
Been thanked: 93 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by breiztiger »

This is PCEM screenshot from 486 with 16mo memory without memory manager
pcem 486 16mO.jpg
pcem 486 16mO.jpg (191.47 KiB) Viewed 15352 times

and this is MiSTer AO486 with 16mo option
20201213_183420-screen.png
20201213_183420-screen.png (5.76 KiB) Viewed 15352 times

i think dos/4gw crash because of wrong memory detection (64mo max)
CPC-Power Staff
throAU
Posts: 181
Joined: Fri Sep 11, 2020 1:06 am
Has thanked: 229 times
Been thanked: 27 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by throAU »

flynnsbit wrote: Sun Dec 13, 2020 4:31 am Please don't help if you haven't tested any of this. 16MB is not near enough for what we are doing here. Yes, it is enough for a sample of games but not when you have large packs where you are trying to get maximum compatibility. Follow the github bug, use the resources that were provided to duplicate or use my pack, and test it, see if you can find something that works without replacing the games provided dos4gw with a newer version or dos32a. That is what we are looking for. I do think that 32MB would be a viable and usable memory space.

1. the 16MB option in the MiSTer AO486 core is not enough memory.
2. If you set 16MB, you obviously are not going to see this issue, as it will not manafest itself if you stay within the bounds of the 16MB block.
3. Yes we need more that 16MB of memory to have any kind of large compatibility with misterfs, mouse, tdl loaded into extended memory while a game is playing, cd rom drivers, and so on, and so on.
Sorry I was just commenting on my experience actually running DOS machines for gaming back in the 90s. I was there for the transition from DOS to Windows (buying/building/selling/using machines). More than 16MB wasn't *widespread* until the days of Windows 98... ergo - DOS software requiring this much memory is pretty much non-existent. If it DOES exist it will more likely be things like high end DOS only CAD packages, etc.

Before Windows 95/98, no games needed more than 8 MB (biggest games I can recall for DOS were Strike Commander and Privateer). If we are seeing memory related crashes in DOS games, it isn't due to the game requiring more RAM is all I'm saying - and it would not surprise me if there are plenty of DOS extender bugs with capacities exceeding 16 MB, because they were extremely uncommon. Many 486-class machines didn't have the physical slots/ability to fit more than 16-32 MB (even though technically the chips supported more) - so there's a high chance of all sorts of bugs in the original software.

It's possibly also more likely due to an issue with ao486 (guessing EMS page frame or XMS compatibility problems or protected mode issues), possibly as above the wrong memory capacity being detected when a particular capacity limit is set.

I'm not taking into account any mister/ao486 core specific features that may be inside the ao486 implementation with that (wasn't aware of anything that would consume memory allocated to the core though?).

If you want to run Windows, sure, more memory is beneficial/needed. But if you want "the perfect DOS machine" for DOS stuff - 16 MB is heaps.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by Caldor »

Its not like the 16mb option takes away the 256mb RAM option.

Some games might work by replacing DOS4GW with DOS32A but I have come across at least 3 games already where DOS32A has the game crashing.

So if the 16MB option works, that will probably fix the issue for most DOS games, but I think it would probably be even better if we also had a 64MB RAM option? That might be the best of both worlds. Then the few things that might need or at least benefit from 256MB we could just switch to that option, but pretty sure its only running Windows 9x stuff where we begin benefitting from more than 64MB in anyway, except... maybe making RAM disks in DOS?
throAU
Posts: 181
Joined: Fri Sep 11, 2020 1:06 am
Has thanked: 229 times
Been thanked: 27 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by throAU »

256 MB is well and truly overkill for a 486 or even non-MMX pentium class machine, but i won’t say “no” to the option if someone can find a use for it :D

But i’d agree with the above, if 16 MB option makes the problems simply go away for a lot of software, its probably something relatively simple to implement and then the devs can move onto something that isn’t that easy to solve. Like i said it would very much not surprise me if the problems aren’t actually in the original DOS extenders, because when they were written, common memory capacities simply weren’t that large.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by Caldor »

Btw... from what I have understood, it was early versions of DOS4GW that did not support more than 64mb RAM. So some of them must support it, and I suppose it would make sense to take such a version and use that to fix the games that have these issues? Of course it will still be a problem for the games where DOS4GW is embedded into some file but maybe what can be done with DOS32A can be done with that version of DOS4GW? Essentially update the embedded DOS4GW code.

The simpler solution still seems to just reduce the amount of RAM to 64mb though.
https://www.vogons.org/viewtopic.php?t=10054
WolfgangBlack
Posts: 53
Joined: Mon Jun 01, 2020 3:19 am
Has thanked: 14 times
Been thanked: 1 time

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by WolfgangBlack »

Look, I have it on good authority no one will ever need more than 640k of memory!
I haven't kept up with this core and don't have the space to seriously mess around with it
and here I see a thread saying MiSTer is almost the perfect DOS machine.
I'm going to try hard to ignore all this until y'all force me to get more MiSTer storage with a
"We're there, MiSTer IS the perfect DOS machine" thread here.

:mrgreen: :mrgreen: :mrgreen:
breiztiger
Top Contributor
Posts: 427
Joined: Sun May 24, 2020 7:17 pm
Has thanked: 23 times
Been thanked: 93 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by breiztiger »

MFT on AO486 with 16Mo conf CMOS BYTE 17 & 18 : 00 FC = 64512
MFT AO486 16Mo.png
MFT AO486 16Mo.png (9.48 KiB) Viewed 15071 times

MFT on 86Box with 16Mo conf CMOS BYTE 17 & 18 : 00 3C = 15360
MFT 86Box 16Mo.jpg
MFT 86Box 16Mo.jpg (340.57 KiB) Viewed 15071 times

16Mo = 640ko RAM + 384ko UPPER + 15360ko EXTENDED

CMOS BYTE 30 & 31 seem to be good at 00 3C on AO486

where can i change this cmos value ?

in main.cpp we have init value but 00 FC but i think it's only for sim ?!?
CPC-Power Staff
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by Caldor »

Pretty sure the CMOS values are set by a bios AO486 uses. Guessing it is the first bios file as the second one is for the graphics. The one called boot0.rom.
breiztiger
Top Contributor
Posts: 427
Joined: Sun May 24, 2020 7:17 pm
Has thanked: 23 times
Been thanked: 93 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by breiztiger »

in main MiSTer, in x86.cpp we have

0x80, //0x15: base memory in 1k LSB
0x02, //0x16: base memory in 1k MSB
0x00, //0x17: memory size above 1m in 1k LSB
0xFC, //0x18: memory size above 1m in 1k MSB

0x00, //0x30: memory size above 1m in 1k LSB
0x3C, //0x31: memory size above 1m in 1k MSB

0x80, //0x34: memory size above 16m in 64k LSB
0x0E, //0x35: memory size above 16m in 64k MSB; 256-8 MB

but not ao486 conf releated it seem
CPC-Power Staff
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by Caldor »

Not directly maybe, I think its about the... do not remember what it is called on a disk, but I guess RAM has the same. A minimum file size or something that helps with how it is all indexed. The larger it is the faster it is to search through different blocks of memory, the smaller it is, the more efficient it is it for the storage of small files as they would not have to take up extra space.

Its just a guess though.
flynnsbit
Top Contributor
Posts: 550
Joined: Sun May 24, 2020 8:07 pm
Has thanked: 179 times
Been thanked: 307 times
Contact:

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by flynnsbit »

breiztiger wrote: Tue Dec 15, 2020 9:29 am in main MiSTer, in x86.cpp we have

0x80, //0x15: base memory in 1k LSB
0x02, //0x16: base memory in 1k MSB
0x00, //0x17: memory size above 1m in 1k LSB
0xFC, //0x18: memory size above 1m in 1k MSB

0x00, //0x30: memory size above 1m in 1k LSB
0x3C, //0x31: memory size above 1m in 1k MSB

0x80, //0x34: memory size above 16m in 64k LSB
0x0E, //0x35: memory size above 16m in 64k MSB; 256-8 MB

but not ao486 conf releated it seem
Somewhere in here? this is boot0.rom
https://github.com/MiSTer-devel/ao486_M ... sw/sysbios
gordonfish
Posts: 9
Joined: Thu Nov 19, 2020 1:04 am
Has thanked: 21 times
Been thanked: 2 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by gordonfish »

Caldor wrote: Tue Dec 15, 2020 11:45 am Not directly maybe, I think its about the... do not remember what it is called on a disk, but I guess RAM has the same. A minimum file size or something that helps with how it is all indexed. The larger it is the faster it is to search through different blocks of memory, the smaller it is, the more efficient it is it for the storage of small files as they would not have to take up extra space.

Its just a guess though.
Sounds like you're referring to block size.
User avatar
luishg
Posts: 31
Joined: Sun May 24, 2020 7:21 pm
Been thanked: 3 times
Contact:

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by luishg »

Caldor wrote: Fri Dec 11, 2020 11:45 am So one solution might be the 16MB RAM option
Just want to add that the memory cap is not a solution. You can try to limit memory to 16mb through OSD and Warcraft II over its default DOS/4GW won't pass.

Btw Warcraft II specs:

Computer: Warcraft II requires a 100% IBM PC compatible computer, with a 486/33 MHz or better processor and at least 8 megabytes of memory. Operation System: You may play Warcraft II under MS-DOS version 5.0 or higher, Windows 95, or Windows 3.1.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by Caldor »

gordonfish wrote: Thu Dec 17, 2020 2:48 am
Caldor wrote: Tue Dec 15, 2020 11:45 am Not directly maybe, I think its about the... do not remember what it is called on a disk, but I guess RAM has the same. A minimum file size or something that helps with how it is all indexed. The larger it is the faster it is to search through different blocks of memory, the smaller it is, the more efficient it is it for the storage of small files as they would not have to take up extra space.

Its just a guess though.
Sounds like you're referring to block size.
Yes, that is what its called. On disks at least... still not sure its something relevant for RAM, but it looks to me like that is what this does. Sets up different block sizes depending on how much RAM there is... or maybe it even sets different block sizes in different areas of the RAM, but I doubt that would work. Pretty sure it like a disk needs the same block size for everything. But RAM is quite different from regular disks, until maybe you make a RAM disk from some of it.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by Caldor »

luishg wrote: Thu Dec 17, 2020 8:08 am
Caldor wrote: Fri Dec 11, 2020 11:45 am So one solution might be the 16MB RAM option
Just want to add that the memory cap is not a solution. You can try to limit memory to 16mb through OSD and Warcraft II over its default DOS/4GW won't pass.

Btw Warcraft II specs:

Computer: Warcraft II requires a 100% IBM PC compatible computer, with a 486/33 MHz or better processor and at least 8 megabytes of memory. Operation System: You may play Warcraft II under MS-DOS version 5.0 or higher, Windows 95, or Windows 3.1.
That is a different issue though. Warcraft 2 needs... I do not remember the name right now but some type of protected memory(Oh yes, DPMI). If you run it in Windows 95 it will actually work. But then, in Windows 95 it runs whether you set it to 16mb RAM or not. I think its because Windows 95 provides protected memory.

I got Warcraft 2 running under DOS using HX DOS Extender. I guess maybe I also got it running using DOS32A. But it is not the 16mb limit that helps Warcraft 2.

This is the newest HX DOS Extender:
https://github.com/Baron-von-Riedesel/H ... /tag/v2.18

I am pretty sure its the DPMILD I used to get Warcraft II to run under DOS. But again, DOS32A might do something similar. I guess we ought to try to figure out if more games have this problem as well to see if we can figure out what causes this.
breiztiger
Top Contributor
Posts: 427
Joined: Sun May 24, 2020 7:17 pm
Has thanked: 23 times
Been thanked: 93 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by breiztiger »

hi

strange thing with memory i think

main descentr.exe from descent game crash (DOS/4GW Pro 1.97) with 16mo or 256mo config

i have push DOS/4GW PRO 2.01 in exe and it work

(descentr.le in zip is exe without DOS/4GW include)
Attachments
DESCENTR.zip
(940.14 KiB) Downloaded 190 times
CPC-Power Staff
breiztiger
Top Contributor
Posts: 427
Joined: Sun May 24, 2020 7:17 pm
Has thanked: 23 times
Been thanked: 93 times

Re: [DOS/4GW] Help needed. We are almost there, the perfect DOS machine

Unread post by breiztiger »

http://old-dos.ru/dl.php?id=14275

cachechk report diff in cmos vs bios

bios report 16mo for 16mo and 248mo for 256mo (why -8mo ?)
CPC-Power Staff
Post Reply