在前面一篇文章(使用Qemu模拟Cortex-A9运行U-boot和Linux)(见 )里,我们用Qemu虚拟了一个ARM开发板,并且运行起来Linux系统。在这个基础上就可以移植和运行各种好玩的应用程序了。比如DirectFB。
到 网站上下载最新的源代码,我下载的是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'.