a.out's under MacOS

William Roberts liam at cs.qmw.ac.uk
Thu Mar 1 08:45:36 AEST 1990


In article <969 at panix.UUCP> jsb at panix.UUCP (J. S. B'ach) writes:
>What would it take to run a A/UX binary under MacOS?  What I have in
>mind is the opposite of the A/UX 'launch' command, or maybe geting a
>unix executable to run at the push of a Hypercard button?

First things first, your A/UX binary would have to use only
MacOS Manager calls and Toolbox calls, because there won't be
an A/UX kernel to handle the normal system calls.

To use A/UX as a cross-compilation system with some local
try-it-and-see capability, you would need an extensively
modified C compiler. The reason is as follows:

A/UX processes run in a virtual address space where the program
always starts at address 0 (or thereabouts) and never has to
live at a different address. MacOS code runs without the aid of
a memory management unit to translate addresses, so must be
prepared to operate no matter what address its code and data
are stored at. This is called *Position Independent Code* and
is mostly done by making all data references use offsets from a
base register (A5 isn't it?).

So you'd need a different C compiler which generates the right
kind of code, and the Unisoft compiler bundled with A/UX won't
do. You could conceivably alter gcc to do this though.

Finally, Mac binaries are organised in a different way which I
don't understand, but which involves collections of small
pieces which are stitched together when the application is
loaded into memory. The best place to start with suitably
compiled code under A/UX is actually the dot-oh files rather
than the linked binaries, and provide a completely different
linker.


I personally believe that this is a worthwhile thing to be able
to do, but it may just happen automatically if and when MPW
works under A/UX. Can anyone from Apple say if having a version
of MPW which runs under A/UX is one someone's list of things to
do in Cupertino, or should we developers try to make some money
here?
-- 

William Roberts                 ARPA: liam at cs.qmw.ac.uk
Queen Mary & Westfield College  UUCP: liam at qmw-cs.UUCP
Mile End Road                   AppleLink: UK0087
LONDON, E1 4NS, UK              Tel:  01-975 5250 (Fax: 01-980 6533)



More information about the Comp.unix.aux mailing list