Kernel Building

From Low cost, low power, android ARM system board by - pico WiKi
Jump to navigation Jump to search

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:
   git clone git://

and checkout the branch that you with to use with:

   git checkout  remotes/origin/<branchname> -b localbranchname
  • Replace <branchname> with (a list of branches can be obtained by running git branch -a ):
    • 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

  • 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 script). For 2.6.x kernels copy picopc_defconfig.
  • (Optional) Edit the 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 since it points to correct location.
  • Now you can run ./ menuconfig from the source directory to get the configure menu or ./ 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)


   If you are using the 2.6.x kernel branch make sure you checkout the picopc-bootstrap-2.6 branch from picopc-bootstrap

Commands to produce a kernel image for Android:

 mkdir ~/picosam9
 cd ~/picosam9
 git clone git://
 git clone git://
 cd kernel
 cp arch/arm/configs/picosam9g45-android_defconfig .config
 ./ oldconfig && ./ uImage
 ls -l arch/arm/boot/uImage

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 [1]