I have an embedded application written in C, running on FreeDOS on a 486/386DX-style processor (http://www.dmp.com.tw/tech/vortex86dx). The computer has 256MB memory, but I don't seem to have access to most it.
I've written a simple program to investigate (calls malloc()
in a loop until null pointer is returned) and although the size of each malloc()
request affects the result slightly, it's always around 300kB limit. My code is having to map blocks of 16-bit memory as my implementation of malloc()
seems to accept only unsigned short
argument. Not terrible as I need only 3MB or so, so about 50 blocks (it's a circular buffer for acquisition data so this roundabout approach isn't that cumbersome). Since I'm getting much more than 16 bits worth of memory (300k vs 64k), I know this isn't entirely a 16-bit problem. I'm guessing this is associated with the 640kB limit I've read about in my research, but I don't understand if this is a compiler problem or an OS problem.
I'm using Borland BC5 compiler and I've tried all kinds of tweaks to the memory model and compiler options, which have had minimal effect on the results. I'm currently looking into HIMEMX.EXE and JEMM386.EXE but as I've barked up so many wrong trees so far, thought it worth a question in the meantime. I've also started looking into Linux though this is a major major change as the code is very DOS specific, and I have zero experience with Linux.
I'm hoping there are just some settings or commands that I need to take advantage of without having to do some huge port to and OS I'm not familiar with. My DOS installation currently consists only of copying files config.sys and sys.com to the hard drive, so I don't have access to the extended memory executables above yet to experiment. Guessing that will only get me to the next difficulty, so hopefully somebody with experience in this ancient department can lend a hand until I have more time to familiarize myself with modern tools.
So should I be concerned more with the OS settings or compiler settings (or compiler itself)?