Cross Compile FreeBSD Kernel

Hi Guys! I want to ask you if it is possible to compile the FreeBSD Kernel from another platform and OS (e.g. OSX)

Thank you in advance

;-)
 
Beeblebrox said:
Download sources using svn into $wherever, chroot (target shell: sh) into $wherever and buildworld?

Thank you for the reply, anyway i'm a noob in these things, could you be more specific?

Thank you again!
 
dinnerblaster said:
Thank you for the reply, anyway i'm a noob in these things, could you be more specific?

Thank you again!

The short answer is you can't.

What your asking is not cross compiling like NetBSD does. If you notice NetBSD stuff is just compiling NetBSD on one architecture and running it on another but it's still all NetBSD.

What you want is something like the Debian project that uses the FreeBSD kernel with Linux userland. It's not as simple as just recompiling the kernel. Go take a look at what that project did/is doing. You'd never be able to do it with OSX since the parts you probably want to utilizes of OSX are closed source...namely the GUI.
 
roddierod said:
The short answer is you can't.

What your asking is not cross compiling like NetBSD does. If you notice NetBSD stuff is just compiling NetBSD on one architecture and running it on another but it's still all NetBSD.

What you want is something like the Debian project that uses the FreeBSD kernel with Linux userland. It's not as simple as just recompiling the kernel. Go take a look at what that project did/is doing. You'd never be able to do it with OSX since the parts you probably want to utilizes of OSX are closed source...namely the GUI.

Uhm, i think that i didn't explain myself well, what i want to do is exactly the same as compiling the NetBSD kernel in OSX, only with FreeBSD in place of NetBSD..

Thank you

(Also sorry for my bad english)
 
Most readers will not have cross-compiled the NetBSD kernel on OSX, so expanding on that could be helpful.

What do you plan to do with the compiled kernel? If it's for something like an emulator or just an experiment to get cross-compiling working, sure. It would not be a usable replacement for the OSX kernel, though.
 
To add to that, you're going to need a system to test it on anyway. So you might as well set up a VM with a full FreeBSD install on it.
 
The situation is like this: I have an old PIII machine with FreeBSD installed, but if i try to compile the FreeBSD kernel from that machine it would take hours, if instead of that PIII processor i use the 4 core Intel processor of my Mac i assume that it would take less time.

For NetBSD all i have to do is download the kernel sources, setting up the cross-compiler environment, and use the script "build.sh" for building the kernel image.

LINK
 
Simple solution, install FreeBSD in a VM. Build your kernel and world there. NFS export /usr/src/ and /usr/obj/. Mount them on the slow machine and you only have to installworld, installkernel and mergemaster(8) on it.

You can do the same for building packages. Create a /usr/ports/packages/ and they will appear there. NFS mount or otherwise move them to the slow machine and simply pkg_add(1) them there.
 
Back
Top