I have at last gotten Unix to boot to multi-user mode in FreeBee (Philip
Pemberton's 3B1/UNIX PC emulator). The fixes required are for bus error
handling (instructions were still sometimes changing memory and
registers after a page fault even though I had already partially fixed
it before; I now have it saving the registers before every instruction
and pushing those on page fault similar to what current MESS does - this
isn't actually what a real 68k does and may sometimes throw off register
dumps but it does work; I also have it using longjmp to immediately stop
any instruction that page faults), as well as zero page access (another
thing that I had tried to fix before; I had previously only allowed
reads from address 0, but some programs are expecting to read from
higher addresses in the zero page, so I now allow reads from all zero
page addresses). Another bug that I fixed was related to timing. The
emulator was way slower than real-time on the non-Linux OSes that I
tried (many of them impose a minimum on the amount of time a process can
sleep, and the emulator was depending on being able to sleep for very
short times, so I changed it to use longer sleeps). Unix would
presumably boot multi-user without this fix though.
However, the emulator is still not quite usable. The key mapping is not
quite right (one problem is that the UNIX PC has separate "return" and
"enter" keys, and there is no mapping for "enter", which is required
to
accept dialogs, and there might be other important keys that are
missing). Also, neither the mouse nor the RTC are emulated yet.
Here's a screenshot:
http://imgur.com/GzWkUbs
I'll post my patches very soon.