Subject: Re: early results from a Sun-2 port
To: Matthew Fredette <fredette@MIT.EDU>
From: Todd Vierling <tv@wasabisystems.com>
List: port-sun3
Date: 02/20/2001 11:29:50
On Tue, 20 Feb 2001, Matthew Fredette wrote:

: > ...if he's using a different userland, it might be useful to add the
: > emulation of some of the missing m68k insns (that the 68010 doens't have).
:
: I'm not sure this is possible.  When I first started the port, I knew
: about some, but not all of the unsupported instructions and addressing
: modes.  I had to learn about the others the hard way :) I seem to
: remember that there wasn't a good "insert-emulation-here" trap
: happening when the CPU would hit one of these instructions.

The 68010 is missing a lot more than just instructions (which would cause an
Illegal Instruction trap).  It's missing a Lot of important addressing
modes.  Some of those addressing modes will cause traps other than ILLINST,
and still other addressing modes will cause inconsistent behavior on the
680[01]0 without any trap.

A project to emulate much of the 68020's instruction set on a 680[01]0 was
written for the Amiga ages ago, called Emul020 or something like that.  It
may still be on aminet, although I'm not sure if it was in source.
However, with the limited address space available to the 680[01]0 (24-bit
address bus!), it'd be better to compile directly for the 68010's
instruction set and make the higher-end m68k's capable of running the
binaries.

A sidenote:  I don't know if gcc will try to check bits in the CCR directly,
but if so, you may want to check whether it's trying to do the (privileged
on 68010) "move sr,REG", or the (only available on 68010) "movec ccr,REG".
My glances through the 680[01]0 support in gcc seemed to talk only about the
68000 -- there's no different handling for 68010.

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --  http://www.wasabisystems.com/