Special Kernel (by Ced)

From OESF

Revision as of 21:03, 25 November 2007 by Tux (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

This page is out of date and needs replacing by an up to date version.

Step by step to compile a special kernel (v13a) based on these instructions: http://tetsu.homelinux.org/zaurus/kernel/ If you want to translate it to English -> http://www.excite.co.jp/world/url/

NOTE: (I'm NOT responsible for any damages to your zaurus by doing the following)

This kernel is suitable for the following devices: SL-5600/B500, SL-C700, SL-C750, SL-C760, SL-C860.

  • download the 4 patches
   - link is dead and trapped by spam filter
   - http://tetsu.homelinux.org/zaurus/kernel/v13a/printk.c.patch
   - http://tetsu.homelinux.org/zaurus/kernel/v13a/swap.c.patch
   - http://tetsu.homelinux.org/zaurus/kernel/v13a/sharpsl_apm.c-2.patch
  • unpack the kernel source
   - $ bunzip2 linux-c860-20031107-rom1_10.tar.bz2
   - $ tar xvf linux-c860-20031107-rom1_10.tar
  • patch the kernel
   - $ cd linux
   - $ bunzip2 <patch directory>/linux-c750-20031212.patch.bz2
   - $ patch -p1 < <patch directory>/linux-c750-20031212.patch
   - $ patch -p1 < <patch directory>/printk.c.patch
   - $ patch -p1 < <patch directory>/swap.c.patch
   - $ patch -p1 < <patch directory>/sharpsl_apm.c-2.patch
  • configure the kernel (please refer to the original web page for certitude)
   - $ make xconfig (or 'make menuconfig' for text)
   - select "Load Configuration from File" and type --> arch/arm/def-configs/<device version>
   the device version is:
   - poodle (SL-5600)
   - poodle-j (B500)
   - corgi (SL-C700)
   - shepherd-j (SL-C750)
   - husky-j (SL-C760)
   - boxer-j (SL-C860)
  - select "System Type"
      -- select "Intel PXA250/210 Implementations"
          --- "Use clock change (cccr_change) enable" -> y
          --- "Boot CCCR=0x242" --> y  (if device is SL5600/B500/C700)
          --- "Boot CCCR=0x162" --> y (if device is C750/C760/C860)
      -- "Workaround for XScale cache errata" --> n
      -- "Enable Fast Context Switch Extension" --> y
  - select "Console drivers"
      -- select "Frame-buffer support"
          --- "UNICON Support" --> y
          --- "Double Byte GB encode" --> y
          --- "Sharp LOGO screen support" --> n (optional)
  - select "Character devices"
      -- "SL-Series touchscreen pressure value read" --> y
      -- "SL-C Series power key suspend --> y (if C700/C750/C760/C860) --> n (if SL5600/B500)
      -- "SL-C Series 3 Button touch screen" --> y
  - finally save & exit
  Note: you can save the configuration to a file (so you can re-use/re-load it) then apply a validation check:
  CONFIG_SL_CCCR_CHANGE=y
  CONFIG_SL_CCCR242=y (only for SL-5600/B500/C700)
  CONFIG_SL_CCCR162=y (only for C750/C760/C860)
  # CONFIG_XSCALE_CACHE_ERRATA is not set
  CONFIG_ARM_FCSE=y
  # CONFIG_SL7X0_POWER_KEY_OFF is not set (only for SL-5600/B500)
  CONFIG_SL_3BUTTON_PATCH=y
  CONFIG_SL_TS_PRESSURE=y
  CONFIG_UNICON=y
  CONFIG_UNICON_GB=y
  CONFIG_UNICON_GB=m
  # CONFIG_SHARP_LOGO_SCREEN is not set (optional)
  # CONFIG_SL_SYSCLK100 is not set
  • compile the kernel
   - set the cross compiler --> $ export PATH=/opt/Embedix/tools/bin:$PATH
   - $ make dep
   - $ make clean
   - $ make zImage
   - $ make modules
  • flash the kernel in arch/arm/boot/zImage
   - copy the kernel & the updater.sh to a CF card
   - flash it...
   - reboot...
  • run some statistic before and after flashing
   - store this somewhere in the zaurus --> http://laurent.lieben.free.fr/zaurus_kernel/dhry21
   - run 50 000 000 iterations --> $ echo 50000000 | ./dbry21
   - you should have a summary file --> dbry.res

Performance statistics:

  • SL-5600, default kernel, 1.0 ROM

Dhrystone Benchmark, Version 2.1 (Language: C)
Register option not selected.
Microseconds for one loop: 4.2
Dhrystones per second: 240639.1
VAX MIPS rating: 136.960

  • SL-5600, preemptif kernel, 1.32 ROM

Dhrystone Benchmark, Version 2.1 (Language: C)
Register option not selected.
Microseconds for one loop: 2.5
Dhrystones per second: 402933.4
VAX MIPS rating: 229.330

  • SL-5600, special kernel, 1.32 ROM

Dhrystone Benchmark, Version 2.1 (Language: C)
Register option not selected.
Microseconds for one loop: 2.1
Dhrystones per second: 476099.8
VAX MIPS rating: 270.973

  • C-760, special kernel, TKC 2.51 ROM

Dhrystone Benchmark, Version 2.1 (Language: C)
Register option not selected.
Microseconds for one loop: 2.2
Dhrystones per second: 462534.7
VAX MIPS rating: 263.253


To enable the pressure patch, do the following as root:

 $ echo 1 > /proc/tspressure

This patch allow to receive screen pressure and this can be used by this software as an example -> [1]


To save the battery you can downclock the system during the suspend mode:

- install the suspend/resume script architecture -> http://www.killefiz.de/zaurus/showdetail.php?app=859
- create a suspend script /etc/apm.d/suspend.d/S00Cpu (chmod +x S00Cpu) with the following content:
  #!/bin/sh
  echo 0121 > /proc/cccr_change
- create a resume script /etc/apm.d/resume.d/R00Cpu (chmod +x R00Cpu) with the following content:
  #!/bin/sh
  echo 0242 > /proc/cccr_change

The suspend CCCR value (0x121) give you a system with these frequencies:

- memory -> 100Mhz
- run mode -> 100Mhz
- turbo mode -> 100Mhz
- PXBus -> 50Mhz

The resume CCCR value (0x242, which is the default value for this kernel on the XScale-PXA250 processor) give you a system with these frequencies:

- memory -> 118Mhz
- run mode -> 236Mhz
- turbo mode -> 472Mhz
- PXBus -> 118Mhz

If you don't need that amount of downclock during the suspend mode, you can set the system to the default Sharp frequencies by using a CCCR value of 0241 (for the XScale-PXA250 processor):

- memory -> 100Mhz
- run mode -> 199Mhz
- turbo mode -> 398Mhz
- PXBus -> 100Mhz

You can check carefully these frequencies with this software ->

- this link is dead and trapped by our spam filters

I've found that the kernel automatically sets the CPU into idle mode therefore the suspend/resume scripts are not required...


After further investigations, I've been able to compile a stable (I "think"...) kernel including the overclocking and preemptif patches.
I've find some issues with the touch screen on the SL-5600 so I've removed the touch screen pressure patches.

  • grab the c860 kernel source --> [2]
  • Download the following patches:
   - this link is dead and trapped by our spam filters
   - http://tetsu.homelinux.org/zaurus/kernel/v13a/sharpsl_apm.c-2.patch
   - http://www.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/preempt-kernel-rml-2.4.18-5.patch
   - http://www.kernel.org/pub/linux/kernel/people/rml/lock-break/v2.4/lock-break-rml-2.4.18-1.patch
   - http://tetsu.homelinux.org/zaurus/kernel/3g/config.in.patch
  • Uncompress the file 'linux-c750-20031212.patch.bz2', edit the patch and remove every thing after the line 519
  • Apply all the patches in the source tree using -> $ patch -p1 < <patch file>
  • Configure the kernel (load your device configuration file) and set the following values -> $ make menuconfig
  CONFIG_SL_CCCR_CHANGE=y
  CONFIG_SL_CCCR242=y (only for SL-5600/B500/C700)
  CONFIG_SL_CCCR162=y (only for C750/C760/C860)
  # CONFIG_XSCALE_CACHE_ERRATA is not set
  CONFIG_ARM_FCSE=y
  CONFIG_PREEMPT=y
  CONFIG_LOCK_BREAK=y
  # CONFIG_SL7X0_POWER_KEY_OFF is not set (only for SL-5600/B500)
  # CONFIG_SHARP_LOGO_SCREEN is not set (optional)
  • Compile the kernel -> $ make dep; make clean; make zImage
  • Flash the new kernel -> arch/arm/boot/zImage

The preemptive patches cause problems with bluetooth CF cards. Here is how to fix the bluez package:

  • Patch the preemptive kernel source with the latest bluez kernel patch -> [3] -> $ patch -p1 < patch-2.4.18-mh10
  • Configure the kernel with the following bluetooth configurations -> $ make menuconfig
   CONFIG_BLUEZ=m
   CONFIG_BLUEZ_L2CAP=m
   CONFIG_BLUEZ_SCO=m
   CONFIG_BLUEZ_RFCOMM=m
   CONFIG_BLUEZ_RFCOMM_TTY=y
   CONFIG_BLUEZ_BNEP=m
   CONFIG_BLUEZ_BNEP_MC_FILTER=y
   CONFIG_BLUEZ_BNEP_PROTO_FILTER=y
   # CONFIG_BLUEZ_HCIUSB is not set
   CONFIG_BLUEZ_HCIUART=m
   CONFIG_BLUEZ_HCIUART_H4=y
   CONFIG_BLUEZ_HCIUART_BCSP=y
   CONFIG_BLUEZ_HCIUART_BCSP_TXCRC=y
   CONFIG_BLUEZ_HCIBFUSB=m
   CONFIG_BLUEZ_HCIDTL1=m
   CONFIG_BLUEZ_HCIBT3C=m
   CONFIG_BLUEZ_HCIBLUECARD=m
   CONFIG_BLUEZ_HCIBTUART=m
   CONFIG_BLUEZ_HCIVHCI=m
  • Compile the kernel -> $ make dep; make clean; make zImage
  • Compile the modules -> $ make modules
  • Install the modules on the cross-compiler host -> $ make modules_install
  • Create an ipk from the new compiled modules (ipk howto -> [4])
   - download the ipk build script -> [5]
   - build the ipk on the cross-compiler host:
     $ cd <temporary directory>
     $ mkdir bluez
     $ cd bluez
     $ tar czvf data.tar.gz /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/*/bluetooth /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/lib/firmware_class.o
     $ tar xzvf data.tar.gz
     $ rm data.tar.gz
     $ mkdir CONTROL
     $ cd CONTROL
   - create a 'control' file (in the CONTROL directory) with following informations:
       Package: bluetooth-modules
       Section: kernel
       Priority: optional
       Version:  1.0
       Architecture: arm
       Maintainer: <your name>
       Provides: bluetooth-modules
       Description: bluetooth modules for preemptive kernel 2.4.18 with latest patch from bluez (mh10 15/12/2003)
   - create a post installation script 'postinst' (in the CONTROL directory) with the following:
       #!/bin/sh
       /sbin/depmod -ae
   - complete the ipk build:
     $ chmod +x postinst
     $ cd ../..
     $ cp <download location>/ipkg-build.sh .
     $ ./ipkg-build.sh bluez .
  • Flash the new kernel -> arch/arm/boot/zImage
  • Install the new bluetooth modules -> $ sudo ipkg install <bluetooth modules>.ipk

Note: you can install a pre-packaged bluez packages from the community site -> http://www.oesf.org/howto/downloads/bluez-zaurus_2.3-2.4.18c-preempt_arm.ipk


NOTE: The v13d kernel version from Tetsuyasu YAMADA (http://tetsu.homelinux.org/zaurus/kernel/) fixed all the above issues (bluethooth, screen pressure) so you can download this kernel and future release directly from his site.

Personal tools