Linux TTY Frame "Go"

Source: Internet
Author: User

This article was reprinted from: http://ju.outofmemory.cn/entry/2811681. Objective

Because of the serial port, TTY is the most common type of equipment in Linux, and a little bit about the students of Linux system is not unfamiliar to it. Nevertheless, it is believed that few people can return to the question: what is a TTY? What do we mean by the concept of terminal (terminal), console, etc. that we often hang on the lips of?

This article is the first of the Linux TTY Framework analysis article, will take the above questions, introduce the basic concepts of TTY, for the subsequent analysis of the TTY software framework, as well as the Linux serial subsystem analysis, lay a good foundation.

2. Terminal (terminal) 2.1 Basic concepts

In a computer or communication system, the terminal is an electronic (or electrical) device used to enter data into the system (input) or to display the data received by the system (output), which we often call "human-computer interaction devices."

The most typical example of a terminal is the Telex typewriter (teletype)----A long distance information transmission device based on Telegraph technology. A telex typewriter is usually composed of a keyboard, a transceiver, and a printing device. When transmitting, the character's code signal can be automatically sent to the channel (input) by pressing a character key, and the time can automatically receive the code signal from the channel and print out the corresponding character (output).

2.2 UNIX Terminal

In the world of computers, keyboards and monitors are the most commonly used end devices, one for inputting information to the computer and one for displaying the output information of the computer.

In the era of mainframes (mainframe) and small machines (minicomputer), both end-devices and computer hosts belong to the same whole. But in the PC era, things have changed. UNIX founders Ken Thompson and Dennis Ritchie want UNIX to be a multiuser system. Multi-user system means to configure each user a terminal, each user must have a monitor, a keyboard. But at that time all the computer equipment (including the display) price is very expensive, and the keyboard and the host is integrated, there is no independent keyboard.

In the end they found one thing, that is ASR33 Telex typewriter. Although the use of a telex is to send and receive telegrams on a telegraph line, it can also be used as an interface between humans and computers and is inexpensive. The keyboard of the ASR33 typewriter is used to enter information, which is used to output information. So they put ASR33 telex as a terminal, many ASR33 connected to the same host, each user can enter the user name and password to log in to the host. In this way they created the first real multi-user Unix system in computer history, and ASR33 became the first UNIX terminal.

2.3 TTY Devices

From the above introduction, the first UNIX terminal is a telex typewriter named ASR33, while the English word for a telex typewriter is teletype (or teletypewritter), abbreviated to TTY. Therefore, the terminal equipment is also known as a TTY device. This is the name of the TTY source, of course, in the current unix/linux system, the TTY device has evolved into different meanings, we will introduce the evolution process later.

Note 1: Read here, I hope the reader will carefully consider the concept of "equipment". ASR33 's telex typewriter itself is a hardware device, and in the Unix/linux system, this hardware device is abstracted as a "TTY device".

2.4 Serial terminal (serials Terminal)

The early TTY terminals, which are temporarily referred to as telex typewriters, are typically connected via a serial port and a UNIX device, as shown below:

Then, as you know, we can replace the red part (the telex typewriter) with any hardware device with a keyboard, a display, a serial port (such as another PC), as follows:

Therefore, for the unix/linux system, as long as the device through the serial port connection, can be used as terminal equipment, and therefore no longer need to pay attention to the specific terminal form. Over time, the terminal equipment, TTY devices, serial devices and other concepts, gradually mixed together, it is no longer differentiated, in summary, in today's Linux system:

1) TTY device is terminal equipment, terminal equipment is TTY device, no need to distinguish.

2) All the serial devices are TTY devices.

3) Of course, in addition to the serial device, but also developed other forms of TTY devices, such as virtual Terminal (VT), pseudo-terminal (Pseudo Terminal), and so on, these concepts do not expand the description, follow-up will use special article analysis.

3. Control Console (console)

After understanding the concept of terminal and TTY, take a look at another familiar concept: console.

Back to the time when UNIX systems had just supported multi-user (description of section 2.2), the PC had an expensive terminal (its own keyboard, monitor, etc.), and in order to support multiple users, multiple TTY terminals (teletype) could be connected via serial line. In order to show the lofty status of the lake, people call it the console.

Of course, "Lake status" of the said, is purely a joke, but from the console of the Chinese translation-----console, you can see that the self-contained terminal (console) different from the TTY terminal place as follows:

1) Control Console (console) is expensive.

2) The console has more permissions than the TTY terminal, such as user setup, password changes, permission assignment, and so on, which is what "control" means.

3) The system running logs, error messages and so on, usually only output to console terminal, in order to facilitate the administrator "control" and "management."

However, with the development of computer technology, the improvement of operating system, console terminal and the normal TTY terminal line is increasingly blurred, the console can do things, ordinary terminal can also be done. As a result, the console is degraded so that it retains only the 3rd "log Output" functionality in the current Linux system, which is the concept of the console in the Linux TTY framework (refer to the analysis of subsequent articles).

Linux TTY Frame "Go"

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.