joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.81k stars 383 forks source link

[SOLVED] Memory exhausted? (when using FreeBASIC DOS version1.09) #3270

Open richardFK opened 2 years ago

richardFK commented 2 years ago

Code of Conduct & Contributing Guidelines

Have you checked that no other similar question(s) already exists?

Question

Using FreeBASIC 1.09 DOS version to generate 16-bit exe (inside DOSBoxX 0.83.22 on Windows 10x64). From my aaa.bas program (27,384 bytes), when compiling with FreeBASIC DOS get the error

...\fbDOS\lib\dos/libc.a: error adding symbols: Memory exhausted

using MEM, simple summary is:-

Conventional (free) 619K Upper (free) 77K XMS (free) 14,912 K largest executable size 619K Windows is resident in high memory area.

Although it may be silly to mention here, but FreeBASIC x32 / x64 produces aaa.exe

180,224 / 190,976 bytes respectively,

so I would gather that a DOS .exe would be no larger than this (and so is less than 619K).

A while ago when using FreeBASIC DOS version on bare metal machine for aaa.bas - the program compiled successfully (on bare metal).

Any suggestions on how to fix "Memory exhausted" error?

EDIT: fbc.exe (DOS version) is 1,630,720 bytes

richardFK commented 2 years ago

Some further information (if this helps)

To be able to compile a program with FreeBASIC DOS version, to avoid the error

warning: cannot open swap file c:\cwsdpmi.swp

from which the compilation does not complete, I thought that I had to actually install cwsdpmi (downloaded zip and installed in FreeBASIC folder) from which on suggestion by someone to try cwsdpmi -s to disable swap file (since I thought maybe Windows 10 x64 Defender did not allow a swp file being created on C:).

By doing the -s I was able to compile (this was for very small test program) but does not work with somewhat larger program to compile.

I also tried to path change the swapfile to A:\cwsdpmi.swp but this did not seem to work.

I have since learned that DOSBox-X has cwsdpmi included (so I did not have to download/install anyway).

So maybe my problem (not being able to compile larger programs using FreeBASIC DOS) relates to the cwsdpmi configuration (as per DOSBox-X implementation), and as it stands, it appears that DOSBox-X does not generate a C:\cwsdpmi.swp file (maybe because Windows 10 Defender AV does not allow it to) AND that there seems to be no way to instruct DOSBox-X to re-locate cwsdpmi.swp to somewhere else (eg A:) which Windows 10 Defender will allow (since A:\ is not Defender folder protected).

Hope the above helps to explain.

richardFK commented 2 years ago

For those interested how I overcame the problem, refer to the link below

https://www.freebasic.net/forum/viewtopic.php?t=28927

The approach I used may be far from optimal - but so far it seems to give a WORKING and USABLE solution of using FreeBASIC DOS version 1.09 with DOSBOX-x version 2022-FEB-28.