ugles: micro graphic linux embedded system

Linux-2.6.21.7-eeepc

download the source

host requirements: wget

  1. Surf the web to Asus eeepc download site
  2. Select EEE family, EEE pc, EEE pc 4G/Linux, press the Search button, Select OS: Linux, press the Search button, expand Source Code category
  3. Download Linux Kernel source from Asus web or by direct link here included
  4. Download Asus ACPI driver from Asus web or by direct link here included
  5. Download the Linux 2.6.21.4 patch and Linux 2.6.21.7 patch
  6. Download the uvesafb patch from Spock's devsite

prepare the source

host requirement: unrar mc

  1. Extract the Linux kernel source from the related Asus RAR archive
  2. Apply the patch 2.6.21.4 with option -R (reverse) to the kernel source
  3. Apply the patch 2.6.21.7 to the kernel source
  4. Extract the file asus_acpi.c from the related Asus RAR archive
  5. Copy the file asus_acpi.c into drivers/acpi/ overwriting the existent
  6. Rename the directory linux-source-2.6.21.4-eeepc as linux-2.6.21.7
  7. Use tar and bzip2 to create an archive named linux-2.6.21.7.tar.bz2

Buildroot svn r23927 {2008-11-04}

host requirement: bison flex automake textinfo textinfo-doc-nonfree

  1. Download the buildroot environment from its svn repository1
  2. Download and apply this patch to the buildroot enviroment: cat patch | patch -p0
  3. Let svn to be acknoledged about new file entries in order to use make svnpatch in future2
  4. Download this archive and extract it creating buildroot/local configures directory
  5. Copy the Linux kernel source tarball into buildroot/dl directory
  6. Copy the uvesafb patch into into buildroot/dl directory
  7. Initialize the environment with make BOARD=ugles getconfig3
  8. Download the most of the package sources using make source4
  9. Build everything using make5

customizing the root filesystem

  1. Remove all X servers apart Xvesa from project_build_i586/ugles/root/usr/bin
  2. Using chroot into project_build_i586/ugles/root:
    • Make executable the new scripts chmod a+x /etc/init.d/S*
    • Prepare the font cache and directories using the HOME=tmp /etc/init.d/S*Xserver script
    • Remove some files doing rm -f project_build_i586/ugles/root/root/.x*
  3. Copy some JPEG images into project_build_i586/ugles/root/root directory
  4. Clean the eeepc resolution package doing make 915resolution-clean
  5. Rebuild the bootable iso9660 image using make6

Patches and problem solved

xinit application: startx speed up

After X server has been launched it was taking too much time waiting for nothing a simple kill -SIGUSR1 xinit let it to awake

A smarter procedure should be implemented. Unfortunately the one I have written I should put under XCOMM. It did not work because the xterm problem about pathologically 99% usage of CPU.

xorg server: kdrive mouse initialization protocol bugfix

This patch fix the mouse protocol initialization which actually cause the kdrive to switch mouse protocol many times without any necessity because initialization of tty flag did not happen correctly. This patch add the -mouse mouse,,protocol= option too in order to test and/or use a specified mouse protocol.

NOTA BENE: without this patch kdrive mouse, in many system, seem crazy at the startup and NO ANY solution based on psmouse.proto=bare7 or similar like psmouse.resetafter=8 could fix the problem in kdrive/tinyx without this patch. This patch solves the crazy mouse problem too, apart 1 second of initial inertia of the pointer, if protocol=ps2 is choosed.

xterm: pathologically 99% CPU usage

This problem is still unresolved and unknown. Some builds show it up in some manners. Some builds does not show it up at all.

Nasty, unknown, not still understood problem but at this time pretty worked around managing properly the X server initializations.

915resolution and v86d

Adding these two packages would be the only way to activate console frame buffer and use Xvesa at non standard resolutions like eeepc's 800x480.

The v86d is the userspace helper of the uvesafb patch for the linux kernel. Applying this patch is a duty of the buildroot if it is properly acknowledged: there is an option in make menuconfig in order to add a specific patch to linux kernel. It has been used to apply the uvesafb patch.

fbv: faster clean of the background

The command fbv is used to show up all the images in a slide show. Unfortunately it clean the screen and after a while commit the image on it. During this time the user starring in front of a non-very-interesting black screen.

The proposed solution is not the smartest solution in order to clean the border around the image but it is the most fast and simplest way to reset the frame buffer before committing the image on it. However if this solution is not fast/smart enough then much probably the whole fbv image committing would be too slow too. In this case the usage of the double buffering is the only way to made the FB rapidly switching from an image to the next.

patches to buildroot svn r23927 {2008-11-04}

In order to clean and rebuild as fast as I can my project on buildroot I developed this patch:

This patch added some useful, at least for me, targets like softclean, rootclean, install and svnpatch. The lasts three have been documented in make help while the first is mainly used by install target. Thanks to this approach I have been able to test many configurations and reports many bugs8. Those has been fixed at this time {2008-11-07} show up in the following list:

  1. Matchbox compilation crash into libmatchbox-1.9 (5484)
  2. Matchbox windows manager requires startup notification (5524)
  3. xapp_xfsinfo undefined reference to bcopy (5624)
  4. xclock does not compile (5654)
  5. Xorg and Xvesa need font misc-misc and font alias (5684)
  6. xkeyboard-config depends on xapp_xkbcomp at runtime (5704)
  7. Matchbox pannel requires startup notification (5964)
  8. grub patch (ml.011655)

Buildroot needs to relay onto developing tools installed in the host system to compile GTK applications like gqview. These following reports show up the problems for which a general solution has been identified but not written yet, at this time {2008-11-07}:

However a partial solution has been proposed but was a source of some minor issues which has been addressed:

Finally the maintainer decide to revert back its partial solution in order to supply a general solution in future:

I decided to still stick to the partial solution in order to compile the gqview application which at this time is not included in the project.

Tests, sizes and times

  1. Test the bootable iso9660 image with qemu -boot d -cdrom binaries/ugles/rootfs.i586.iso -kernel-kqemu
  2. Modify target/iso9660/menu.lst in order to reseto to zero the Timeout and put default choice over text/Xserver
  3. Do make to rebuild the iso9660 image again
  4. Test again the bootable iso9660 image with time qemu -boot d -cdrom binaries/ugles/rootfs.i586.iso -kernel-kqemu
  5. Close the qemu windows once the Xserver would became available in ugles

size chart of main components

Description Size in Kb Weight
Kernel image: all internal peripherals support 1340 4,0%
Kernel modules for external peripherals 8244 24,4%
Filesystem skeleton 268 0,8%
Configuration files for the system 224 0,7%
Busybox, bin, sbin and uclibc 1568 4,6%
Grub and stages 316 0,9%
Localizations for all English languages 1272 3,8%
Xvesa + binaries and libraries for X or FB 8944 26,5%
Xserver fonts + share data + keyboard layouts 11624 34,4%
TOTAL 33800

time reduction

bootable iso9660 arch system files depmod font caching start Xserver boot time
standard 49 Mb i586 kernel+initrd at boot time at boot time standard 37 s
standard 49 Mb i586 kernel+initrd at boot time at boot time patched 23 s
gzip 14 Mb i586 kernel+initrd at boot time at boot time patched 17 s
gzip 14 Mb i586 kernel+initrd at boot time prepared before patched 14 s
gzip 14 Mb i686 kernel+initrd at boot time prepared before patched 14 s
roberto@rafbook:~/gles/buildroot$ time qemu -boot d -cdrom binaries/ugles/rootfs.i586.iso -kernel-kqemu

real 0m13.980s
user 0m3.648s
sys  0m6.992s

real 0m13.282s
user 0m3.616s
sys  0m6.836s

real 0m13.537s
user 0m3.716s
sys  0m6.772s

host system specifications used in the qemu time tests

  • HW: Aver Aspire 5051, Turion 64bit MK-36 @2GHz, RAM 512 Mb @667MHz, HD 40Gb Hitachi
  • SW: Ubuntu 8.04, Linux rafbook 2.6.24-19-generic #1 SMP i686 GNU/Linux
roberto@rafbook:~/gles/buildroot$ sudo hdparm -tT /dev/hda

/dev/hda:
 Timing cached reads:   876 MB in  2.00 seconds = 437.87 MB/sec
 Timing buffered disk reads:  104 MB in  3.05 seconds =  34.14 MB/sec

Screen shots

Click on an image to enlarge it

Useful links

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.