Skip to content

Another Couple of Ideas #24

@DoctorWkt

Description

@DoctorWkt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions