This is an old revision of the document!
Table of Contents
DRAFT
Generality
A side note, at the Kernel level soft (armel)/hard float (armhf) doesn't matter, it matters at the userspace space level when passing function arguments (in hard float they are passed via FPU registers). Linaro has made a benchmark about this subject.
NVidia's Tegra21), which is dual-core ARM Cortex-A9, supports only VFPv3 2) and not NEON 3) extensions which are more powerful.
As of 2012/02/18, the most stable kernel is 3.0.19, and Marc Dietrich, the ac100 kernel maintainer, started to work on kernel 3.2.x series for AC100.
The most hotspot in kernel development is NVEC driver (incomplete implementation and marginal stability issue), sound driver (noise annoyance, automatic switch between Speaker/Headphone (not implemented at all in ASoC but can be easily done with a userspace daemon)) and rt2800usb
Wifi driver (some stability issues and high stress on specific memory pool (reduced by echo 32000 > /proc/sys/vm/min_free_kbytes)).
Recompiling a Kernel
Before doing this operation, try an already compiled kernel for less harsh, here is some link to pick it:
Ubuntu
Kernels cooked by Jani Monoses
http://launchpadlibrarian.net/89568135/linux-image-3.0.8-4-ac100_3.0.8-4.3_armel.deb
Debian
Fedora
http://dmarlin.fedorapeople.org/yum/f15/arm/os/Packages/kernel-tegra-2.6.40.3-2.09.fc15.armv7hl.rpm
RedSleeve
Others
You can extract zImage and corresponding modules from these packages.
From RPM
Using alien
alien –to-tgz linux-image-XXX.rpm
tar xf linux-image-XXX.tgz
From DEB
Get a kernel deb, for example http://startx.ro/~jani/linux-image-3.0.19-1-ac100_3.0.19-1.1_armel.deb
Using alien
alien –to-tgz linux-image-3.0.19-1-ac100_3.0.19-1.1_armel.deb
tar xf linux-image-3.0.19-1-ac100-3.0.19.tgz
Or using file-roller
file-roller linux-image-3.0.19-1-ac100_3.0.19-1.1_armel.deb
(Can non Ubuntu versions of file-roller also read debs?)
Or using dpkg
dpkg -X linux-image-3.0.19-1-ac100_3.0.19-1.1_armel.deb
Afterwards
cp -Rp lib/modules/3.0.19-1-ac100 /<your rootfs>/lib/modules
abootimg -u /tmp/alien/part-6.img -k /tmp/alien/tgz/boot/vmlinuz-3.0.19-1-ac100
Compilation environment consideration
Cross-compiling and native.
2.6.38 Kernel series
git clone -b chromeos-ac100-2.6.38 git://gitorious.org/~marvin24/ac100/marvin24s-kernel.git cd marvin24s-kernel make paz00_defconfig zImage modules modules_install INSTALL_MOD_PATH=/mnt/mmcblk1p1 abootimg -u /tmp/part-6.img -k arch/arm/boot/zImage
/mnt/mmcblk1p1 is where is your rootfs, if it is your live system suppress INSTALL_MOD_PATH=/mnt/mmcblk1p1
/tmp/part-6.img is your copy of your boot image (part 6 for nvflash, mmcblk0p2 device on eMMC for Linux)
If you want to create a custom version of your kernel's config, run make menuconfig after make paz00_defconfig.
After code update in Gitorious repository
git pull make menuconfig zImage modules modules_install INSTALL_MOD_PATH=/mnt/mmcblk1p1 abootimg -u /tmp/part-6.img -k arch/arm/boot/zImage
3.0.x Kernel series
TODO
git clone -b chromeos-ac100-3.0 git://gitorious.org/~marvin24/ac100/marvin24s-kernel.git cd marvin24s-kernel
Kernel Debugging
TODO
GDB and KGDB
Remote debugging session
TODO
SystemTap
TODO
http://sourceware.org/systemtap/SystemTap_Beginners_Guide/cross-compiling.html
http://sourceware.org/systemtap/SystemTap_Beginners_Guide/using-usage.html
http://omappedia.org/wiki/Systemtap
SystemTap: Instrumenting the Linux Kernel for Analyzing Performance and Functional Problems by IBM
Linux introspection and SystemTap, An interface and language for dynamic kernel analysis by M. Tim Jones
Using SystemTap by Brendan Gregg
SystemTap: It's like dtrace for linux, yo. by Thomas Strömberg
Examples written by Paul Fertser for tracking NVEC activities (this assumes you're crosscompiling and then manually scp'ing and staprun'ing modules) :
- first, fetch the address of NVEC:
stap -B CROSS_COMPILE=arm-none-linux-gnueabi- -a arm -r ~/openmoko/l/ -v -e 'probe kernel.function("nvec_write_async") { printf("hi, nvecs address is %p\n", $nvec) exit() }'
hi, nvecs address is 0xdf8ae000
- second, with this address, issue events for controlling sound amplifier (warning, guru mode allows arbitrary C code, you can crash a running system with that):
stap -g -B CROSS_COMPILE=arm-none-linux-gnueabi- -a arm -r ~/openmoko/l/ -v -e '%{ #include <../drivers/staging/nvec/nvec.h> %} probe begin { %{ nvec_write_async((struct nvec_chip*)0xdf8ae000, "\x0d\x10\x59\x94", 4) %} exit() }'
\x0d\x10\x59\x94 mutes the amplifier, with \x0d\x10\x59\x95 unmutes it.
DTrace
TODO
the DTrace book of scripts and strategy, 1100 pages (2011)
Porting effort of DTrace on Linux blog of Paul FOX.
ftrace
TODO
Debugging the kernel using Ftrace - part 1
Debugging the kernel using Ftrace - part 2
Ftrace Linux Kernel Tracing by Steve Rostedt