Terminal
tty_architecture.pngfig3.png
  • PC monitor is usually called the console and has several device special files associated with it: tty0, tty1, tty2; the console for a PC Linux system is normally the computer monitor in text mode. It emulates a terminal of type "Linux".
  • On modern small computers the console is usually the computer's attached monitor and keyboard; On many older computers the console is an RS-232 link to a terminal such as a DEC VT100(Serial Console.)
  • Logical system console
    • /dev/console is used to send messages to the console.
    • /dev/syscon for some System V
  • Physical system console
    • /dev/systty points to the device which is used by the attached monitor and keyboard, often /dev/tty0
  • Terminal Emulation
    • make the PC computer behave like a text terminal
    • a real terminal to emulate another brand/model of terminal
struct ktermios tty_std_termios = {     /* for the benefit of tty drivers  */
        .c_iflag = ICRNL | IXON,
        .c_oflag = OPOST | ONLCR,
        .c_cflag = B38400 | CS8 | CREAD | HUPCL,
        .c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK |
                   ECHOCTL | ECHOKE | IEXTEN,
        .c_cc = INIT_C_CC,
        .c_ispeed = 38400,
        .c_ospeed = 38400
};
  • tty_driver
  • 24.2.5 Job Control Signals
    • Macro: int SIGTTIN
      • A process cannot read from the user’s terminal while it is running as a background job. When any process in a background job tries to read from the terminal, all of the processes in the job are sent a SIGTTIN signal. The default action for this signal is to stop the process. For more information about how this interacts with the terminal driver, see Access to the Terminal.
    • Macro: int SIGTTOU
      • This is similar to SIGTTIN, but is generated when a process in a background job attempts to write to the terminal or set its modes. Again, the default action is to stop the process. SIGTTOU is only generated for an attempt to write to the terminal if the TOSTOP output mode is set; see Output Modes.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License