Archive for November, 2011

Raspberry Pi: Tuning the Kernel – 0.2

November 24, 2011 Leave a comment

For the 0.2 of my Tuning the Kernel SBR600 project, I had planned to do some trimming of the kernel experimenting with different compilation options for the kernel.

Building a kernel using the make command with no menu options set, will build you a “stock” kernel as I had done in my previous post.

I learned that there are a few methods to go about altering the compilation options for a kernel:

make config

Using the config option, you are presented with a large list of questions that you must go through one by one to change the compilation options.

Support for paging of anonymous memory (swap) (SWAP) [Y/n/?]
System V IPC (SYSVIPC) [Y/n/?] Y
BSD Process Accounting (BSD_PROCESS_ACCT) [Y/n/?] Y
  BSD Process Accounting version 3 file format (BSD_PROCESS_ACCT_V3) [N/y/?] N
Export task/process statistics through netlink (EXPERIMENTAL) (TASKSTATS) [Y/n/?]
  Enable per-task delay accounting (EXPERIMENTAL) (TASK_DELAY_ACCT) [Y/n/?]

make menuconfig

Using the menuconfig option, you’re presented with a graphical ncurses GUI as seen below:

make xconfig

Using the xconfig option brings up an xwindows styled tool for enabling or disabling options.

I believe all methods accomplish the same task in this case, it’s a matter of which you’re more comfortable with (or what’s available to you(xconfig requires gtk+ and menuconfig requires ncurses)).

In my case, I stuck with the xconfig option as I find it easier to navigate with my mouse rather than my keyboard.

The next step is deciding what options to leave on and which can be deemed unnecessary and taken out. (which is the part I’m having most difficulty with).

That being said, I’ve created 2 kernels with some different options turned off on each:


  • removed Broadcom system support
  • removed power management support
  • removed misc drivers
  • removed SCSI device support
  • removed PID support – special HID devices (joysticks)


  • removed power management support
  • removed networking support: (amature radio,CAN bus, IRDA, Bluetooth, Wimax, Plan9)
  • removed SCSI device support
  • removed PID support – special HID devices (joysticks)

For those interested in the .config files from which I created these two kernels, they can be found here.

Categories: Uncategorized

Raspberry Pi: Tuning the Kernel – 0.1

November 7, 2011 2 comments

My assignment for the class SBR600, is to build and tune the kernel for the Raspberry Pi device (The Raspberry Pi device is a tiny, inexpensive ARM microcomputer designed to use in educational environments), it involves optimizing the kernel to run as efficiently as possible on the Raspberry Pi.

The steps for compiling a custom kernel for the RaspPi looked fairly simply, in that there are surprisingly few! Those steps are as follows:

  1. Retrieve kernel (Version
  2. Retrieve RaspPi kernel patch (RaspPi Patch)
  3. Apply patch to the kernel
  4. Add in DWC_otg folder
  5. Make the zImage from the patched kernel
  6. Run the python imagetool

I ran into problems while attempting to make the zImage of the kernel.

Upon running the command:

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- zImage

I was greeted with the following error:

/bin/sh: arm-none-linux-gnueabi-gcc: command not found
 make[1]: *** [kernel/bounds.s] Error 127 

After a bit of research I learn I’m missing a toolchain required to utilize the gnueabi-gcc toolset for the make command. So I located and downloaded said toolchain (arm-2011.03-41-arm-none-linux-gnueabi.bin)

Running that toolchain installer I ran into yet another error:

Error: Missing 32-bit libraries on 64-bit Linux host

It seems that I require certain 32bit libraries in order to CROSS_COMPILE the RaspPi kernel.

With the direction of frojoe on the #seneca freenode channel I was directed to this MeeGo wiki page which details the installation of the toolchain:

mkdir -p ${HOME}/tmp
cd ${HOME}/tmp
wget -c
mkdir -p ${HOME}/opt
tar -C ${HOME}/opt -vjxf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
export PATH=${HOME}/opt/arm-2009q1/bin:${PATH}

After applying these fixes and re-running the make command I encountered this error:

/bin/sh: /home/nlambert/opt/arm-2009q1/bin/arm-none-linux-gnueabi-gcc: /lib/ bad ELF interpreter: No such file or directory

Some research lead me to yum install glibc.i686, which corrected this issue. Re-running the make command results in the building of the kernel to the zImage.

I then ran the python script and am greeted with a kernel.img(4.7mb) in the tools directory.

This is my first kernel for the RaspberryPi with stock settings.

Categories: Uncategorized