歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> 用Qemu模擬器運行DirectFB演示程序

用Qemu模擬器運行DirectFB演示程序

日期:2017/3/1 10:16:42   编辑:Linux編程

在前面一篇文章(使用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:
  1. ~/dfbtest # ./df_window
  2. ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.6.1 |~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. (c) 2001-2012 The world wide DirectFB Open Source Community
  4. (c) 2000-2004 Convergence (integrated media) GmbH
  5. ----------------------------------------------------------------
  6. (*) DirectFB/Core: Multi Application Core. (2012-07-06 14:21) [ DEBUG ][ TRACE ]
  7. (*) Direct/Memcpy: Using armasm_memcpy()
  8. (*) Fusion/SHM: Using MADV_REMOVE (3.4.4.0 >= 2.6.19.2)
  9. (*) Direct/Thread: Started 'Fusion Dispatch' (-1) [MESSAGING OTHER/OTHER 0/0] <8388608>...
  10. (*) Direct/Thread: Started 'Fusion Deferred' (-1) [MESSAGING OTHER/OTHER 0/0] <8388608>...
  11. (*) Direct/Thread: Started 'VT Switcher' (-1) [CRITICAL OTHER/OTHER 0/0] <8388608>...
  12. (*) Direct/Thread: Started 'VT Flusher' (-1) [DEFAULT OTHER/OTHER 0/0] <8388608>...
  13. (*) DirectFB/FBDev: Found 'CLCD FB' (ID 0) with frame buffer at 0x67a00000, 1536k (MMIO 0x10020000, 4k)
  14. sh: nm: not found
  15. (*) Direct/Thread: Started 'PS/2 Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
  16. (*) DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org)
  17. (*) DirectFB/Input: Hot-plug detection enabled with Input Hub Driver
  18. (*) Direct/Thread: Started 'Keyboard Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
  19. (*) DirectFB/Input: Keyboard 0.9 (directfb.org)
  20. (*) Direct/Thread: Started 'Hotplug with Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
  21. (*) DirectFB/Input: Hot-plug detection enabled with Linux Input Driver
  22. (*) DirectFB/Graphics: Generic Software Rasterizer 0.7 (directfb.org)
  23. (*) DirectFB/Core/WM: Default 0.3 (directfb.org)
  24. (*) FBDev/Mode: Setting 1024x768 RGB16
  25. (*) FBDev/Mode: Switched to 1024x768 (virtual 1024x768) at 16 bit (RGB16), pitch 2048
  26. (*) FBDev/Mode: Setting 1024x768 RGB16
  27. (*) FBDev/Mode: Switched to 1024x768 (virtual 1024x768) at 16 bit (RGB16), pitch 2048
  28. (*) Direct/Interface: Loaded 'FT2' implementation of 'IDirectFBFont'.
  29. sh: nm: not found
  30. (*) Direct/Interface: Loaded 'PNG' implementation of 'IDirectFBImageProvider'.
Copyright © Linux教程網 All Rights Reserved