Ben NanoNote/Kernel

From Qi-Hardware
Jump to: navigation, search


[edit] Howto compile a kernel for the NanoNote

[edit] Get the source code

The source code for the NanoNote kernel is located at It is based on the kernel plus some small patches which have not yet found their way upstream. The example uses NanoNote kernel source release 3.3. You might want to check the output of git branch -a and choose another version.

git clone git://
cd qi-kernel
git checkout jz-3.3

[edit] Build the kernel image

First you need to setup some environment variables to setup the architecture you'll be building for (MIPS) and the path to your MIPS toolchain.

export ARCH=mips
export CROSS_COMPILE=/path/to/your/mips/toolchain-

Don't forget to unset ARCH and CROSS_COMPILE variables afterwards, when building openwrt image. Otherwise it will screw up your openwrt build process.
Then you can generate a configuration from the NanoNote from the default config shipped in the source repository, then build the kernel.

make qi_lb60_defconfig
make vmlinux.bin

The NanoNote uses u-boot as a bootloader so you'll have to generate a uImage from the kernel image so u-boot can load it. The mkimage utility can also be found in your openwrt toolchain, if you don't have it in your package manager.

gzip -9 -f arch/mips/boot/vmlinux.bin
mkimage -A mips -O linux -T kernel -a 0x80010000 -C gzip -e 0x`${CROSS_COMPILE}nm vmlinux | \
    grep " kernel_entry" | cut -f1 -d ' '` -n 'Ben NanoNote Linux Kernel' -d arch/mips/boot/vmlinux.bin.gz uImage

[edit] Flash kernel image to the NanoNote

Now you can flash the new kernel image by booting the NanoNote in usbboot mode and use the usbboot util to flash the kernel image.

sudo usbboot -c "boot;nprog 1024 uImage 0 0 -n"

[edit] Difference between the qi-hardware and the kernel

The kernel contains support for the NanoNote since the 2.6.36 release. It is usable and most of the peripherals are supported.

The qi-hardware kernel is based on the kernel and contains some extra patches for the NanoNote which are not yet upstream in the current kernel release. Some of them are new drivers, others are fixes for existing drivers.

Fixes for existing drivers are usually send upstream as well, but might not be included yet in the latest kernel release. So if you are using a kernel and are experiencing a bug, it might be worth to try the qi-hardware kernel, as fixes are usually committed there as soon they exist.

There are also some patches in the qi-hardware kernel which are basically hacks and will never be accepted upstream in the form they are, but improve the user experience of the NanoNote.

There are some drivers in the qi-hardware kernel which are not yet in the kernel those include:

  • USB gadget driver (Is required for USB networking)
  • Backlight driver (The backlight can't be turned off without it)
Personal tools