Ubuntu DirectFB compilation and installation, sample program compilation and Running Experience

Source: Internet
Author: User
For Ubuntu DirectFB compilation and installation, the source code of the sample program compilation and running experience DirectFB and the sample code can be downloaded to DirectFB.org to the/home/directory /. The entire step is: 1, switch to the directory/home/, extract the two packages: tar-xzfDirectFB-1.3.0.tar.gztar-xzfDirectFB-e

Ubuntu DirectFB compilation and installation, sample program compilation and Running Experience

The source code of DirectFB and the sample can be downloaded to the/home/directory at DirectFB.org /.

The steps are as follows:

1. Switch to the/home/directory and decompress the two packages:

Tar-xzf DirectFB-1.3.0.tar.gz
Tar-xzf DirectFB-examples-1.2.0.tar.gz

2. Install the DirectFB-1.3.0, enter the following commands in sequence

Cd DirectFB-1.3.0

./Configure

Note: If the following prompt appears in the./configure step:

PNG support is missing-Fetch applications won't work correctly!
JPEG support is missing-processing applications won't work correctly!
FreeType2 support is missing-except applications won't work correctly!

For solutions, refer:
Enter the command
Apt-cache search libpng
Apt-cache search libjpeg
Apt-cache search libfreetype
Install the files found in sequence.
For example:

Find the png package: apt-cache search libpng
Install the found related package: apt-get install cl-png libglpng-dev libimage-size-ruby1.8 libpng3-dev wait.


Make

Make install

3. Install DirectFB-examples-1.2.0

A ). vi/boot/grub/menu. lst adds vga = 0x0317 (resolution: 1024*768) or vga = 788 (resolution: 800*600) to the end of the kernel to start the frambuffer. For example:

# **************** Start *************#
Title Ubuntu, kernel 2.6.17-10-generic
Root (hd0, 6)
Kernel/vmlinuz-2.6.17-10-generic root =/dev/sda8 ro quiet splash locale = zh_CN vga = 0x0317
Initrd/initrd. img-2.6.17-10-generic
Quiet
Savedefault
Boot
# **************** Stop **************#

B). updatedb # update the database

C). locate directfb. pc

Find the directfb. pc path, for example, my path is as follows:

/Usr/lib/pkgconfig/directfb. pc
/Usr/lib/pkgconfig/cairo-directfb.pc
/Usr/local/lib/pkgconfig/directfb. pc
/Data/soft/DirectFB-1.1.0/directfb. pc. in
/Data/soft/DirectFB-1.1.0/directfb. pc

D) set the environment and add the pkgconfig library directory obtained in step 1 to the environment:

Export PKG_CONFIG_PATH =/usr/local/lib/pkgconfig
(In this way, the dfb program can only be run on the current terminal. After shutdown, you have to run some commands to run the dfb program. To add the program permanently, you can do this:
If you are using a root user, you can add the following to vi/root/. profile:
PKG_CONFIG_PATH =/usr/local/lib/pkgconfig:/usr/lib/pkgconfig)

E). make

F). make install

G). The directory of the specified directfb library will be:
Vi/etc/ld. so. conf is added to/usr/local/lib in the last line. Save and exit.
Ldconfig
H). restart the computer. If you do not restart the instance, the following error occurs:
(*) DirectFB/Core: Single Application Core)
(!) Direct/Util: opening '/dev/fb0' failed
--> No such device
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: cocould not initialize 'System _ core' core!
--> Initialization error!
Df_andi.c <462>:
(#) DirectFBError [DirectFBCreate (& dfb)]: Initialization error!

4. test example, cd DirectFB-examples-1.3.0/src/, run:

./Df_andi

Installation complete!

In addition, if you want to prevent your directfb application from being displayed in full screen, you can create and modify the/etc/directfbrc file when you do not use the fbdev engine but change it to SDL, I will give it again later.
In the above process, framebuffer may not be started. You need to configure it in ubuntu to enable framebuffer support. refer to the following method.
7.10 framebuffer mode is disabled by default. Therefore, you cannot add vga = xxx to the gurb parameter to enable frame buffer.
Solution:
First, edit your/etc/initramfs-tools/modules file.
Add the following three lines
Fbcon
Vesafb
Vga16fb

The most important step is to comment out the lines vesafb and vga16fb in the file/etc/modprobe. d/blacklist-framebuffer.
In this way, you can add startup parameters such as vga = xxx to the kernel.

It is best to use hwinfo -- framebuffer to check the vga value supported by the video card.
Sudo hwinfo -- framebuffer
Reference:
02: None 00.0: 11001 VESA Framebuffer
[Created at bios.447]
Unique ID: rdCR. il6towt04X5
Hardware Class: framebuffer
Model: "Intel (r) 82945GM Chipset Family Graphics Chip Accelerated vga bios Intel (r) 82945GM Chipset Family Graphics Controller"
Vendor: "Intel Corporation"
Device: "Intel (r) 82945GM Chipset Family Graphics Controller"
SubVendor: "Intel (r) 82945GM Chipset Family Graphics Chip Accelerated vga bios"
SubDevice:
Revision: "Hardware Version 0.0"
Memory Size: 7 MB + 704 kB
Memory Range: 0xd0000000-0xd07affff (rw)
Mode 0x0305: 1024x768 (+ 1024), 8 bits
Mode 0x0317: 1024x768 (+ 2048), 16 bits
Mode 0x0318: 1024x768 (+ 4096), 24 bits
Mode 0x0312: 640x480 (+ 2560), 24 bits
Mode 0x0314: 800x600 (+ 1600), 16 bits
Mode 0x0315: 800x600 (+ 3200), 24 bits
Mode 0x0301: 640x480 (+ 640), 8 bits
Mode 0x0303: 800x600 (+ 832), 8 bits
Mode 0x0311: 640x480 (+ 1280), 16 bits
Config Status: cfg = new, avail = yes, need = no, active = unknown
Vga = 0x0317 is added to the kernel, which is a 16-bit color of x.

Last refresh
Code:
Sudo update-initramfs-u
Restart

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.