• Re: command line lenght problems?

    From [via djgpp@delorie.com]" @21:1/5 to [via djgpp@delorie.com]" on Wed Jan 26 15:08:22 2022
    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
    ---------------------------

    On what version of Windows is that?

    Exiting due to signal SIGSEGV
    Stack Fault at eip=00000a11

    This is stack fault, not necessarily related to the command-line
    length.

    What does go32-v2 report there if run without arguments?

    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]

    Something is very wrong in the run environment: the SS segment has
    very small limit, ES is invalid...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Jan 28 07:29:24 2022
    On 1/26/22 15:08, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] wrote:

    On what version of Windows is that?

    Exiting due to signal SIGSEGV
    Stack Fault at eip=00000a11
    This is stack fault, not necessarily related to the command-line
    length.

    What does go32-v2 report there if run without arguments?

    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]
    Something is very wrong in the run environment: the SS segment has
    very small limit, ES is invalid...

    Is that under Windows 10 32 bit?

    GCC does not work in all recent builds of Win 10 32 bit.

    This will be (stack trace above) how any attempt to execute DJGPP program from another one will end
    in this case. It down not matter whether its executed directly or through some other non DJGPP
    program or bat file. I do not know whether it is intentional or got broken accidentally. It is
    perhaps extremely unlikely that it could be ever fixed.

    Andris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)