| bencollver 15.08.2024, 03:27 |
mawk 1.3.4 20240622 for DOS (Announce) |
MAWK version 1.3.4-20240622 for DOS built with DJGPP. mawk is an interpreter for the AWK Programming Language. It uses a bytecode interpreter, and is known for speedy execution. Requires an 80386 processor or better and CWSDPMI.EXE https://archive.org/details/mawk134-20240622-for-dos gopher://tilde.pink/1/~bencollver/files/dos386/devel/mawk/ |
|
| Rugxulo Usono, 15.08.2024, 06:57 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> MAWK version 1.3.4-20240622 for DOS built with DJGPP. I rebuilt the old 16-bit DOS version 1.2.2 (circa 1996) with TC++ in 2020 (thus no longer bound DOS+OS/2, thus now UPX compressible). Yes, this was faster, more compatible, and had more free memory than other 16-bit AWKs. Re: newer versions, for a while I was double-checking scripts with a modern 32-bit MinGW build under HX. |
|
| bencollver 15.08.2024, 16:27 @ Rugxulo |
mawk 1.3.4 20240622 for DOS |
> (circa 1996) with TC++ in 2020 (thus no longer bound DOS+OS/2, thus now UPX > compressible). Yes, this was faster, more compatible, and had more free > memory than other 16-bit AWKs. > > Re: newer versions, for a while I was double-checking scripts with a modern > 32-bit MinGW > build under HX. That's fun. I briefly tinkered with HX and had trouble locating a toolchain that i could build win32 programs with to run on HX. It doesn't work with recent MinGW, and i couldn't find a mirror with MinGW versions old enough to be compatible with HX. Do you know where to find it? |
|
| Rugxulo Usono, 15.08.2024, 16:40 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> That's fun. I briefly tinkered with HX and had trouble locating a > toolchain that i could build win32 programs with to run on HX. It doesn't > work with recent MinGW, and i couldn't find a mirror with MinGW versions > old enough to be compatible with HX. Do you know where to find it? I never really used MinGW much. But maybe you need ReactOS's MSVCRT.DLL. (I think mine is an old one from 2012, possibly from 0.3.14, can't remember exactly.) You also may have to set DPMILDR=128 or 136 and/or set HDPMI=32. I do know that OpenWatcom's Win32/PE output seems to run fine under HX. So I'd suggest to prefer that. |
|
| bencollver 15.08.2024, 17:33 @ Rugxulo |
mawk 1.3.4 20240622 for DOS |
> I do know that OpenWatcom's Win32/PE output seems to run fine under HX. So > I'd suggest to prefer that. Just out of curiosity, in which ways would a win32 build be preferable to a DJGPP build? |
|
| Rugxulo Usono, 16.08.2024, 04:21 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> > I do know that OpenWatcom's Win32/PE output seems to run fine under HX. > So > > I'd suggest to prefer that. > > Just out of curiosity, in which ways would a win32 build be preferable to a > DJGPP build? I don't think it is better. I would almost always prefer DJGPP. I meant "if you must use HX, stick to OpenWatcom". In theory, having only one binary that runs on two (incompatible) OSes would be nice (even if relying on external API emulation). In 2008, Japheth recompiled the FTE text editor with HX. There he implied a "true flat memory model" was better somehow. (For DJGPP, I think for stability they restricted access to low DOS memory.) He also (rightly) said DJGPP was a bit bloated, having never been optimized for size, so his way gave a slimmer binary. (UPX helps but DJGPP UPX'd stuff runs much slower under NTVDM. Not sure whether specific DPMI hosts would be better overall with demand paging for speed or lower memory usage.) HX also supports .DLLs. (DJGPP has DXE3, which has had a lot of work done, but I'm unsure if it's truly equal in robustness.) |
|
| bencollver 16.08.2024, 04:45 @ Rugxulo |
mawk 1.3.4 20240622 for DOS |
Thanks for the explanation! My takes are that HX has: * a cleaner memory model * a lean runtime * DLL support I plan to experiment with OpenWatcom + HX when i find the time. |
|
| Oso2k 16.08.2024, 15:27 @ Rugxulo |
mawk 1.3.4 20240622 for DOS |
> In theory, having only one binary that runs on two (incompatible) OSes > would be nice (even if relying on external API emulation). You mean like APE and Cosmopolitan? https://justine.lol/ape.html https://justine.lol/cosmopolitan/ |
|
| bencollver 20.08.2024, 03:35 @ Rugxulo |
mawk 1.3.4 20240622 for DOS |
> > MAWK version 1.3.4-20240622 for DOS built with DJGPP.
>
> Re: newer versions, for a while I was double-checking scripts with a modern
> 32-bit MinGW
> build under HX.
I tried to run the latest win32 mawk build under HX.
https://invisible-island.net/datafiles/release/mawk-mingw32.zip
It gave me the following error.
|
|
| Japheth Germany (South), 20.08.2024, 13:27 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> I copied the latest reactos msvcrt.dll into the same directory as mawk.exe. > ... > Any guidance? Thanks! The msvcrt.dll supplied with Windows XP seems to work - and I guess the ones supplied with Win9x are also ok. --- |
|
| bencollver 21.08.2024, 00:38 @ Japheth |
mawk 1.3.4 20240622 for DOS |
> The msvcrt.dll supplied with Windows XP seems to work - and I guess the
> ones supplied with Win9x are also ok.
Thanks! I tried the following MSVCRT.DLL and at first glance it appeared to work:
https://archive.org/download/microsoftwindowsprein...%29%20%28EN%29.iso/I386%2FSYSTEM32%2FMSVCRT.DLL
|
|
| Rugxulo Usono, 21.08.2024, 12:50 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> > The msvcrt.dll supplied with Windows XP seems to work - and I guess the
> > ones supplied with Win9x are also ok.
>
> Thanks! I tried the following MSVCRT.DLL and at first glance it appeared
> to work:
I didn't try them all, but I literally meant it when I said use old ReactOS's 0.3.14 version from 2012. I'm not sure others work as well.
I really should try some simple MAWK/Win32 tests under HX myself and report back. (Well, I don't use system() or popen() a lot there.)
BTW, you mentioned elsewhere some flaws (?) in DJGPP's build when you didn't explicitly close some files (i.e. FAT corruption). I believe the built-in GAWK lint (and/or debugger??) will hint at such things in advance.
N.B. I really don't see the point of using or preferring proprietary .DLLs from Win9x at all. In that case, just use DJGPP. However, most people already have several Windows licenses.
> |
|
| Japheth Germany (South), 21.08.2024, 17:02 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> I'm not sure what to blame: this win32 build of mawk.exe, HX, or something
> else.
Here's the output that I got in MS-DOS 7.1 when I run your test program ( with msvcrt.dll from XP SP3 ):
--- |
|
| bencollver 21.08.2024, 18:55 @ Japheth |
mawk 1.3.4 20240622 for DOS |
> Here's the output that I got in MS-DOS 7.1 when I run your test program (
> with msvcrt.dll from XP SP3 ):
>
> |
|
| Rugxulo Usono, 21.08.2024, 23:25 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> I reproduced the problem in a Watcom win32 build of mawk. That eliminates > mingw and MSVCRT.DLL. Yes, BTW, that is a nice advantage of OpenWatcom. (MSVCRT is a "known DLL", cannot be overridden, and frankly shouldn't be relied upon by user programs. The fact that there are multiple newer version MSVCRT runtime .DLLs is also an annoyance. You can usually link it statically, but most people don't.) > Note how the win32 version of test2.exe inserts extraneous arguments when > it uses the system() C library call, but the DOS version doesn't. What, the extra "/c"? Although I may be misunderstanding, as you know "%COMSPEC% /c my.bat" is often how most programs shell out. But you don't need to explicitly call the shell if not using a .BAT file. In other words, some compilers treat system("runme") as system("command /c runme"). They don't try to be clever and only do it for .BATs, they do it for everything. (DJGPP is a little smarter than most here.) In particular, Turbo Pascal's Exec function (in most, but not all, TP-compatible compilers) explicitly needs something like Exec(getenv('COMSPEC'),' /c ' + myEXEname); |
|
| bencollver 22.08.2024, 02:09 @ Rugxulo |
mawk 1.3.4 20240622 for DOS |
> What, the extra "/c"? Although I may be misunderstanding, as you know
> "%COMSPEC% /c my.bat" is often how most programs shell out. But you don't
> need to explicitly call the shell if not using a .BAT file.
>
> In other words, some compilers treat system("runme") as system("command /c
> runme"). They don't try to be clever and only do it for .BATs, they do it
> for everything. (DJGPP is a little smarter than most here.) In particular,
> Turbo Pascal's Exec function (in most, but not all, TP-compatible
> compilers) explicitly needs something like Exec(getenv('COMSPEC'),' /c ' +
> myEXEname);
I ran this again, this time in the WinPE command prompt, with the following results.
|
|
| Japheth Germany (South), 23.08.2024, 00:55 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> Interesting that argc=3 when running test2.exe on Windows, but argc=5 when > running test2.exe on HXRT. This leads me to believe that the blame rests > somewhere other than the OpenWatcom compiler. For me it works as expected, never got argc=5. Perhaps you're using a very old HXRT? These are the binaries and sources that I used:https://github.com/Baron-von-Riedesel/Testcases/blob/main/test2.zip Note that for the DOS binaries I used spawn-hx.obj - this was formerly spawn386.obj ( created from a modified spawn386.asm ), contained in hxow.lib. --- |
|
| bencollver 23.08.2024, 03:08 @ Japheth |
mawk 1.3.4 20240622 for DOS |
> For me it works as expected, never got argc=5. Perhaps you're using a very
> old HXRT?
>
> These are the binaries and sources that I
> used:https://github.com/Baron-von-Riedesel/Testcases/blob/main/test2.zip
I tried using your binaries and HXRT release 2.21, which i believe is the latest release. I am still getting argc=5 from the win32 version and argc=3 from the dos version.
|
|
| Japheth Germany (South), 23.08.2024, 08:14 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> I tried using your binaries and HXRT release 2.21, which i believe is the > latest release. I am still getting argc=5 from the win32 version and > argc=3 from the dos version. HXRT v2.21 is fine. > C:\test2>echo %OS_NAME% > FreeDOS > > C:\test2>echo %OS_VERSION% > 1.3 I used MS-DOS 7.1 ( Win98SE ) with JemmEx ( Jemm should be irrelevant ). > I tried setting DPMILDR=8 but that didn't seem to make a difference. environment variables DPMILDR and HDPMI don't matter here, since the Win32 binaries are linked relocatable. --- |
|
| bencollver 23.08.2024, 17:34 @ Japheth |
mawk 1.3.4 20240622 for DOS |
> I used MS-DOS 7.1 ( Win98SE ) with JemmEx ( Jemm should be irrelevant ). I tried your binaries in MS-DOS 7.1 and they gave the expected argc=3, where they gave argc=5 on FreeDOS 1.3 and MS-DOS 6.22. |
|
| Japheth Germany (South), 23.08.2024, 19:22 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> I tried your binaries in MS-DOS 7.1 and they gave the expected argc=3, > where they gave argc=5 on FreeDOS 1.3 and MS-DOS 6.22. Ok, got the same result with MS-DOS 6.22. I guess the problem is related to long filenames. Open Watcom encloses the contents of the COMSPEC variable in double quotes, appends the cmd tail ( without quotes ) and finally calls CreateProcess() with this string. The HX emulation code more or less copies this string to the CMDLINE environment variable. MS-DOS 7.1 can handle this, but obviously MS-DOS 6.22 gets confused by the quotes. --- |
|
| bencollver 23.08.2024, 19:53 @ Japheth |
mawk 1.3.4 20240622 for DOS |
> Ok, got the same result with MS-DOS 6.22. > > I guess the problem is related to long filenames. Open Watcom encloses the > contents of the COMSPEC variable in double quotes, appends the cmd tail ( > without quotes ) and finally calls CreateProcess() with this string. The HX > emulation code more or less copies this string to the CMDLINE environment > variable. MS-DOS 7.1 can handle this, but obviously MS-DOS 6.22 gets > confused by the quotes. Thanks for your analysis! I installed 4dos 8.00 on FreeDOS 1.3. Now when i run your test2w.exe example, it gives the expected argc=3. |
|
| bencollver 24.08.2024, 04:55 @ bencollver |
mawk 1.3.4 20240622 for DOS |
I posted mawk134-20240622b.zip This includes mawkx.exe, an OpenWatcom win32 build that will run on HXRT. |
|
| Rugxulo Usono, 24.08.2024, 13:34 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> I posted mawk134-20240622b.zip > > This includes mawkx.exe, an OpenWatcom win32 build that will run on HXRT. Keep in mind several things (from random experience): In some programs (e.g. my fork of paq8o8), I noticed that OpenWatcom's malloc was much less efficient than DJGPP's. UPX'd DJGPP .EXEs run much slower under (e.g. XP) NTVDM. You can usually use WDOSX's "stubit" on OpenWatcom's Win32/PE files to run under DOS natively (since the PE has relocs, which most don't anymore). It will also compress it. However, there is no virtual memory swapping, and you can't undo the changes, so you have to keep a backup of the original. Also, if you shell out from a normal DJGPP (CWSDPMI) program, running a WDOSX program won't work. (Well, probably if you use HDPMI32 instead.) CWSTUB.EXE is public domain with sources and much smaller than DOS4GW.EXE and less limited in memory and should enable SSE for you automatically, but if your app needs 37 MB of RAM and you only have 32 MB, it will swap the ENTIRE 37 MB out (unlike CWSDPMI, which will only swap the small part needed). However, at least Causeway seems to play nice with DJGPP. Both WDOSX and CWSTUB have limited support for .DLL files. |
|
| bencollver 24.08.2024, 18:05 @ Rugxulo |
mawk 1.3.4 20240622 for DOS |
> Keep in mind several things (from random experience): Thank you for sharing from your experiences. I will try to be careful of those dark corners. |
|
| Rugxulo Usono, 25.08.2024, 01:09 @ Oso2k |
mawk 1.3.4 20240622 for DOS |
> > In theory, having only one binary that runs on two (incompatible) OSes > > would be nice (even if relying on external API emulation). > > You mean like APE and Cosmopolitan? > > https://justine.lol/ape.html > https://justine.lol/cosmopolitan/ Believe it or not, her APE build of AWK doesn't run on Windows 7 for me. (Admittedly it's an unsupported and old OS.) |
|
| Japheth Germany (South), 25.08.2024, 07:04 @ Rugxulo |
mawk 1.3.4 20240622 for DOS |
> I don't think it is better. I would almost always prefer DJGPP. I meant "if > you must use HX, stick to OpenWatcom". > In 2008, Japheth recompiled the FTE text editor with HX. There he implied a > "true flat memory model" was better somehow. (For DJGPP, I think for > stability they restricted access to low DOS memory.) He also (rightly) said > DJGPP was a bit bloated, having never been optimized for size, so his way > gave a slimmer binary. Recently I played with FTE a bit (again). And it's true that binaries created with Open Watcom may be pretty slow in memory management, at least if the DOS32 variants ( DOS4/GW and compatibles ) are used. As for FTE, the difference isn't really noticable if small to medium sized files are loaded, but loading a 100 MB file ( with 1.5 million lines ) took about 90 sec for FTE created as OW DOS32 binary, but just 2 secs for a variant linked statically with HX's Win32 emulation. Here's the link so you can do your own tests: https://github.com/Baron-von-Riedesel/FTE/releases --- |
|
| Japheth Germany (South), 03.09.2024, 21:26 @ bencollver |
mawk 1.3.4 20240622 for DOS |
> I installed 4dos 8.00 on FreeDOS 1.3. Now when i run your test2w.exe > example, it gives the expected argc=3. The HX kernel32 emulation has been fixed - now cmdline handling will supply the correct results for non-LFN aware MS-DOS versions ( < v7 ). --- |
Thread view
Mix view