Problem with FreeDos And DJGPP program without EMM386

The intent of this forum is to discuss my DOS TSR programs (available at http://bretjohnson.us), how they work and don't work, new/missing features, status of updates, and anything else related to them that may need to be discussed.

Problem with FreeDos And DJGPP program without EMM386

Postby philippe » Thu Nov 05, 2015 5:28 am

Hi,
is anybody making a success to run a djgpp program (32bits protected mode) without Emm386.exe with USB Driver. I don't use Emm386 because it limited to 64MB of RAM Memory in my program but I have 2GB memory and I need more 64MB to run my program (minimum 512MB, I have a lot of data in memory!). BUt I have only 450KB for the DOS memory. It seems between CWSDPMI (extender from djgpp) and USB driver there are problems to allocate DOS memory or there is not enough DOS memory for my program ! I only need 50KB but it seems there is not any more ! see mem command:

"
Modules using memory below 1 MB:

Name Total Conventional Upper Memory
-------- ---------------- ---------------- ----------------
SYSTEM 60,480 (59K) 60,480 (59K) 0 (0K)
COMMAND 78,032 (76K) 78,032 (76K) 0 (0K)
KEYB 1,472 (1K) 1,472 (1K) 0 (0K)
USBUHCIL 29,712 (29K) 29,712 (29K) 0 (0K)
USBDRIVE 17,264 (17K) 17,264 (17K) 0 (0K)
KEYBDATA 752 (1K) 752 (1K) 0 (0K)
Free 463,424 (453K) 463,424 (453K) 0 (0K)

Memory Type Total Used Free
---------------- -------- -------- --------
Conventional 636K 183K 453K
Upper 0K 0K 0K
Reserved 388K 388K 0K
Extended (XMS) 3,134,016K 3,134,016K 0K
---------------- -------- -------- --------
Total memory 3,135,040K 3,134,587K 453K

Total under 1 MB 636K 183K 453K

Largest executable program size 451K (461,728 bytes)
"
does anybody have an idea ?
philippe
 
Posts: 2
Joined: Wed Nov 04, 2015 5:16 am

Re: Problem with FreeDos And DJGPP program without EMM386

Postby Bret » Fri Nov 06, 2015 5:16 am

The only way you're going to free up enough conventional memory to suit your purposes is to enable Upper Memory Blocks (UMB's). There are a few different ways to do this. One is by using the combination of HIMEM.SYS & EMM386.EXE (EMM386 is what enables UMB's, and EMM386 requires HIMEM). There are also various clones of HIMEM & EMM386 floating around (search around in FreeDOS). Also, make sure you put a DOS=HIGH,UMB line in your CONFIG.SYS.

In addition, just because you load EMM386 (or one of its clones) doesn't necessarily mean you're enabling Expanded Memory (EMS) -- you can load it with the NOEMS option.

Another possibility is to use the UMBPCI program, which enables UMB's without all of the other stuff that goes along with EMS & XMS. Unfortunately, that won't help you with my USB drivers, since the UMB's provided by UMBPCI aren't always compatible with the Direct Memory Access (DMA) required by USB.

The other thing to keep in mid is that if your program really runs in 32-bit protected mode (PM32), it doesn't need to use EMS or XMS to obtain the memory it needs. It just needs to remain compatible with whatever extended memory is already being used by other programs so it doesn't corrupt anything (whether the other programs reserved that memory through EMS, XMS, INT 15h, DPMS, DPMI, or whatever). Your program should run just fine whether EMM386 is installed or not. When you ask DJGPP to allocate some memory for you, it should take care of all of those ugly memory details for you automatically.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Problem with FreeDos And DJGPP program without EMM386

Postby philippe » Sun Nov 08, 2015 10:11 pm

Thank for your response, Bret.
I have tried with UMBPCI, like EMM386, your USB driver works fine but I have only 64MB of memory instead of 2GB , I need much more !
I have this message : "Error : could not allocate page Table Memory" on malloc function. of course without the USB driver I don't have this message.
I continue to find my problem.
philippe
 
Posts: 2
Joined: Wed Nov 04, 2015 5:16 am

Re: Problem with FreeDos And DJGPP program without EMM386

Postby jmrams » Sun Nov 15, 2015 9:14 pm

I have solved the problem using hdpmi not cwsdpmi

In config.sysy:
device=c:\dos\himem.sys /A20CONTROL:ON
device=c:\dos\emm386.exe ram noems

in autoexec.bat:
cd hdpmi\bin
hdpmi32 -r
cd\

using uide as cache disk not lbacache not smartdrv
jmrams
 
Posts: 12
Joined: Sun Sep 21, 2014 11:10 pm

Re: Problem with FreeDos And DJGPP program without EMM386

Postby philippe85 » Mon Dec 07, 2015 3:39 am

HI,
I had found my problem! In fact I had a bug inside my program ! Now the driver works fine. I am also going to try the hdpmi instead of cwsdpmi.
thanks for your help.
philippe85
 
Posts: 1
Joined: Wed Nov 04, 2015 5:20 am

Re: Problem with FreeDos And DJGPP program without EMM386

Postby jmrams » Sun Dec 13, 2015 9:12 pm

Philpe.

I had the same problem as you with emm386. I have solved the problem using HDPMi instead cwsdpmi. I am working with it for som months with good results. I had problems with smartdrv.exe that I colud solve usind uide as disk cahce controller.
jmrams
 
Posts: 12
Joined: Sun Sep 21, 2014 11:10 pm


Return to Programs

Who is online

Users browsing this forum: No registered users and 4 guests

cron