Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 May 2009 17:56:16 -0400
From:      Chuck Robey <chuckr@telenix.org>
To:        Alfred Perlstein <alfred@freebsd.org>
Cc:        FreeBSD-Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: porting info for FreeBSD's kernel?
Message-ID:  <4A15CE00.4040600@telenix.org>
In-Reply-To: <20090521003646.GS67847@elvis.mu.org>
References:  <4A11B893.1000808@telenix.org> <20090521003646.GS67847@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Alfred Perlstein wrote:
> * Chuck Robey <chuckr@telenix.org> [090518 13:03] wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> I've been googling, trying to see if I can find notes regarding what needs
>> changing, in what order, to adapt the FreeBSD kernel to a new processor.  Anyone
>> know where stuff like that can be found?
> 
> You need a cross compile toolchain of course, look into how FreeBSD
> is configured for the various arches.
> 
> Then I would suggest looking at the loaders, followed by 
> kern/init_main.c.  If you trace down init_main.c and some
> of the early sysinits that should give you an idea.
> 
> You might also be able to backtrack using CVS/svn to follow
> how mips or arm was done.
> 
> Note: freebsd has a decent cross-compile setup now, see
> "make universe" so things should be easier to get started.
> 

Thanks.  I will *definitely* read all the parts you hint me at, I won't be
deleting this mail, and I appreciate it.  I was asking on the llvm maillist
about Cortex-A8 support.  What I got says that it's not there yet, but it's
being worked upon, that and the -A9 support (definite differences).  So, any
crosstools needed today would have to be gcc, from a version at least as new as
the 4.3 branch (that's where they brought in the -A8 support).

The tool I got by doing the freeBSD crosstools was 4.2.1, which isn't going to
do it for the Cortex-A8, and I had someone else (from a FreeBSD list) tell me
that bringing in a newer version of gcc wasn't extremely likely, that they'd
want llvm instead.  I see 3 alternatives for a Cortex-A8 port: using a new gcc
port, waiting on the upgrade of llvm, or maybe deciding that the version the
llvm that's out now, with the v6 compatibility, would be (for the short term)
good enough.  Any idea which one to choose?  The only one that interests me is
for the TI OMAP 3530 (Cortex-A8, among other parts).  Maybe if the currently
available llvm is good enough, maybe gcc-4.2.1 may creak along well enough for
the short term?  I need to understand this.

My own personal Pandora won't probably won't arrive on my doorstep for maybe as
long as 3 more months, so in the meantime, I think I will be reading all I can
get my hands on regarding llvm.  Maybe I can really learn enough to make a
difference.  In school, I concentrated very definitely on OSes (I've written 3
of them over the years, of quite varying levels of performance), so for
compilers, I'm relying on my old 1988 version of the Aho/Sethi/Ullman compilers
book.  If anyone knows a more modern book that will show me enough about
compilers to be useful, I'd really appreciate the name, maybe Amazon will let me
get a cheap used version.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A15CE00.4040600>