Feb 16, 2010

Add network over USB for beagleboard

Go to menuconfig, and select following things to enable network over USB for beagleboard. You won't need a wireless adapter or USB to ethernet adapter more. All will be over USB cable.

Device Driver
  -> USB Support [y]
    -> Inventra Highspeed Dual Role Controller (TI, ADI, ...) [y]
      -> Driver Mode (Both host and peripheral: USB OTG (On The Go) Device
    -> USB Gadget Support [y]
      -> USB Gadget Drivers (Ethernet Gadget (with CDC Ethernet support) [y]
      -> RNDIS support [y]

Feb 6, 2010

Pango Note

Pango
Text layout library
Supports different font technologies:
    * Classic X fonts
    * TrueType fonts (using FreeType)
    * OpenType fonts (using Xft/XRender/FreeType)
• Win32 fonts

Pango architecture
http://fishsoup.net/bib/PangoGuadec2001/slide009.html

Supported Language
    * European languages
    * Asian languages (Chinese, Japanese, Korean, ...)
    * Middle Eastern languages (Arabic, Hebrew, Farsi,...)
    * Indic languages (Devanagari, Bengali, Gujarati, Gurmukhi, Burmese)

Pango has markup language !!!

Pango GL patch http://www.mail-archive.com/pysoy-svn@pysoy.org/msg00761.html
PangoOpenGLRenderer A tale of
http://mail.gnome.org/archives/gtk-i18n-list/2006-July/msg00002.html

http://behdad.org/text/
http://software.schmorp.de/pkg/deliantra/Deliantra-Client.html

Thebes: alternative to Pango used in Mozilla
http://mxr.mozilla.org/seamonkey/source/gfx/src/thebes/
https://developer.mozilla.org/devnews/index.php/2007/12/17/aboutmozilla-beta-2-shipping-firefox-3-icon-preview-add-ons-compatibility-gfx-architecture-and-more/#gfx
http://blog.vlad1.com/2007/12/11/graphics-in-mozilla/

http://people.redhat.com/otaylor/gtk/guadec2-i18n/

Cairo vs. Qt
https://www.kitware.com/InfovisWiki/index.php/Cairo_rendering

http://kcchao.wikidot.com/gtk

Some text layouting link
• http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=CmplxRndExamples
The main characteristics of CTL language complexity are:
    * Bi-directional text, where characters may be written from either right-to-left or left-to-right direction.
    * Context-sensitive shaping (ligatures), where a character may change its shape, dependent on its location and/or the surrounding characters. For example, a character in Arabic script can have at least four different shape forms, depending on context.
    * Ordering, the displayed order of the characters is not the same as the logical order. For example, in Devanagari, which is written from left to right, the grapheme for "short i" appears to the left of ("before") the preceding consonant: in कि ki, the ि -i should render on the left, its bow reaching until above the क k- to the right.


FreeType
Performs font rasterization. Given font data (file or data in memory), it does simple (non-complex) mapping of Unicode characters to glyph indices and rendering glyphs to images.
Fontconfig
Performs font selection based on a pattern of desired font characteristics. These characteristics typically include a family name, style, weight, slant, size, as well as language. Font configuration happens by way of a set of very expressive XML rules. Fontconfig uses FreeType to inspect fonts and caches the results in an mmap()able architecture-specific binary cache.
FriBidi
GNU FriBidi is an implementation of the Unicode Bidirectional Algorithm. Pango uses FriBidi and has an internal copy of it. AbiWord is the other major user of FriBidi. Many other projects use FriBidi as the simplest route to add support for Hebrew and Arabic scripts without adding support for a full complex text rendering engine.
HarfBuzz
HarfBuzz is the meat of the modern GNU/Linux text rendering stack. With OpenType emerging as the universal font format supporting complex text rendering, HarfBuzz, as an OpenType Layout engine, is where all the magic happens. In fact it is of such importance to the stack that it deserves an entire section of its own in this document.
Pango
Pango is, for the most part, the roof of the text rendering stack. Components sitting on top of Pango (eg. GTK+) need not know about complexities of i18n text and are expected to simply use these opaque objects called PangoLayout's. Pango has been designed to satisfy GTK+'s needs for i18n text. However, Pango still provides a low-level API on which one can build their own layout engine. This is what Firefox, Webkit-GTK, etc do, but it has proved to be a cumbersome practice. We will expand on that later.


A good link on software stack - http://maemo.org/maemo_release_documentation/maemo4.1.x/node6.html

Jan 3, 2010

Setup Buildroot for Beagleboard Development

Currently, when development with Beagleboard we often use OE distribution. The OE is hard to maintain for
me, and it requires to open everything so that I use buildroot to develop on Beagleboard.

Here is how to setup one.
1) Download the buildroot from http://www.buildroot.org/
2) You might want to use external toolchain by downloading the ARM toolchain from CodeSourcery (http://www.codesourcery.com/) or build using crosstool-ng
3) You might also want to use the omap linux kernel by downloading it using git (git clone git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git)
4) Extract the buildroot into a folder and type `make menuconfig` to configure it.
   * Target Architecture: arm
   * Target Architecture Variant: generic_arm
   * Target ABI: EABI
   * For my Beagleboard, I need to configure the Target Options > Generic serial port config (y) > and change Serial port to run a getty on to (ttyS2) instead of (ttyS0)
      - If using ttyS0, the my board cannot boot and stuck at `ip: RTNETLINK answers: File exists` (http://forums.xilinx.com/xlnx/board/message?board.id=ELINUX&thread.id=1677)
   * Go to Toolchain settings
      - If you are using External Toolchain, select Toolchain type to External binary toolchain and set the External toolchain path to correct path of your toolchain (i.e. /usr/local/xtools/armunknownlinuxuclibcgnueabi. This is my crosstool-ng installed location)
      - If you are using Internal Toolchain (the toolchain built by buildroot), select  Toolchain type to Buildroot toolchain.

    * Go to Target filesystem options and select the target fs to build.
      - If you are building the u-boot, you need to enter the Das U-Boot Monitor and select
         + board name: omap3_beagle
    * Go to kernel settings
      - If you are using Internal Kernel, select Kernel type to linux (Advanced Configuration) and select the kernel version as well as the configuration file to use (in the Linux Kernel Configuration), I copied the omap3_beagle_defconfig from arch/arm/configs to a specified location and customized it.
      - If you are using External Kernel, select Kernel type to none.
5) Save the configuration and type `make` to build the system. After finished, the image is located at binaries/[project_name]/

NOTE:
   + If using external kernel, you will need to copy the kernel module into the root filesystem at project_build_arm/[project_name]/root or into the NFS root folder. (in kernel folder: make ... INSTALL_MOD_PATH=...)
   + The crosstool-ng cannot compile the uboot because of some bugs (http://old.nabble.com/-U-Boot---PATCH-2-2--ARM:-fix-build-error-with-gcc-4.4.2-about-inline-function-declared-weak-p26188857.html)

TODO:
   + The internal kernel is getting from kernel.org and doesn't contain the patches for omap platform. Need to sync with omap git repository to create the patch and put it under the target/.../ folder inside the buildroot
   + The internal toolchain is generic arm, and does not have omap specified optimization, need to sync with OE repository to create the patch and put it under the toolchain/.../ folder inside the buildroot
   + The internal kernel cannot have USB Gadget Driver, maybe missing some patch for omap
   + Add _defconfig (or board specific into the buildroot)