|
IntroductionWhen virtual terminals (VTs) are enabled in the kernel (see installing the framebuffer) then 63 tty devices (confusingly known as virtual consoles) are multiplexed onto the framebuffer. Each of these tty devices can be in either a text console or graphics mode and each can have its own framebuffer configuration (display timings, colour format etc). In an Intel PC based Linux system running X windows the user can switch between VTs using the kerboard shortcut Ctrl-Alt-Fn, where n is the VT number. The X session itself is usually running on number 7 and there is usually a number of mingetty terminal logins starting at VT number 1. On a target running the STLinux2.0 distribution with the framebuffer installed and virtual terminals enabled the user will see a black screen. The following will write some text to the screen:
Changing Virtual TerminalST devices typically do not have a keyboard attached, so there is another way for the user to change the current VT. This uses the command:
Where n is the desired VT number, which starts from one not zero. Each VT has an associated tty entry in /dev where VTn is accessed via /dev/ttyn. The device /dev/tty0 always referrs to the currently active VT.
Running Applications on a Virtual TerminalGraphical applications such as the X server or those based on DirectFB will manipulate the virtual terminal state themselves, using Linux specific console IOCTLs (see manual page console_ioctl(4) ). Other applications can be explicitly run on a VT using the command openvt (for the full description of this command please refer the manual page openvt(1) ). For example, to run "ls" on VT 3 and to switch to that VT to see the result you could use:
Changing Display ModeWhen fbset is used to change the display mode, then by default the mode is changed only for the currently active VT. If you change the VT then the display mode will change to whatever configuration that VT is set to. This can cause confusion if you run X or DirectFB applications, as these applications switch automatically to an unused VT; this VT may not be configured for the display mode you wanted. At startup all VTs are set to the default display mode. The fbset option -a or --all will cause the mode of all VTs to be changed to the same settings. Virtual Console ControlThe virtual console attached to a VT can be controled to change attributes such as the text colour using the progam setterm (see the manual page seterm(1) for details). For example, to change the text background to blue and then clear the screen (to blue) you can use:
Note that it is important that the terminal type is set to "linux" so that the setterm and other programs generate the correct escape sequences. One very important attribute set by this method is the console blanking time. After a certain number of minutes the screen will be blanked, in a PC Linux system the console would be unblanked on the next keystroke. In an embedded system this behaviour isn't very desirable; to disable the blanking the following would typically be placed in the system startup scripts after the framebuffer drivers have been loaded:
|
||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||