porting info for FreeBSD's kernel?

Alfred Perlstein alfred at freebsd.org
Sun May 24 04:04:32 UTC 2009


* Chuck Robey <chuckr at telenix.org> [090522 07:09] wrote:
> Alfred Perlstein wrote:
> > I wouldn't sweat the compiler as much as the actual OS code, I think
> > it should be relatively easy to trick the build to use an external
> > compiler (ie, don't get caught up in the compiler bootstrap quagmire,
> > leave that for later...)
> > 
> > Anyhow, you're talking to someone that has studied, but not implemented
> > a port, so take my advice with a few heaps of salt. :)
> > 
> > Typically what people focus on is:
> > 
> > 1) "how am I going to get the first line of dmesg to come up"
> > 2) "how am I going to get to single user mode"
> > 3) "multi user?"
> > 4) cleanup of compiler and bootstrap issues.
> > 
> > If you get sidetracked by #4, you can spend months doing that
> > instead of just rolling with it when you get there.
> >
> 
> I'll admit it's not terribly hard to just get a foreign compiler to work, and
> I've already gotten a version of gcc-4.3.1 jiggered.  I was going to concentrate
> next on cleaning up the compiler issue, which is why I wanted to get a
> pronouncement  on which way to go.  If I simply try to duck as much of that
> issue as possible, I can use the gcc-4.3.1 without huge problems.  I can see
> that fine ,,, BUT the next part, getting ghe booting working, that does seem to
> be something which is necessary to do.  How could U just duck out of that the
> way I could easily do for the compiler?  I mean, how could you cause the booting
> to get fooled into thinking it was working?  If you could give me an example of
> any possible way to get past this issue, I'm willing to do as you request, if
> only I could recognize the action you're asking me to take.

Oh, I wasn't suggesting that you somehow fake up the loader part,
you'll have to do that too! :)

Perhaps a pre-step then should be:
0) get the loader working in some form. :>)

> In the meantime (Until I understand what you're asking for) I'm rereading my
> old Dragon book, so I can begin to understand what llvm is doing.  From Sandeep
> Patel, of llvm, btw, he tells me that the -A8 and -A9 work on llvm is going very
> rapidly, and it may well be ready before we realize, so being able to push off
> making the compiler decision is actually maybe quite agood thing to contemplate.

you can really spend forever on this, again, unless you have a pressing
need due to the compiler being completely broken, it's a bad idea
to focus on cleanliness first.

first work on getting it to boot, only stop if you hit a bug, don't
"clean" or you'll never finish.

again, this has only been my observation, I'm no porting OS master,
but I have observed a few ports and my suggestions are what I've
observed to have been the course of action of successful porters.

I've also observed that whenever someone gets caught up in the
details, they usually fail.

good luck,
-- 
- Alfred Perlstein


More information about the freebsd-hackers mailing list