1
Programming / native mainframe mini-clone
« on: September 07, 2025, 12:59:53 pm »
I have previously posted here and mentioned that PDOS/386 from pdos.org supports the OS/2 API to a limited extent (enough to run C90-compliant programs).
I have 3 distinct (complete rewrites - sort of) versions of PDOS. One is PDOS-generic - which is portable.
So to put that "portable" claim to the test, I have it running on multiple environments, including the mainframe (z/Arch).
And because it turns out that the basic APIs can be written in terms of C90 (sort of), e.g. DosRead() calling fread() on another environment, it stands to reason that it should be possible to get OS/2 working on z/PDOS-generic.
It's not as simple as it sounds (mainly getting the tools
into shape), but it was indeed possible.
Here is what it looks like (not especially that the "LX" is
in EBCDIC, which is what the mainframe traditionally
uses):
enter a command
hexdump os2.exe 0 100
about to call app at address 04F0C680
000000 D4E90000 00000000 04000000 00000000 MZ..............
000010 00000000 00000000 40000000 00000000 ........ .......
000020 00000000 00000000 00000000 00000000 ................
000030 00000000 00000000 00000000 40000000 ............ ...
000040 D3E70000 00000000 02000100 00000000 LX..............
000050 00020000 13000000 01000000 14C80000 .............H..
000060 02000000 ....
return from app is hex 0
enter a command
os2 abc def
about to call app at address 04F2D3E4
welcome to pdptest
main function is at 04F21ED0
allocating 10 bytes
m1 is 04ECE7E4
allocating 20 bytes
m2 is 04ECE834
stack is around 00080E78
printing arguments
argc = 3
arg 0 is <os2>
arg 1 is <abc>
arg 2 is <def>
return from app is hex 0
enter a command
Note that this is native z/Arch (or S/370) instructions, not 80386.
I also have the Windows API, including msvcrt.dll, for smaller executables.
Available at https://pdos.org/zpg.zip
You'll need an appropriate emulator (unless you have real hardware) - I provide Hercules/380 and mfemul.
I believe OS/2 was ported to other non-80836 environments, but not the mainframe.
If anyone is interested and wants more information, please let me know.
BFN. Paul.
I have 3 distinct (complete rewrites - sort of) versions of PDOS. One is PDOS-generic - which is portable.
So to put that "portable" claim to the test, I have it running on multiple environments, including the mainframe (z/Arch).
And because it turns out that the basic APIs can be written in terms of C90 (sort of), e.g. DosRead() calling fread() on another environment, it stands to reason that it should be possible to get OS/2 working on z/PDOS-generic.
It's not as simple as it sounds (mainly getting the tools
into shape), but it was indeed possible.
Here is what it looks like (not especially that the "LX" is
in EBCDIC, which is what the mainframe traditionally
uses):
enter a command
hexdump os2.exe 0 100
about to call app at address 04F0C680
000000 D4E90000 00000000 04000000 00000000 MZ..............
000010 00000000 00000000 40000000 00000000 ........ .......
000020 00000000 00000000 00000000 00000000 ................
000030 00000000 00000000 00000000 40000000 ............ ...
000040 D3E70000 00000000 02000100 00000000 LX..............
000050 00020000 13000000 01000000 14C80000 .............H..
000060 02000000 ....
return from app is hex 0
enter a command
os2 abc def
about to call app at address 04F2D3E4
welcome to pdptest
main function is at 04F21ED0
allocating 10 bytes
m1 is 04ECE7E4
allocating 20 bytes
m2 is 04ECE834
stack is around 00080E78
printing arguments
argc = 3
arg 0 is <os2>
arg 1 is <abc>
arg 2 is <def>
return from app is hex 0
enter a command
Note that this is native z/Arch (or S/370) instructions, not 80386.
I also have the Windows API, including msvcrt.dll, for smaller executables.
Available at https://pdos.org/zpg.zip
You'll need an appropriate emulator (unless you have real hardware) - I provide Hercules/380 and mfemul.
I believe OS/2 was ported to other non-80836 environments, but not the mainframe.
If anyone is interested and wants more information, please let me know.
BFN. Paul.