How to compile a new kernel for pico-SAM9G45
- Obtain and install a toolchain for ARM. A simple toolchain can be installed following instruction on this page.
Other toolchains like Codesourcery can be used.
- Obtain the kernel sources for pico-SAM9G45 by using:
and checkout the branch that you with to use with:
git checkout <branchname>
Replace <branchname> with:
- minibox-picopc-3.1 - kernel version 3.1 no Android patches
- minibox-picopc-2.6.32 - kernel version 2.6.32 no Android patches
- minibox-picopc-android-3.1 - kernel version 3.1 with Android patches
- minibox-picopc-2.6.32-gingerbread - kernel version 2.6.32 with Android patches
If you are using the 2.6.x kernel branch make sure you checkout the picopc-bootstrap-2.6 branch from picopc-bootstrap
- You will need a basic configuration for pico-SAM9G45 kernel. For this copy the picosam9g45_defconfig from arch/arm/configs to .config in the root of kernel source (same location with the compile.sh script). For 2.6.x kernels copy picopc_defconfig.
- (Optional) Edit the compile.sh script from the source tree and modify CROSS_COMPILE= variable to point to the location where you have your custom toolchain installed. If you are using our toolchain, there is no need to change compile.sh since it points to correct location.
- Now you can run ./compile.sh menuconfig from the source directory to get the configure menu or ./compile.sh uImage to get a kernel image usable for pico-SAM9G45. The image will be generated in arch/arm/boot/uImage and it will be booted by the bootstrap (BOOT.BIN)
Commands to produce a kernel image for Android:
mkdir ~/picosam9 cd ~/picosam9 git clone git://gitorious.org/picopc-kernel/toolchain.git git clone git://gitorious.org/picopc-kernel/kernel.git cd kernel git checkout minibox-picopc-2.6.32-gingerbread cp arch/arm/configs/picopc_defconfig .config echo "make ARCH=arm CROSS_COMPILE=~/picokernel/toolchain/bin/arm-eabi- $1" > compile.sh ./compile.sh menuconfig && ./compile.sh uImage ls -l arch/arm/boot/uImage </pre>
NOTE If you aren't using our toolchain, make sure you have mkimage from u-boot sources installed in your path. Although pico-SAM9G45 bootstrap doesn't use u-boot it expects a kernel in the uImage format. mkimage tool can be compiled from u-boot sources from the tools directory