Linux TTY: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 11: Line 11:
"TTY" is a Linux subsystem that provides the conduit through which keyboard strokes captured while the focus is in a terminal such as [[iTerm2]] or xterm are turned into the right characters and delivered to UNIX processes. At the same time, the TTY subsystem funnels the process' generated output back to the terminal. The name comes from "teletype", which used to be electro-mechanical machines that read keyboard entires, turned them into electrical signals and sent them across the wire to to other teletypes.
"TTY" is a Linux subsystem that provides the conduit through which keyboard strokes captured while the focus is in a terminal such as [[iTerm2]] or xterm are turned into the right characters and delivered to UNIX processes. At the same time, the TTY subsystem funnels the process' generated output back to the terminal. The name comes from "teletype", which used to be electro-mechanical machines that read keyboard entires, turned them into electrical signals and sent them across the wire to to other teletypes.


The TTY subsystem has several kernel components:
=TTY Functions=
==Line Discipline==
TTY subsystem provide line editing services, where a backspace key actually removes the last typed character from an internal editing buffer, instead of being sent to the user process. This functionality is known as ''line discipline''. Line discipline also contain options for character echoing, automatic conversion between CR and LF. User processes have the choices of disabling this functionality, by putting the line discipline in "raw" mode, instead of the default "cooked" (or "canonical") mode.
==Session Management==




Line 17: Line 26:
With the first terminals, there was always a piece of hardware (display or serial port) attached to the device. With XWindows, telnet and ssh, there came a need for software pseudo devices to do the job of standing in for display hardware. These are the pseudo terminals, software that emulates terminal hardware, handling input and output in the same way a physical device would do.
With the first terminals, there was always a piece of hardware (display or serial port) attached to the device. With XWindows, telnet and ssh, there came a need for software pseudo devices to do the job of standing in for display hardware. These are the pseudo terminals, software that emulates terminal hardware, handling input and output in the same way a physical device would do.


==Function of a TTY==
===Line Discipline===
===Session Management===


==Console==
==Console==

Revision as of 23:02, 2 May 2018

External

Internal

Overview

"TTY" is a Linux subsystem that provides the conduit through which keyboard strokes captured while the focus is in a terminal such as iTerm2 or xterm are turned into the right characters and delivered to UNIX processes. At the same time, the TTY subsystem funnels the process' generated output back to the terminal. The name comes from "teletype", which used to be electro-mechanical machines that read keyboard entires, turned them into electrical signals and sent them across the wire to to other teletypes.

The TTY subsystem has several kernel components:

TTY Functions

Line Discipline

TTY subsystem provide line editing services, where a backspace key actually removes the last typed character from an internal editing buffer, instead of being sent to the user process. This functionality is known as line discipline. Line discipline also contain options for character echoing, automatic conversion between CR and LF. User processes have the choices of disabling this functionality, by putting the line discipline in "raw" mode, instead of the default "cooked" (or "canonical") mode.

Session Management

Pseudo tty

With the first terminals, there was always a piece of hardware (display or serial port) attached to the device. With XWindows, telnet and ssh, there came a need for software pseudo devices to do the job of standing in for display hardware. These are the pseudo terminals, software that emulates terminal hardware, handling input and output in the same way a physical device would do.


Console