Introduction :
the idea of using eclipse IDE for configuring and building Linux kernel is to help the developer to automate from a presentable GUI ( No command shell) the following operation:
- configuration of Linux kernel
- building the binary image kernel for target.
- clean the previous configuration and binary image
- compiling and installing of module (driver)
- compiling the C/C++ code
- debugging Linux kernel on target or by emulation using qemu
- configuring and building u-boot for target
But before thinking of using eclipse IDE for building the Linux kernel binary image,we must absolutely know the basic theories of embedded Linux kernel and master the necessary steps for configuring and building the kernel eventually in shell, here I will show almost all shell command necessary for building Linux kernel.
host$ make mini2440_defconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
ii- There are two menu configs that we can be use for configuring and Modify the kernel options you would like to run :
host$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig
(or)
host$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- xconfig iii- Clean your installation of previous build settings :
host$ make distclean ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
1- Create Linux kernel project in Eclipse IDE :
step 1 : first, create a new C project by using File->New->Project...
step 2 : select "C Project", "Makefile project", "Empty Project" , and choose name of your kernel project :
for example I'm choosing "linux-kernel-project" like following screen-shot:
I board to disable automatic building , by using the "Window->Preferences" menu, selecting "General->Workspace" and deselected "Build automatically".
now we will be refresh our workspace "File->Refresh" and waiting some time in order to eclipse finish indexing project.
a- Configuring Kernel :
step 1 : in "project->built configurations->manage configuration", click "New" for create a New configuration and enter the configuration name like the following screen-shot :
step 2 : we will define a new build variable by using "project->proprieties" in window of project proprieties, selecting "C/C++ Build; Build variables"The xconfig utility is invoked by running
'make xconfig'
in the base Linux source directory.So in
- “variable name” enter : xconfig
- “type” : choose string
- “Value” : xconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
now click in the small hummer in the main window of eclipse IDE, then click in xconfig.
A new window will appear, where we can configure the kernel.
b- Compiling Kernel :
follow the same steps for compiling the kernel, just in addition a new variable, it must be like me :
in
- “variable name” enter : uImage
- “type” : choose string
- “Value” : uImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Conclusion :
Note :
during development, I'm using ubuntu 10.10 as operating system and we must be install the CodeSourcery tools for compiling kernel.
Aucun commentaire:
Enregistrer un commentaire