From: "Jay K (jayk123@hotmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
Date: Wed, 26 Jan 2022 09:53:31 +0000
suggested_attachment_session_id: 69785034-0787-e0af-85a1-df4fb0b67acf
I am trying to port my program to MS-DOS. For fun, granted.
I figured DJGPP would help.
Esp. because it seems to have a useful "sigalarm" functionality,
I might use to implement preemptive threads.
I have a prototype that suggests that will work:
https://github.com/modula3/cm3/blob/3be819ed8e2fa60885aff0cb6278934a17b30702/m3-libs/m3core/src/thread/POSIX/test_dos_threads.cpp
The rest of the Posix support helps also.
I'm not sure about network/sockets, maybe give up.
I have experimented with a few "DOS"s.
FreeDOS, DosBos-X, 32bit Windows 10 VM.
They all have advantages and disadvantages.
Granted I could spend more time configuring each and none is "really" MS-DOS.
My program is a compiler, that produces .cpp files and would run g++ or gxx, etc.
(I might experiment with e.g. OpenWatcom, might, like if it can link the djpp libraries.)
I am seeing, I guess, command line length limitations.
gcc and collect2 crash, but if I run them manually with shorter equivalent-enough commands, they work.
Advise?
[...]
bash:
---------------------------
16 bit MS-DOS Subsystem
---------------------------
Administrator: C:\Windows\system32\cmd.exe
NTVDM has encountered a System Error
NTVDM has encountered a System Error 4001h Choose 'Close' to terminate the application.
---------------------------
Close Ignore
---------------------------
Exiting due to signal SIGSEGV
Stack Fault at eip=00000a11
eax=00010001 ebx=01ad0080 ecx=01549400 edx=004207bf esi=00001223 edi=00001213 ebp=0042773a esp=0042773a program=C:\DOS\BIN\GCC.EXE
cs: sel=00cf base=000d3a50 limit=00000db0
ds: sel=00b7 base=000cc160 limit=0000ffff
es: sel=0040 invalid
fs: sel=0000
gs: sel=0000
ss: sel=00b7 base=000cc160 limit=0000ffff
App stack: [00423b78..00223b7c] Exceptn stack: [00223ac8..00221b88]
On what version of Windows is that?
Exiting due to signal SIGSEGVThis is stack fault, not necessarily related to the command-line
Stack Fault at eip=00000a11
length.
What does go32-v2 report there if run without arguments?
eax=00010001 ebx=01ad0080 ecx=01549400 edx=004207bf esi=00001223 edi=00001213Something is very wrong in the run environment: the SS segment has
ebp=0042773a esp=0042773a program=C:\DOS\BIN\GCC.EXE
cs: sel=00cf base=000d3a50 limit=00000db0
ds: sel=00b7 base=000cc160 limit=0000ffff
es: sel=0040 invalid
fs: sel=0000
gs: sel=0000
ss: sel=00b7 base=000cc160 limit=0000ffff
App stack: [00423b78..00223b7c] Exceptn stack: [00223ac8..00221b88]
very small limit, ES is invalid...
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 343 |
Nodes: | 16 (2 / 14) |
Uptime: | 24:40:36 |
Calls: | 7,553 |
Files: | 12,733 |
Messages: | 5,654,761 |