Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the relationship between framebuffer, VT, and tty?

I'm now studying what is the mechanism behind Ctrl+Alt+F1~F7.

I found some infomation talk about framebuffer, VT, and tty. I know framebuffer is an anstraction to graphic card manipulation and tty(and pts) is something a program interact with. I also find some people talking about VT(virtual terminal), but I don't know what is the relationship between them.

After searching on the web, I made a figure.

figure

I think a VT is a set of monitor and keyboard. If I want to use many tty in one set(one VT), I have to switch between ttys because I only have one monitor to show them. This is VT Swich. But what is VT actually be? A driver, a module, or something else?

I guess if I have two set of monitors and keyboards connect to my computer, I can group them to form two VTs. And I can show my tty1 in monitor1 and control it use keyboard1, and tty2 with monitor2 and keyboard2. I can do VT Switch in both VT, too. Is that true?

And I think I can view framebuffer(fbcon + fbdev) as a graphic card driver, but it is design for console, not for general purpose(proprietary drivers).

Also, there are some special files under /dev

/dev/tty* and /dev/pts/* are for tty
echo can send input to the tty, and cat can recieve output from the tty.

/dev/vcs* are for screen of VT
cat can get the text in the screen, but use it under X get all zero(not empty).

/dev/fb* are for framebuffer
cat can get the whole pixel in the screen, but use it under X get all zero(not empty). I heard that X server doesn't use framebuffer, so what does it use?

Please tell me where I am wrong.

like image 293
Jisa Avatar asked Feb 05 '18 16:02

Jisa


People also ask

What is a framebuffer driver?

A framebuffer is a memory-mapped buffer that represents all the pixels necessary to drive a video display.

What is framebuffer console?

The framebuffer console (fbcon), as its name implies, is a text console running on top of the framebuffer device. It has the functionality of any standard text console driver, such as the VGA console, with the added features that can be attributed to the graphical nature of the framebuffer.

What is kernel framebuffer?

The frame buffer device provides an abstraction for the graphics hardware. It represents the frame buffer of some video hardware and allows application software to access the graphics hardware through a well-defined interface, so the software doesn't need to know anything about the low-level (hardware register) stuff.


1 Answers

  1. Correct tty and pty are terminals. but there is small difference. pty is pseudo terminals. open a terminal type tty will return pts terminal. tty are generally physical if you have used embedded linux you can redirect linux console to different tty which are uart terminals. if you use a 9 pin uart cable. then you can use ttyX.
  2. vcs are differant screens were used pre X-Server erra. or now in server where X server( or even Wayland Server) is not installed. in run level 3 and 5. to try use CTRL + ALT + F3 to access /dev/vc3. you can echo and cat simmilarly.

  3. frame buffer is part of Graphic subsystem its not supposed to be used with cat. It is matrix. its abstraction over any screen connected. to be used by graphical drivers and applications.

like image 101
Devidas Avatar answered Oct 06 '22 09:10

Devidas