Friday, January 22, 2010

The make of uClinux

Configuring kernel is to generate .config file as far as I know. The .config will be used by "make" to generate vmLinux, the kernel proper. As this point of time, I'm not quite sure about whether "make xconfig" or the actual "make" prepares the source code tree for compile.

Something interesting from a book:
"Most kernel software modules also read the configuration indirectly via the .config file. During the build process, the .config file is processed into a C header file found in the .../include/linux directory, called autoconf.h. For each entry in the .config file, a corresponding entry is created in autoconf.h. Many kernel source files include this file directly using #include preprocessor directive. This is how the cource files in the kernel source tree reference the kernel configuration."

Run "make" and I get this error after the make runs for a while:


"The file /usr/src/linux/Makefile is missing!
Perhapes your kernel source is broken?"


The "kernel source" is the compiling host's kernel source, or the uClinux's kernel source? uClinux distribution doesn't include all the Linux kernel files? Is it just a patch to the standard kernel?

Anyway, I downloaded the Linux 2.4.8-20 (which is the version of the host) source code and untar it into the /usr/src/ dir. And re-make.

Fine, it's compiling until it's stopped by other errors. (can't remember exactly ...)

This evening in the class, asked the teacher and it turned out that I chose a wrong uClibc! It should be "uC-libc" instead of "uClibc". uC-libc is specific and optimised for Coldfire 68k and the other one is more generic.

Ola, make flys and image.bin is built in .../images dir!

Note: the image.bin file is the uClinux kernel plus root file system, it is the one that's going to be download into cf5272 and run.

Something else:
1. the uClinux distribution (source code) is complete to build the kernel, no dependency on any other source codes such as the source code of the host linux.
2. the tool chain for the specific architecture is complete and no dependency on host's gcc.

No comments:

Post a Comment