Display of Chinese Characters Based on Linux OS Core

Source: Internet
Author: User
The Chinese Character Display Based on the core of the Linux operating system-general Linux technology-Linux programming and kernel information. The following is a detailed description. Before explaining the technical details of "display Chinese Characters Based on Linux core", it is necessary to introduce the operating mechanism of the original Linux. This involves two parts of knowledge. This is the implementation of terminals and frame buffering in Linux.

   Console)

Generally, the console we see in Linux is composed of several devices. They are/dev/ttyN (where tty0 is/dev/console, tty1 and tty2 are different virtual terminals (virtual console )). Generally, the hot key Alt + Fn is used to switch between these virtual terminals. These tty devices correspond to linux/drivers/char/console. c and lvt. c. The console. c is responsible for drawing characters on the screen, and vt. c is responsible for managing different virtual terminals and providing the content to be drawn by console. c. Vt. c submits the content that needs to be drawn by console. c under different virtual terminals to different caches. The Vt. c manager is an array of such buffers and is responsible for switching between these caches and specifying which buffer is activated. The virtual terminal you see corresponds to the activated buffer zone. Console. c is also responsible for receiving input from the terminal, and then placing the received input information in the buffer zone.

   Frame Buffer)

Framebuffer is a device that abstracts the video memory. You can perform operations on the video memory directly through the read/write operations of the device. Such operations are abstract and unified. Users do not have to worry about the location of Physical video memory, page feed mechanism, and other details. These are all completed by the Framebuffer device driver.

The source file of Framebuffer is in the linux/drivers/video/directory. The total abstract device text is used as fbcon. c. There are also source files related to various graphics driver in this directory.

When frame buffering is used, Linux places the video card in graphic mode.

A simple example is provided to illustrate the character display process. Assume that the following simple program is migrated under virtual Terminal 1 (/dev/tty1:
CODE: main ()

{

Puts ("hello, world.

");

}
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.