Discussion:
different MZ extension
(too old to reply)
muta...@gmail.com
2022-11-25 09:47:23 UTC
Permalink
If we had a 32:32 segmented system, to access more
than 4 GiB on a system with only 32-bit registers,
MZ is probably an appropriate executable format.

Ditto a 1024:1024 segmented system.

And I guess a.out will suffice for a non-segmented
system.

I'm not sure if it is desirable to have one executable
format that does both segmented and unsegmented.

ie would the simplest (similar to MZ and a.out) executable
format, that does both segmented and non-segmented,
be a good idea as a replacement for both MZ and a.out,
assuming we were having this conversation in 1950?

BFN. Paul.
muta...@gmail.com
2022-11-25 20:13:42 UTC
Permalink
One change that may be appropriate for MZ is for the
start identifier to be of type "int" rather than a character
string, and to have two of them.

So if the identifier is x'1234' then on a 32-bit big-endian
system you would see:

00 00 12 34 00 00 12 34

That way you can tell that it is 32 bits instead of e.g. 1024 bits.

If it was little-endian you can't tell where the integer stops
unless you have a second one.

So the loader would first compare two "int" and then say
"wrong size int" if an executable for one system was used
on another.

BFN. Paul.
muta...@gmail.com
2022-11-25 20:35:46 UTC
Permalink
Actually I could dump not just int, but also short,
long, void *, char * and function pointers in an
attempt to make sure the sizes all match.

The pointers may not be relevant to MZ, as
segmentation allows for mismatches.

And a.out probably requires they all be the same.

If pointers are dumped I assume they need to
appear between two int identifiers in order to be
able to figure out the length, as they will just be
NULL pointers.

Maybe such identity checking is not very useful
though, as a 32-bit ARM and 32-bit 80386 executable
will look the same from the header.

I don't want to get involved in different identifiers for
different platforms. This is PDOS-generic designed to
run on everything, like 1024-bit systems that haven't
been built yet. I don't want space aliens digging up
my grave 7 million years from now asking me to
assign an identifier for their new 1024-bit computer.
The code already works. Ritchie designed a language
designed to last for eternity. The language ISO
managed to make an abortion of in just 9 years
(ie C99 vs C90).

BFN. Paul.

Loading...