在前面一篇文章(使用Qemu模擬Cortex-A9運行U-boot和Linux)(見 http://www.linuxidc.com/Linux/2012-07/65478.htm )裡,我們用Qemu虛擬了一個ARM開發板,並且運行起來Linux系統。在這個基礎上就可以移植和運行各種好玩的應用程序了。比如DirectFB。
到 http://directfb.org/ 網站上下載最新的源代碼,我下載的是DirectFB-1.6.1.tar.gz,linux-fusion-8.10.2.tar.gz 和 DirectFB-examples-1.6.0.tar.gz。
其中linux-fusion是屬於內核空間的程序,實現了一種進程間通信的方式,需要跟內核一塊編譯。其它的都是用戶空間程序,按照標准的步驟:先configure --host=arm-linux-gnueabi 再make 最後make install編譯就可以了。只需要注意幾點,一是directfb依賴於其它幾個庫,如libpng,libjpeg等, 需要先把依賴的庫編譯安裝一下; 二是intsall的時候注意安裝目錄。
最後把編譯好的動態庫、可執行程序等拷貝到我們做好的文件系統a9rootfs.ext3裡面,注意為了運行dfb測試程序還要把一些圖片、字體文件拷貝到/usr/local/share/ 目錄下。 然後就可以運行directfb的demo程序了。下面是兩個截圖 ^_^
圖中被覆蓋住的啟動LOG:
- ~/dfbtest # ./df_window
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.6.1 |~~~~~~~~~~~~~~~~~~~~~~~~~~
- (c) 2001-2012 The world wide DirectFB Open Source Community
- (c) 2000-2004 Convergence (integrated media) GmbH
- ----------------------------------------------------------------
-
- (*) DirectFB/Core: Multi Application Core. (2012-07-06 14:21) [ DEBUG ][ TRACE ]
- (*) Direct/Memcpy: Using armasm_memcpy()
- (*) Fusion/SHM: Using MADV_REMOVE (3.4.4.0 >= 2.6.19.2)
- (*) Direct/Thread: Started 'Fusion Dispatch' (-1) [MESSAGING OTHER/OTHER 0/0] <8388608>...
- (*) Direct/Thread: Started 'Fusion Deferred' (-1) [MESSAGING OTHER/OTHER 0/0] <8388608>...
- (*) Direct/Thread: Started 'VT Switcher' (-1) [CRITICAL OTHER/OTHER 0/0] <8388608>...
- (*) Direct/Thread: Started 'VT Flusher' (-1) [DEFAULT OTHER/OTHER 0/0] <8388608>...
- (*) DirectFB/FBDev: Found 'CLCD FB' (ID 0) with frame buffer at 0x67a00000, 1536k (MMIO 0x10020000, 4k)
- sh: nm: not found
- (*) Direct/Thread: Started 'PS/2 Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
- (*) DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org)
- (*) DirectFB/Input: Hot-plug detection enabled with Input Hub Driver
- (*) Direct/Thread: Started 'Keyboard Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
- (*) DirectFB/Input: Keyboard 0.9 (directfb.org)
- (*) Direct/Thread: Started 'Hotplug with Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
- (*) DirectFB/Input: Hot-plug detection enabled with Linux Input Driver
- (*) DirectFB/Graphics: Generic Software Rasterizer 0.7 (directfb.org)
- (*) DirectFB/Core/WM: Default 0.3 (directfb.org)
- (*) FBDev/Mode: Setting 1024x768 RGB16
- (*) FBDev/Mode: Switched to 1024x768 (virtual 1024x768) at 16 bit (RGB16), pitch 2048
- (*) FBDev/Mode: Setting 1024x768 RGB16
- (*) FBDev/Mode: Switched to 1024x768 (virtual 1024x768) at 16 bit (RGB16), pitch 2048
- (*) Direct/Interface: Loaded 'FT2' implementation of 'IDirectFBFont'.
- sh: nm: not found
- (*) Direct/Interface: Loaded 'PNG' implementation of 'IDirectFBImageProvider'.