Objective: Learn how to cross-compile a kernel for an OMAP target platform.
Go to the /home/<user>/felabs/sysdev/xkernel directory.
If you haven't done the previous labs, install the following packages: libqt3-mt-dev, g++.
Also install uboot-mkimage.
We are going to cross-compile and boot a Linux kernel for the TI OMAP Beagle board.
(i) Getting the sources
Get the latest kernel sources from the master branch of the official linux-omap-2.6 git repository.
Once more, if the git protocol is blocked by your firewall, you could also clone the git source tree through http:
(ii) Cross-compiling environment setup
To cross-compile Linux, you need to install the cross-compiling toolchain. We will use the cross-compiling toolchain that we previously produced, so we just need to make it available in the
(iii) Makefile setup
Go into directory linux-omap-2.6.
Modify the toplevel Makefile file to cross-compile for the arm platform using the above toolchain.
(2) Linux kernel configuration [Optional]
By running make help, find the proper Makefile target to configure the kernel for the OMAP Beagle board. Once found, use this target to configure the kernel with the ready-made configuration.
Don't hesitate to visualize the new settings by running make xconfig afterwards!
(3) Cross compiling a Linux kernel
You're now ready to cross-compile your kernel.
Use following commands to build uImage and wait for a while for the kernel to compile
Look at the end of the kernel build output to see which file contains the kernel image.
However, the default image produced by the kernel build process is not suitable to be booted from U-Boot. A post-processing operation must be performed using the mkimage tool provided by U-Boot developers. This tool has already been installed in your system as part of the ubootmkimage package.
To run the post-processing operation on the kernel image, simply run:
Following Snapshot shows that uImage is successfully created.
Copy it in SD card first partition.
Following Snapshot shows files which are required in first partition of SD card. (Among them MLO, u-boot.bin, x-load.bin.ift are created in Lab 3 document).
Copy the root file system into the second partition (the ext3 one) as below:
Untar it. (IMPORTANT: You must untar directly onto the SD card. Do not untar somewhere else and then copy to the SD):
(If you get "permission denied" errors while copying or untaring it to the SD Card then issue that command using 'sudo' e.g "sudo cp Angstrom-Beagleboard-demo-image..... /media/LABEL2")
Once that's done, delete the tarball:
LABEL2 partition of SD card is having following contents.
(5) Setting up serial communication with the board
Plug the Beagle board on your computer.
Start Minicom on /dev/ttyS0, or on /dev/ttyUSB0 if you are using a USB to serial adapter.
You should now see the U-Boot prompt:
OMAP3 beagleboard.org #
Type the following command to set up the boot environment.
setenv bootargs 'console=ttyUSB0,115200n8 root=/dev/mmcblk0p2 rw rootwait'
Using this u-boot prompt, you now can start kernel uImage stored on MMC card manually:
Following snapshot shows booting the kernel.
Type “root” at beagle board login and press enter.
Then go to the root directory and list files and you can see the following result.
You can mount first partition of SD card on beagle board as below.
 To create uImage for Beagle Board http://elinux.org/BeagleBoard#Linux_kernel
 Information of cross compiling a linux kernel http://labs.myigep.com/index.php/The_Linux_kernel
 Download Angstrom Beagle board demo image required for beagle board root file system
 Test root file system on Beagle Board