M68020 and 4-byte alignment

Jan Edler edler at cmcl2.NYU.EDU
Tue Feb 28 05:07:39 AEST 1989


In article <1361 at atari.UUCP> achar at atari.UUCP (Alan Char) writes:
>I am interested in experiences people have had converting a UNIX system
>(operating system and utilities/applications) from 2-byte aligned to
>4-byte aligned, specifically, when upgrading from a 68000 environment to
>a 68020 environment.

We did this, but for a 68010 system, not a 68020 one.  Our motivation
was peculiar to our hardware (experimental shared memory
multiprocessor) - we built hardware to make loads and stores of
properly aligned longs atomic.

Anyway, other than recompiling everything, I don't recall the change
being terribly difficult.  We had to be careful to make all the
necessary compiler changes (e.g.  make sure automatics are properly
aligned), but that wasn't too bad.  I don't remember too many instances
of user code that had to change; there may have been a couple things in
the library, but they weren't hard to find.  For example, the user-level
signal handling code and the kernel trap handling code have to be
careful to maintain stack alignment properly.

The most difficult aspect of it is probably the complete
incompatibility of the change.  In general, you can't trust binaries
from before the changeover.  Also, we use cross compilers a lot, and it
is annoying that we need a special cross compiler, we can't use just
any old 68k cross compiler (e.g. one that also works for 68k-based
workstations or single-board computers).

We never looked into the question of how much faster the machine runs
with proper alignment, but I suppose it could be noticeable.

Jan Edler
NYU Ultracomputer Research Laboratory
(212) 998-3353
edler at nyu.edu
...!cmcl2!edler



More information about the Comp.unix.wizards mailing list