Open ccodere opened 5 years ago
The interpreter seems to implement Unix v7 system calls. util/int/monstruct.c seems to convert structs, but I don't know if it works.
The em22 headers are missing most of the struct declarations. My commit 0131ca4 of 2012 deleted the old sys/stat.h (struct stat) and sgtty.h (struct sgttyb, struct tchars). I believed that someone else had deleted them before me, but the conversion from CVS to Mercurial lost the deletion. David Given added sys/times.h (struct tms) in 538eefb of 2018. There were never declarations of struct ltchars or struct timeb in public headers, or I can't find them in our Git history.
The interpreter "int" monitor call module simply calls directly the underlying POSIX API of the host that the interpreter is running on.
This of course could lead to subtle errors, such as running an em22 application on a 32-bit or 64-bit system, the host range of structures and widths of types could be different than what is expected in the interpreter specification.
A possible solution would be to convert the host system datatypes and structures to the representation required by the interpreter.
A possible limitation to impose would also be that "int" can only run EM e.out binaries that has a wordsize less or equal than the host. e.g: running an em44 binary would not be allowed on a 16-bit word sized host machine.