[comp.sys.m68k] How plug compatible is 68010?

bill@bcsfse.UUCP (Bill Sears) (07/19/88)

****
    I have a UNIX computer with a 68000 processor.  I have heard that
the 68000 has a problem with restarting an instruction and thus virtual
memory systems are impossible (??).  I have also heard that the 68010
corrects the bug in the 68000, and that it is plug-compatible.  What I'm
wondering is, is it really 100% pin-compatible with the 68000?  Can I buy
a 68010, replace the 68000 in my computer and still run all of the exist-
ing software and have everything work?  Is it that easy?

    I know that there are other considerations for virtual memory operations.
All I'm interested in right now is whether it is possible to just swap
processors.
-- 
	Bill Sears            ...!uw-beaver!ssc-vax!voodoo!bcsfse!bill
			FSE development project
	Do-it-yourselfers motto:  "Shit!! That broke easy."

daveh@cbmvax.UUCP (Dave Haynie) (07/20/88)

in article <224@bcsfse.UUCP>, bill@bcsfse.UUCP (Bill Sears) says:

>     I have a UNIX computer with a 68000 processor.  I have heard that
> the 68000 has a problem with restarting an instruction and thus virtual
> memory systems are impossible (??).  I have also heard that the 68010
> corrects the bug in the 68000, and that it is plug-compatible.  

The 68000 has a design flaw, in that it was never designed to handle virtual
memory.  In that the bus error exception used to indicate a page fault doesn't
save enough information to restart or continue the instruction.  There have 
been novel ways around this -- Apollo used two 68000s in some of their
earlier machines, but without some kind of special hardware you're SOL trying
to implement virtual memory on a 68000.

Fortunately, the 68010 does it right.  It actually uses instructuion 
continuation rather than restart.  And the fact that it works immediately
implies one software difference between it and the 68000 -- the exception
stack that you get from a bus error is longer, in that it's saving internal
context stuff that's necessary to continue the instruction after you RTE.

The other software difference is based in support for virtual machines.  The
68000 lets a User-mode program execute the MOVE SR,<ea> instruction.  If you're
building an operating system or some-such under a 68000, that OS will be able
to tell that it's not really running in Supervisor mode via the MOVE SR 
instruction.  On the 68010, that instruction causes an exception in User mode,
so that the actual results of that instruction to a User mode program are
defined by the Supervisor program.  And the 68010 add the MOVE CC,<ea> 
instruction to let a User mode program at the condition codes it's allowed to
look at.

> What I'm wondering is, is it really 100% pin-compatible with the 68000?  

Yup.

> Can I buy a 68010, replace the 68000 in my computer and still run all of the 
> existing software and have everything work?  Is it that easy?

Probably depends on your system.  If no one's using MOVE SRs, you'll be OK.  If
you can add an exception handler that'll handle MOVE SRs, you'll still be OK.
If your system uses bus error for something and doesn't know about 68010 type
exceptions, you may be in trouble.  It works OK on an Amiga, but the Amiga OS
know about the 68010 differences.  It may or may not work on other 68000 based
computers, depending on what their software does.

> 	Bill Sears            ...!uw-beaver!ssc-vax!voodoo!bcsfse!bill
> 			FSE development project
> 	Do-it-yourselfers motto:  "Shit!! That broke easy."
-- 
Dave Haynie  "The 32 Bit Guy"     Commodore-Amiga  "The Crew That Never Rests"
   {ihnp4|uunet|rutgers}!cbmvax!daveh      PLINK: D-DAVE H     BIX: hazy
		"I can't relax, 'cause I'm a Boinger!"

knurlin@trwspf.TRW.COM (Scott Karlin) (07/21/88)

In article <224@bcsfse.UUCP> bill@bcsfse.UUCP (Bill Sears) writes:
>I have a UNIX computer with a 68000 processor.  I have heard that
>the 68000 has a problem with restarting an instruction and thus virtual
>memory systems are impossible (??).

Yes, here's the problem:
     If you have a virtual memory system and try to execute
     an instruction like:  MOVE.L (A0)+, (A1)+    you are
     asking for trouble if (A0) is in the physical memory
     and (A1) is not.  The 68000 (and 68010) will fetch (A0),
     then increment A0, then write to (A1), and then increment
     A1.  If your memory management unit generates a bus
     error for the write to (A1), A1 will not be incremented.
     The 68000 does not save enough information on the stack
     about its internal state to be able to jump back to the
     middle of the instruction after the bus error routine
     swaps the memory block containing (A1) into the physical
     memory space; the 68010 does.

>I have also heard that the 68010
>corrects the bug in the 68000, and that it is plug-compatible.  What I'm
>wondering is, is it really 100% pin-compatible with the 68000?

Yes, you can put a 68010 into a 68000 and the HARDWARE will
work fine.  They are 100% hardware compatible.

>Can I buy a 68010, replace the 68000 in my computer and still run
>all of the existing software and have everything work?  Is it that easy?

Maybe...Maybe not.  Here are two reasons:
     1.  Because the 68010 puts more stuff on the stack during
     2.  On the 68000 the MOVE SR,D0 instruction is not a
         priveledged instruction; it is priveledged on the
         68010.  This means that any code that is running
         in the user mode cannot attempt to execute this
         instruction without generating a priveledge violation
         exception.

>I know that there are other considerations for virtual memory operations.
>All I'm interested in right now is whether it is possible to just swap
>processors.

Like I said, maybe...maybe not.  You won't hurt your hardware
but your software might not work.  If you have access to all
of the source code, it shouldn't be too hard to fix it for
the above problems.  One more thing, if you are not using VM,
then the extra 5% or so increase in speed is probably not
worth the effort in my opinion.

>	Bill Sears            ...!uw-beaver!ssc-vax!voodoo!bcsfse!bill
>			FSE development project


-- 
-- Scott Karlin
   TRW, Bldg O2-1761, One Space Park, Redondo Beach, CA 90278
   USENET:  knurlin@trwspf.trw.com     Phone:  (213) 535-3785
            {sdcrdcf, scgvaxd, ucbvax}!trwrb!trwspf!knurlin

pl@tut.fi (Pertti Lehtinen) (07/24/88)

From article <224@bcsfse.UUCP>, by bill@bcsfse.UUCP (Bill Sears):
> ****
> 
>     I know that there are other considerations for virtual memory operations.
> All I'm interested in right now is whether it is possible to just swap
> processors.

	At least with Amiga-500 it is possible to just swap prosessors.
	Hardware compatibility is ok.

	Main problem is software which has some differencies:

		1) Exception stack frames are different

		2) Moving from CCR is made privileged instruction

	Point 1 is at least in Amiga handled is opsys, although
	some problems arise in some extra drive handling.

	Point 2 is totally upto programmer.
	Instruction may be avoided or emulated if needed


-- 
pl@tut.fi			! All opinions expressed above
Pertti Lehtinen			! are preliminary and in subject
N 61 26' E 23 50'		! to change without any further notice.

ge@hobbit.sci.kun.nl (Ge' Weijers) (07/26/88)

From article <224@bcsfse.UUCP>, by bill@bcsfse.UUCP (Bill Sears):
>     I have a UNIX computer with a 68000 processor.  I have heard that
> the 68000 has a problem with restarting an instruction and thus virtual
> memory systems are impossible (??).  I have also heard that the 68010
> corrects the bug in the 68000, and that it is plug-compatible.  What I'm
> wondering is, is it really 100% pin-compatible with the 68000?  Can I buy
> a 68010, replace the 68000 in my computer and still run all of the exist-
> ing software and have everything work?  Is it that easy?
> 
It might be pin-compatible, but it is NOT software-compatible. The stack-
frame after a bus error for example is different (there was not enough
information to restart the instruction in the 68000 stackframe)
Operating systems might have trouble with the changed stackframe.
(it is possible to write the exceptionhandlers in such a way that this
is not a problem)


-- 
Ge' Weijers, Informatics dept., Nijmegen University, the Netherlands
UUCP: {uunet!,}mcvax!kunivv1!hobbit!ge