When Keykos migrated to other systems the legacy software that we needed was available for Unix. Alan Bomberger had an uncanny feeling for what was expected by programs running in a Unix process. He wrote a user mode program that served as the domain keeper of a domain whose address space matched that of a Unix process. When the program in that space executed a Unix system call, the emulator (domain keeper—Alan’s program) would think ‘Unix kernel’ and do the right thing for the program that was designed for Unix. After a remarkably short series of (run the program; see what the next unsupported system call is; implement that call); the C compiler began to compile. All of this without much in the way of grand planning. We even tamed some Unix utilities for which we lacked the source by taking a bit image of the loaded utility. Our X windows came about this way.
One note here is that the Keykos segment concept served well to model the concept of the content of a Unix file. This allowed the input and output of a compilation to map directly to what was natural to Keykos.
That the emulator had access to low-level Keykos primitives which were somewhat like the underlying hardware, facilitated emulation, since the Unix kernel emulator had available functionality like the real Unix kernel.