|
Menu
Friends
News sites
· MacSlash (en) · osnews (en) · ppcnux (de) · tevac (it) · penguinppc (en) · macbytes (en) · linux op je mac (nl) · ppczone (en) Other sites · napoli ug (it)
Donate!
Online
|
Darwin, the BSD subsystem Mac OS X lays on, is open-source. This means, among many other things, that you can recompile the kernel of the operating system so that it fits your needs. This is a little guide to Darwin kernel recompiling. At the moment the article does not cover Kernel configuration, so these are just the default steps to get your very firdt kernel compiled. The default configuration includes debug symbols and support compiled into the kernel, so it will be not a deployment kernel. Disclaimer: doing something wrong can put your system in unbootable state. We take no responsability of what you do with these informations. More: this article is an ongoing work, so it will change periodically. Check back often to read more about the kernel recompiling and configuration. Where to start First of all you must have Developer Tools installed on your system: the developer tools contain the compiler we will use. Second thing: you need the kernel source. You can download it for free at Apple opensource website. You are practically ready to start. But why recompiling? Well, sometimes people just recompile it for fun. Ok, that'not that fun for "normal users", but there are people interested in doing such things just for fun. Sometimes there are people that do it for more serious reasons. The existence of a bad bug in the kernel shipped with Mac OS X / Darwin , for example, and the availability of a patch to that bug could be a good reason to recompile the kernel with that patch applied to the source code. Apple usually patch bugs after few days, but hey, who can know? Starting We are going to work with the Terminal.app. Don't be scared by that. It is not that bad working from the command line. The source file comes in a .tar format. To extract a .tar just type: tar -xzvf filename.tarwhere filename.tar is your file. This will extract the archive. Before proceeding with the extraction consider putting the tar file into a directory you created. To create a directory type: mkdir directorynamePlease, when choosing the name of the directory, avoid using spaces and other strange not-alphanumeric symbols for it. It is a good habit, and makes your life easy when doing nice things from the shell. Before compiling the kernel we need to get some more tools from the Apple opensource website: download bootstrap_cmds, Libstreams, and cctools packages there and extract the .tar files. Once extracted in a directory of our choice we must solve some few other problems before starting the compilation phase. We consider you extracted the packages in the same directory and you are actually in that directory: cd bootstrap_cmds-version/relpath.tprojthen, going back to the directory where we extracted them: once again going back to the extraction dir: cctools package still needs some work: edit with your favourite editor (we suggest vim) the Makefile contained in its directory and look for the COMMON_SUBDIRS line. Make it look: COMMON_SUBDIRS = libstuff libmacho miscOk, almost finished with the cctools. Now type the following commands: This implies that for future passes /usr/local/bin is in your PATH environment variable. If you're using bash shell, the default one in Panther, you can add /usr/local/bin to your path typing: You can add this line to your .bashrc file that is located in your home directory, so that evertyme you get a shell by the Terminal.app it will setup the PATH variable for you. We get to the point, the kernel compiling :) Get to the directory where you extracted the kernel sources and type: This will setup some other needed environment variables for you automatically. The easy way, now. Type: And you will get your kernel in BUILD/obj/RELEASE_PPC/mach_kernel
|
Login
old news
|