Hello everyone,
I have a system with 4 GB RAM and am aiming to write and execute programs that will use as much as possible of this RAM while running in 32-bit protected mode (via the GO32 program, linked into my code at compile time). The main problem has been to get access to all the memory through DPMI - as you are probably aware, Windows will not allow applications to access more than a theoretical maximum of 2 GB of the 4 GB address space, with 1.75 GB being the maximum available in practice. Previously I reported that DPMIONE could see 3.24 GB of memory while CWSDPMI could only see 2 GB. However, the figure for DPMIONE is what it says is available, but further testing proved that the number it reports is wrong. I wrote a test program which basically tests Malloc to destruction by repeatedly allocating RAM 1 MB at a time until Malloc fails, then prints the number of megabytes successfully allocated. Now I am probably doing something wrong with DPMIONE (it is quite tricky to set up), but it could only provide about 770 MB before running out of RAM in spite of it's reporting 3.24 GB available. However, my experiments with CWSDPMI have proved much more fruitful. I was chasing a false trail for a while until I realised that I had to reboot my system when I made changes to CWSDPMI (using the CWSPARAM program).
With CWSDPMI's default settings it was able to allocate 2171 GB of RAM as determined by the memory testing program. This was the same both under FreeDOS and MS DOS (the ME version). The trick is to increase the maximum swap file size from 128 MB to 2048 MB. The swap file doesnt seem to get used (there is enough RAM) but CWSDPMI likes to know that it's there! After making this change and rebooting the system I was able to allocate 3590 MB under FreeDOS or 3595 MB under MS DOS. This is probably about as good as it is possible to get, bearing in mind the memory needed by the system for PIC tables etc.
I found nothing in the documentation that came with CWSDPMI about settings for systems with more than 2GB of RAM, so this has been a matter of trial and error changing one setting at a time and testing the effect. Hopefully my findings will be of use or interest - perhaps something could be added to the distribution docs about the effect of the swap file size.
Best Wishes,

Reply via email to