How to Use framebuf to drive fb0 devices in Ubuntu10.10

Source: Internet
Author: User
After using framebuffe to virtualize a display device fb0, I thought for a long time and finally found the answer on the Internet and recorded the test success, in case I forget it later. Although framebuffer has many limitations, for example, the resolution cannot be modified after the kernel is started, the device files abstracted by the framebuffer kernel can easily control the video card and display images. Since framebuffer is the abstraction of the video card, it is equivalent to/dev/fb0 (assuming fb0 ).

After using framebuffe to virtualize a display device fb0, I thought for a long time and finally found the answer on the Internet and recorded the test success, in case I forget it later.

Although framebuffer has many limitations, for example, the resolution cannot be modified after the kernel is started, the device files abstracted by the framebuffer kernel can easily control the video card and display images.

Since framebuffer is the abstraction of the video card, writing data to/dev/fb0 (assuming fb0) is equivalent to writing data to the video memory. Therefore, no matter what environment you are in, the screen will be overwritten, however, there are other processes competing with you for the display right of the video card. Therefore, you need to exclusively use the video card. This was discovered after a long time.

The operations on framebuffer can easily be found on the Internet.

1. Enable framebuffer in a linux system without framebuffer enabled (take Ubuntu 9.04alpha6 as an example)

To enable framebuffer, You need to modify the following files. You can use vi in the command line or gedit. I personally recommend the latter.

Note that you must change the File Permission before proceeding to the next step. The default value is read-only.

Sudo gedit/etc/initramfs-tools/modules

Add two new lines at the end

Fbcon

Vesafb

There are a lot of # in this file. Remember that there cannot be # before the two rows to be added above; otherwise, comment out the strings.

Sudo gedit/etc/modprobe. d/blacklist-framebuffer.conf

  Before executing the preceding command, you must modify the permission. The default value is read-only.

Comment out (add one before #)

Blacklist vesafb

This is easy to find and can be directly commented out.

At the same time, you need to comment out your graphics card driver. My name is nVidia.

Supplement: You can use this command to check if it is missing: sudo lshw

You can view your graphics card model (N or T) in windows and comment it out.

Sudo gedit/boot/grub/menu. lst

This line of command does not include meun. lst in ubuntu10.10 and is now changed to grub. cfg. Therefore, sudo gedit/boot/grub. cfg must be used here:

Add vga = 0x317 (1024x768, 16 bits to the end of the line of the kernel startup parameter, you can also use other resolution modes)

Note: vga = 0x314 is 800*600 16-bit
You can use fbset to set the terminal resolution.
| 640x480 800x600 1024x768 1280x1024
---- + -------------------------------------
256 | 0x301 0x303 0x305 0x307
32 k | 0x310 0x313 0x316 0x319
64 k | 0x311 0x314 0x317 0x31A

16 M | 0x312 0X315 0x318 0X31B

I have not tested the above. I use 0X31B. You can set it based on your own graphics card.

In ubuntu10.10, grub. cfg has no kernel. Find this statement in it:

Linux/boot/vmlinuz-2.6.35-25-generic root = UUID = cabcaf02-31fd-487d-b90c-08c8faaaa2d8 ro quiet splash(Vga = 0x31B) inside the brackets is yourselfIn addition, it is estimated that the permission of this file must be changed. Note: You can use "splash" as a keyword to search for or locate the image.

Then

Sudo update-initramfs-u

Restart!

This is basically done.

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.