How can low-level devices bind to one of the existing tty nodes in the root file system?
Major and minor console and tty-driver numbers are hard-coded. You can find the assigned primary numbers in your system with:
$ cat /proc/devices
Device files are attached to the device driver, supporting the mknod utility, for example, a device file is created after loading the device driver, and not vice versa. To create the device file / dev / tty7, you must enter
$ mknod /dev/tty7 c 4 7
For a link in the kernel source: drivers / tty / tty_io.c: tty_init allocates the major and minor numbers for / dev / tty and / dev / console. tty_register_driver seems to highlight the major and minor numbers for a group of other tty drivers. You may find the answer if you look at the callers.
If you need a high level overview of the structure of the tty subsystem , then tty demystified and LDD3 Chapter 18 TTY drivers are good resources.
source share