Полезная информация

next up previous contents
Next: Keyboard management Up: The console driver Previous: Writing to the console

Reading the console

Reading the console is accomplished through the line-discipline. The default (and unique) line discipline in is called tty_ldisc_N_TTY. 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 termios flags, the line discipline is what controls input from the tty: raw, cbreak and cooked mode; select(); ioctl() and so on.

The read function in the line discipline is called read_chan(), 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.

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

Converted on:
Mon Apr 1 10:20:16 EST 1996