On Sat, Dec 31, 2016 at 3:27 AM, Nick Downing <downing.nick(a)gmail.com> wrote:
I hadn't seen apout but it is a good idea, I was
toying with doing the same
thing by cross compiling the 2.11BSD kernel to create something like User
Mode Linux (but then adding user mode PDP-11 CPU emulation since it does not
make sense to compile x86-64 2.11BSD userspace executables even though it is
theoretically possible). I don't know how stable is the ABI between Unix V7
and BSD or between BSD versions. I suspect it is very similar but there
would be differences in things like struct stat which are bound to cause
breakage. So I think it has to run the correct kernel to get the correct
ABI, and in turn that kernel has to have null or pass thru drivers to access
the host facilities. I do hope to get this working someday, especially since
a full cross compile of 2.11BSD includes the f77 stuff which cannot
reasonably be compiled on a modern system given the compiler is not written
in C, I think it is PDP-11 assembly.
qemu has a 'user mode' that lets one implement the 'kernel' inside
qemu so that you can execute mips binaries on an x86 with full
awareness of the host's filesystem, but with enough 'special case
hooks' that things like shared libraries use the mips .so rather than
the x86 .so. It emulates a bunch of systems, but none of them
pdp-<anything>. It has both BSD and Linux user-mode support, and
FreeBSD uses it to build armv7, armv8, mips and powerpc packages on
x86_64 hosts.
Warner