Subject: Re: NetBSD toolchain
To: jp kn <jayaprakashkn@gmail.com>
From: Cherry G. Mathew <cherry.g.mathew@gmail.com>
List: tech-toolchain
Date: 01/23/2006 12:16:53
On 1/23/06, jp kn <jayaprakashkn@gmail.com> wrote:
> >You want to use a proprietary toolchain to cross-compile NetBSD ?

>        I have  gnu tools  with me ..all source is  available..
> That support my target platform.The source has a linux support ..how
> can i change the source to make netbsd toolchain for my target...? wat
> r the OS dependent changes i have to make..?


OK, here goes... I'm not the resident expert, so this is just my take
on stating the obvious:

As you point out, there are two things mainly:

1) Toolchain
2) NetBSD MD stuff.

1) Toolchain: I would imagine that the gnu toolchain you have is not
vastly different from the version distributed with NetBSD, at least
the bits you're interested in.

So the first step would be patching the NetBSD gnu toolchain to look
like the one you have. A good start would be to get a diff between
your toolchain, and the dist/gcc directory.

2) NetBSD MD stuff:

I suspect that the CPU/platform init. stuff would be really similar to
linux, but I doubt you would get away with cut-pasting GPLed code
here.

Memory management would have to be done from scratch... you'd have to
re-write the pmap module. Most of the MD fields in sys/ would have to
be given reasonably defines in <machine/>.

Take a look at the arch/XXX directory of a very similar architecture
to get a real close idea of what you need. For example, for ia64, I
look at alpha and sparc ( both 64-bit architectures ).

Unfortunately, a whole HOWTO is beyond my time/expertise at the moment.

I hope this is of some help.

TC,

--
~Cherry