ARM core Socs are dominant in embedded market. For portable devices, power consumption is always a major concern and there ARM always stood tall, bringing newer Socs for new market demand, name it for a limited featured micro-controller or processor for smart devices.
Coming to cross compiling kernel for ARM in x86 host machine, here we go with the steps,
Kernel Source: kernel.org
Cross compiler tool chain: arm-2009q3-67
$tar -xvf linux-3.5.tar.bz2
$tar -xvf arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
Extract kernel source and go to the kernel source directory.
Now you have to select kernel configuration file. You may start looking into <kernel>/arch/arm/configs/ folder to see available configurations in kernel tree. You can chose the configuration close to your device. If you are doing it just for experiment, you can chose vexpress_defconfig.
$cd linux-3.5
$ls ./arch/arm/configs
$make ARCH=arm vexpress_defconfig
In above command, make utility will look for vexpress_defconfig configuration file in arm architecture. If incase you miss to give ARCH directive, default x86 arch will be considered and will be searched for the given configuration file. This command will simply copy the configuration file in .config file name in kernel parent directory.
Once you have extracted arm toolchain, you have to pass tool path and prefixes to the compiler through make. You can see all available tools,
$ls arm-2009q3/bin/
You will find all tools are prefixed with arm-none-linux-gnueabi-
Well, now we can go for start compiling our kernel source as for ARM as,
$make ARCH=arm CROSS_COMPILE=/home/abhi/arm-2009q3/bin/arm-none-linux-gnueabi- -j4
$make ARCH=arm CROSS_COMPILE=/home/abhi/arm-2009q3/bin/arm-none-linux-gnueabi- modules_install INSTALL_MOD_PATH=$TARGETDIR -j4
Last parameter, -j4 is only to make use both the cores of my system processor. If your system is quadcore, use -j8 and so on.
Once your kernel is compiled you will get vmlinuz generated.
If you want to test with emulator, just follow with qemu tutorial here.
No comments:
Post a Comment