This is a beta Win64 x64 EBCDIC mini-clone
produced by Paul Edwards and available from https://pdos.org


Note that despite its name, bios.exe is a Linux x64 executable,
so you will need to do a chmod 755 bios.exe (no need for the
others, they aren't Linux executables) and then:
./bios.exe pdos fba1b1.vhd
(pcomm.exe should be in the same directory and will
automatically be loaded)

You can use "dir", "type", "copy", "del" etc.

Also "hexdump" and "mcc" are executables provided.

Almost everything else is junk from a z/PDOS-generic
distribution.

You can do this:

del foo.asm
type foo.asm
type foo.c
mcc foo.c
type foo.asm

to see the compiler in action.

And:

hexdump foo.asm

to see the line endings are clean x'15'.


Notes ...


gcc 15.2.0 was used on a Debian Linux x64 machine, with
the following patch (released to the public domain) to
libcpp/charset.cc :

654a655,657
>       char *out_before = outbuf;
>       char *out_after;
>       char *out_p;
655a659,664
>       out_after = outbuf;
>       while ((out_p =
>               (char *)memchr(out_before, 0x25, out_after - out_before)) != NULL)
>       {
>           *out_p = 0x15;
>       }

in order to get EBCDIC newline as x'15' instead of x'25'.

Then built with:
./configure --target=x86_64-mingw64 --disable-multilib --enable-languages=c
make


The utilities available at pdos.org called linbinx64.zip
were used as well, and the following makefiles were run:

pdpclib/makefile.leb
generic/makebios.leb
pdpclib/makefile.leo
generic/makefile.leb
src/makek32.web
pdpclib/makefile.web
generic/makecomm.web

The only example executable provided on the fba1b1.vhd is dos\hexdump.exe
Everything else you see is basically junk from the zpg.zip disk.

This EBCDIC Windows mini-clone is designed to run with the
assistance of a pseudobios. Conceptually just like the IBM
PC XT came with, but you can simply "say I don't like theirs,
so came up with my own, but don't have the tools required to
burn an EPROM, so I need to still ultimately use theirs for
some primitive operations, and to activate my own". Or as
the case may be - I treat Linux as a glorified IBM PC bios.
I still don't like theirs either, so same deal. And one of
the things I don't like about it is that it is in ASCII
instead of EBCDIC, so no problem, I modified my own C library
to switch character sets before interacting with the Linux system.
Same deal that I wanted Microsoft calling convention (first
parameter in rcx etc), rather than Linux's calling convention,
so no problem again - that is switched at the time I do any
Linux syscall - in the assembler portion of the C library.

Currently I have only provided a pseudobios for Linux x64,
but standalone UEFI should be possible, and indeed, it
should be possible to run under MacOS and Windows too, with
a suitable pseudobios.

There is an issue "with the compiler", which made me have to
switch from -O2 to -O1 as per comments in generic/makefile.leb
It is now believed that that can be bypassed by using the
-mno-sse compiler option, which is what was needed for mcc.

Note that this is not emulation. The "Windows" EBCDIC
PE/COFF executables run at full native x64 speed.

So if you want to process EBCDIC data (including mixed binary
and text, that can't be easily converted to ASCII) from a
mainframe, you can do it something like 50 times faster than
emulating a mainframe.

It depends what you want to do. Some tasks involve searching
data - potentially historical data, so this might be useful
for that.

hexdump.exe was created by doing:
cp hexdump.c pdptest.c
pdmake -f makefile.web

It was placed on the VHD by using the z/PDOS-generic distribution,
going to the "tapes" directory, copying hexdump.exe there, and
then on my Windows 2000 system I used mfemul.exe from the
PDOS/386 distribution (pdos.zip) to do:
mfemul pdos.exe ..\fba1b1.vhd
cd dos
copy :hexdump.exe hexdump.exe
exit

But you can actually do the same thing with the base
distribution, so mcc.exe was placed on the disk by
doing:

cd pdos/mcc
pdmake targ=winx64e -f makefile.std
./bios pdos fba1b1.vhd
cd dos
copy :mcc.exe MCC.EXE
exit


The C compiler almost certainly has more ASCII character set
hardcodings embedded in it, so it is currently unknown how
much it will actually compile in the EBCDIC environment.
But the sample foo.c matches the ASCII PC.

Everything is still a work in progress, and the hope is that mcc.c
can be ported to EBCDIC so that you have a C compiler available.
It's unclear what it's limitations are. The other tools in the
toolchain are believed to already work on EBCDIC, but need to be
retested.
