Discussion:
gcc complains about "no DPMI memory"
(too old to reply)
A. Wik (awik32@gmail.com) [via djgpp@delorie.com]
2024-01-28 16:14:22 UTC
Permalink
Hi all,

I'm trying to compile a simple program with DJGPP.

C:\proj\debug\tmp>gcc
gcc.exe: fatal error: no input files
compilation terminated.

C:\proj\debug\tmp>gcc linecont.c
Load error: no DPMI memory

C:\proj\debug\tmp>go32-v2
go32/v2 version 2.0 built Oct 18 2015 09:41:08
Usage: go32 coff-image [args]
..
DPMI memory available: 15826 Kb
DPMI swap space available: 0 Kb

I increased the DPMI and XMS memory in the COMMAND .PIF file to 32768
KB, and now I don't get the error message

C:\proj\debug\tmp>gcc linecont.c
[no error message]

But the compiler fails to produce any output files:

C:\proj\debug\tmp>dir

Volume in drive C has no label
Volume Serial Number is 353A-18E6
Directory of C:\proj\debug\tmp

. <DIR> 28/01/24 15:45 .
. <DIR> 28/01/24 15:45 ..
LINECONT C 411 28/01/24 15:46 linecont.c
1 file(s) 411 bytes
2 dir(s) 6,747.52 MB free

C:\proj\debug\tmp>

The operating system/environment is Win98SE under VMware.

C:\proj\debug\tmp>gcc --version
gcc.exe (GCC) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.

Cheers,
Albert.
Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]
2024-01-28 16:26:29 UTC
Permalink
Date: Sun, 28 Jan 2024 16:14:22 +0000
I'm trying to compile a simple program with DJGPP.
C:\proj\debug\tmp>gcc
gcc.exe: fatal error: no input files
compilation terminated.
C:\proj\debug\tmp>gcc linecont.c
Load error: no DPMI memory
C:\proj\debug\tmp>go32-v2
go32/v2 version 2.0 built Oct 18 2015 09:41:08
Usage: go32 coff-image [args]
...
DPMI memory available: 15826 Kb
DPMI swap space available: 0 Kb
I increased the DPMI and XMS memory in the COMMAND .PIF file to 32768
KB, and now I don't get the error message
C:\proj\debug\tmp>gcc linecont.c
[no error message]
What does go32-v2 report _after_ you increased the memory?
A. Wik (awik32@gmail.com) [via djgpp@delorie.com]
2024-01-28 17:05:17 UTC
Permalink
Post by Eli Zaretskii (***@gnu.org) [via ***@delorie.com]
Post by A. Wik (***@gmail.com) [via ***@delorie.com]
I increased the DPMI and XMS memory in the COMMAND .PIF file to 32768
KB, and now I don't get the error message
C:\proj\debug\tmp>gcc linecont.c
[no error message]
What does go32-v2 report _after_ you increased the memory?
C:\proj\debug\tmp>go32-v2
go32/v2 version 2.0 built Oct 18 2015 09:41:08
..
DPMI memory available: 32209 Kb
DPMI swap space available: 0 Kb

-Albert.
Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]
2024-01-28 17:11:34 UTC
Permalink
Date: Sun, 28 Jan 2024 17:05:17 +0000
Post by Eli Zaretskii (***@gnu.org) [via ***@delorie.com]
Post by A. Wik (***@gmail.com) [via ***@delorie.com]
I increased the DPMI and XMS memory in the COMMAND .PIF file to 32768
KB, and now I don't get the error message
C:\proj\debug\tmp>gcc linecont.c
[no error message]
What does go32-v2 report _after_ you increased the memory?
C:\proj\debug\tmp>go32-v2
go32/v2 version 2.0 built Oct 18 2015 09:41:08
...
DPMI memory available: 32209 Kb
DPMI swap space available: 0 Kb
Try enlarging it more, I'm not sure 32MB is enough for GCC 9. Don't
forget that gcc.exe is just a driver: it invokes cc1.exe (the
compiler), then the assembler, and then the linker. Each one of those
also needs memory. And GNU tools are designed and implemented
explicitly to require vast amounts of memory.
A. Wik (awik32@gmail.com) [via djgpp@delorie.com]
2024-01-28 17:25:11 UTC
Permalink
Post by Eli Zaretskii (***@gnu.org) [via ***@delorie.com]
Post by A. Wik (***@gmail.com) [via ***@delorie.com]
C:\proj\debug\tmp>go32-v2
go32/v2 version 2.0 built Oct 18 2015 09:41:08
...
DPMI memory available: 32209 Kb
DPMI swap space available: 0 Kb
Try enlarging it more, I'm not sure 32MB is enough for GCC 9. Don't
forget that gcc.exe is just a driver: it invokes cc1.exe (the
compiler), then the assembler, and then the linker. Each one of those
also needs memory. And GNU tools are designed and implemented
explicitly to require vast amounts of memory.
I set it to 65535 KB, the highest setting allowed, and now it works!

"Explicitly to require vast amounts of memory"? Like an end in itself?

Why did I never have to change this setting before?

-Albert.
Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]
2024-01-28 17:44:40 UTC
Permalink
Date: Sun, 28 Jan 2024 17:25:11 +0000
Post by Eli Zaretskii (***@gnu.org) [via ***@delorie.com]
Post by A. Wik (***@gmail.com) [via ***@delorie.com]
C:\proj\debug\tmp>go32-v2
go32/v2 version 2.0 built Oct 18 2015 09:41:08
...
DPMI memory available: 32209 Kb
DPMI swap space available: 0 Kb
Try enlarging it more, I'm not sure 32MB is enough for GCC 9. Don't
forget that gcc.exe is just a driver: it invokes cc1.exe (the
compiler), then the assembler, and then the linker. Each one of those
also needs memory. And GNU tools are designed and implemented
explicitly to require vast amounts of memory.
I set it to 65535 KB, the highest setting allowed, and now it works!
Great, happy hacking.
"Explicitly to require vast amounts of memory"? Like an end in itself?
Yes. The idea was that if you take this as a design goal, the
program's code will be very different from a typical Unix program
(recall that Unix was originally a 16-bit OS), so there will be no
danger someone will try to sue GNU for stealing commercial code of
other systems.
Why did I never have to change this setting before?
I don't know. Maybe you've run Windows 98 in a different VM? Or
maybe you used an older version of GCC/Binutils?
A. Wik (awik32@gmail.com) [via djgpp@delorie.com]
2024-01-28 19:21:05 UTC
Permalink
Post by Eli Zaretskii (***@gnu.org) [via ***@delorie.com]
Post by A. Wik (***@gmail.com) [via ***@delorie.com]
I set it to 65535 KB, the highest setting allowed, and now it works!
Great, happy hacking.
Thanks. Today's main insight is that Microsoft C 5.10 (copyright date
1988) is not really K&R (first ed.), but DeSmet PCC 1.2d (copyright
date 1993) is. The former understands ANSI "1" "2" "3" string
concatenation, hexadecimal character codes '\x41", and C++ style //
comments. The latter compiler supports none of these features.

Incidentally, a friend of mine was able to get in touch with the
copyright holders of DeSmet C, and received permission to opensource
it, so it is now available at:
http://www.desmet-c.com/
Post by Eli Zaretskii (***@gnu.org) [via ***@delorie.com]
Post by A. Wik (***@gmail.com) [via ***@delorie.com]
"Explicitly to require vast amounts of memory"? Like an end in itself?
Yes. The idea was that if you take this as a design goal, the
program's code will be very different from a typical Unix program
(recall that Unix was originally a 16-bit OS), so there will be no
danger someone will try to sue GNU for stealing commercial code of
other systems.
I played around with 16-bit Unix not so long ago -- Xenix to be
specific. I've also spent a number of hours browsing the source code
of 7th Edition research Unix, and I found it very elegant.
Post by Eli Zaretskii (***@gnu.org) [via ***@delorie.com]
Post by A. Wik (***@gmail.com) [via ***@delorie.com]
Why did I never have to change this setting before?
I don't know. Maybe you've run Windows 98 in a different VM? Or
maybe you used an older version of GCC/Binutils?
I figured it out. I had created a "custom" version of the MS-DOS
prompt PIF, and I had set the DPMI memory explicitly. I tried
starting "command" with the "Run..." option from the Start menu, and I
found that gcc would work just fine. It turns out that it's best to
leave the DPMI memory setting as "Auto". To illustrate:

C:\proj\debug>go32-v2
go32/v2 version 2.0 built Oct 18 2015 09:41:08
Usage: go32 coff-image [args]
..
DPMI memory available: 226725 Kb
DPMI swap space available: 31959 Kb

-Albert.
Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]
2024-01-28 19:28:52 UTC
Permalink
Date: Sun, 28 Jan 2024 19:21:05 +0000
I figured it out. I had created a "custom" version of the MS-DOS
prompt PIF, and I had set the DPMI memory explicitly. I tried
starting "command" with the "Run..." option from the Start menu, and I
found that gcc would work just fine. It turns out that it's best to
C:\proj\debug>go32-v2
go32/v2 version 2.0 built Oct 18 2015 09:41:08
Usage: go32 coff-image [args]
...
DPMI memory available: 226725 Kb
DPMI swap space available: 31959 Kb
Yes, MUCH better.

Loading...