Chris, I thought I'd pitch a couple of other ideas at you, based on what I've done with my own syscall emulators.
A Change to MINIXCOMPAT_DIR
Instead of the existing MINIXCOMPAT_DIR and MINIXCOMPAT_CWD behaviour, how about this:
- If the MINIX filename starts with '/', prepend
MINIXCOMPAT_DIR to it, e.g. /bin/ls becomes /home/wkt/ST1.5/bin/ls.
- If it doesn't start with '/', leave it untouched.
This way, you can run a MINIX binary anywhere, you don't have to be somewhere under MINIXCOMPAT_DIR. E.g. I could be in my $HOME and do
$ MINIXCompat ST1.5/bin/ls -l
and the Minix ls will list the things in my $HOME.
Allow exec() on Native Binaries
Sometimes you want a tool that isn't in the emulated environment, e.g. ssh. So, set up a link:
$ cd $MINIXCOMPAT_DIR/usr/bin
$ ln /usr/bin/ssh ssh
You now have a native binary sitting next to all the ST MINIX binaries.
Now, change the emulator. When it tries to exec() the ssh binary, this fails as the magic numbers are wrong. But, before you report the failure, actually do a real native exec() on the binary. This will work and the emulator will get replaced with the ssh program.
Thus, you can run native binaries from within the emulated MINIX environment.
Chris, I thought I'd pitch a couple of other ideas at you, based on what I've done with my own syscall emulators.
A Change to
MINIXCOMPAT_DIRInstead of the existing
MINIXCOMPAT_DIRandMINIXCOMPAT_CWDbehaviour, how about this:MINIXCOMPAT_DIRto it, e.g./bin/lsbecomes/home/wkt/ST1.5/bin/ls.This way, you can run a MINIX binary anywhere, you don't have to be somewhere under
MINIXCOMPAT_DIR. E.g. I could be in my$HOMEand doand the Minix
lswill list the things in my$HOME.Allow
exec()on Native BinariesSometimes you want a tool that isn't in the emulated environment, e.g.
ssh. So, set up a link:You now have a native binary sitting next to all the ST MINIX binaries.
Now, change the emulator. When it tries to
exec()thesshbinary, this fails as the magic numbers are wrong. But, before you report the failure, actually do a real nativeexec()on the binary. This will work and the emulator will get replaced with thesshprogram.Thus, you can run native binaries from within the emulated MINIX environment.