Reading the console

% Reading the console is accomplished through the line-discipline. The default (and unique) line discipline in \ is called <#2660#> tty_ldisc_N_TTY<#2660#>. The line discipline is what ``disciplines input through a line''. It is another function table (we're used to the approach, aren't we?), which is concerned with reading the device. With the help of <#2661#> termios<#2661#> flags, the line discipline is what controls input from the tty: raw, cbreak and cooked mode; <#2662#> select()<#2662#>; <#2663#> ioctl()<#2663#> and so on. The read function in the line discipline is called <#2664#> read_chan()<#2664#>, which reads the tty buffer independently of whence it came from. The reason is that character arrival through a tty is managed by asynchronous hardware interrupts.

#tex2html_wrap2970#

The lowest level of console input is part of keyboard management, and thus it is handled within <#2668#> keyboard.c<#2668#>, in the function <#2669#> keyboard_interrupt()<#2669#>.