From: tom@afthree.as.arizona.edu (Thomas J. Trebisky)
Newsgroups: comp.unix.bsd
Subject: Re: 680x0 version of 386BSD?? [Was: Re: Mac version of 386BSD??]
Date: 19 Aug 92 22:24:43 GMT
Organization: University of Arizona, Tucson, AZ

A number of people have posting queries about porting 386BSD to 680x0
boxes.  I have been fiddling with this for some time and am still hot
on the trail.

There are a number of things to think about.  First is the target system.
How well documented is it down at the nitty gritty level?  Can you get all
the i/o port addresses, bit definitions, and nasty ugly detail level docs
that you need.  (You think you can, but don't believe it till you have them.)
Gather up data books on all the i/o controller chips you think you will need
to deal with, etc.  I rule out sun3 machines because no-one I know has the
nasty level docs on these (but you can just run SunOS, so who cares).

Second is the cross-compiler and what kind of system you will use to host
the development.  Can you use the native machine and partition the disk or
something (not me baby, for half a dozen reasons)? I have settled on using
gcc and hosting things on a sparc.  Well actually, I do that, and also use
a cross-compiler gcc/bsd environment I set up on a 3b1, so I can work at
home.

Next issue is cross-development tools.  How can you write a bootable disk
or in some way get executables into your target system.  How well do
you understand how the boot roms on your target work. How can you build
a filesystem floppy and put files into it (I have set up a cross-mkfs and
mkproto to do this, I think others have had compatible filesystems so they
could just use the native mkfs on their host system and mount the resulting
floppy and copy files into it, this wouldn't work for me).

Given the appropriate set of cross development tools (did I forget to
mention a cross linker -- I have used the gnu binutils "ld" program),
you might want to think about kgdb (I have thought about it, haven't taken
the time to set up a cross - gdb - remote debugger, but it can be done and
folks recommend it enthusiastically).  You will somewhere along the way
need to start writing the standalone device drivers.  This is about where
I am now.  I can generate a floppy that has a BSD filesystem and some
standalone stuff in it (including a standalone boot, and a hard drive
formatter -- there is something else to think about, disk formatters).

And I can boot a stubbed out "kernel" -- well at least it has some of
locore.s and can field interrupts from a variety of sources.  Now I am
looking hard at the Mach vm/* stuff and thinking about how to recode
pmap.c for my machine.  Not to mention, I want to *understand* the stuff
in the mach vm/ directory (like what are maps, objects, pagers, ....).
This would be a non-issue if I was targetting the 68030 -- as I intend to
eventually, but I am working on a system with a custom MMU.

Once the vm/ stuff settles down (well, kindof alongside if you want to
do any swapping), you will start needing device drivers....

Also, you will probably want to beat the config program into shape for
your chosen target (you could hand edit the makefiles and put this off
till later).
--
	Tom Trebisky	ttrebisky@as.arizona.edu
...."There's no sense in being precise when you don't even
.... know what you're talking about." 
                       - John von Neumann