Subject: Re: tos utilities
To: None <hyc@troy.la.platsol.com>
From: maximum entropy <entropy@zippy.bernstein.com>
List: port-atari
Date: 12/10/1997 18:18:24
>From: hyc@troy.la.platsol.com (Howard Chu)
>
>  I think it would be nice if I could compile the TOS utilities
>  (loadbsd.ttp, aptck.ttp, etc) for NetBSD/atari under NetBSD, instead
>  of requiring a cross-compilation setup or compilation under MiNT.
>
>  There is precedent for this sort of thing:  under NetBSD/i386 the DOS
>  utilities such as dosboot.com and netboot.com are compiled in a NetBSD
>  environment.
>
>  As a proof-of-concept, I've managed to compile a "hello, world"
>  program under NetBSD/atari and run it through an aout2tos conversion
>  program I wrote, similar to the elf2aout and elf2ecoff utilities used
>  under NetBSD/pmax.
>
>  Actually getting real programs to compile in this manner would be a
>  lot of work.  Does anyone else think this is a good idea?  If so, i'll
>  persue it further.  I'd hate to do all the work only to find out that
>  it would never be integrated into the tree.
>
>Why are you reinventing the wheel? The GNU utilities that were ported
>to TOS already handle this. gas for Atari puts out a.out files, it's
>ld that binds it into TOS format executable. What you want to do is
>exactly the same as setting up a cross-compilation environment, and the
>existing tools already do exactly what you need.
>  -- Howard

To a certain extent it is reinventing the wheel.  But the new wheel
was written from scratch and is not encumbered by a GNU copyleft,
which makes it more suitable for distribution in the NetBSD tree.

I'm not actually reinventing *all* of the wheel:  I haven't written an
entire TOS ld.  What I'm doing is compiling the code with the NetBSD
cc, then loading it with the NetBSD ld using the "-r" flag to retain
the relocation information.  This "pre-linked" binary is then run
through aout2tos, which converts the a.out exec header to a TOS aexec
header, copies the text and data segments, and converts the relocation
inforation to TOS format.

The goal I have in mind here is to provide a system where a user would
not need to collect together little bits and pieces from here and
there to compile a fully functional NetBSD/atari system from source.
As it is one needs to set up cross-compilation (or at least
cross-linking), get the MiNT libraries if one doesn't already have
them, collect the XHDI source from somewhere and turn it into a
library, install gmake if you don't already have it, etc etc.  In my
opinion this is very unclean compared to the NetBSD/i386 system, where
I can simply type "cd /sys/arch/i386/stand && make cleandir && make
depend && make && make install" and out pops a new copy of dosboot.com
in /usr/mdec along with the bios bootblocks.  Similarly, I don't need
to set up an ULTRIX cross-compilation or cross-linking environment to
build an a.out or ECOFF standalone kernel under NetBSD/pmax that can
be booted from the pmax boot PROMs.

I see no reason not to support the same type of thing in the
NetBSD/atari tree, except that it will take some work to get it right.
Most of the work would involve figuring out some minimal subset of the
MiNTlibs and headers, and XHDI code, that we would need in the tree to
support this.  Since all the required code is public domain, this
should not be problematic with respect to distribution restrictions.

>(PS: howdy, entropy - I see you've left MIT!)

Hi!  Actually I was never at MIT (not as a student, at least).
entropy@gnu.ai.mit.edu was a guest account (which I no longer seem to
be able to access even though the account still exists.)  It's good to
see a familiar face from the past on the NetBSD/atari list.  I was
actually thinking about you only moments before I got your message, as
I was compiling up your port of ARC under NetBSD/atari :-)

Cheers,
entropy

--
entropy -- it's not just a good idea, it's the second law.