Tty is the general name of a class of char devices. They have the same features, such as ^ C processing. The driver uses tty_register_driver to register a TTY.
/Dev/console is a virtual tty, Which is mapped to a real TTY. How to map it will be discussed later.
The console has a variety of meanings. Here, it refers to the printk output device. The driver uses register_console to register a console.
There is a big difference between the console and TTY: the console is an output-only device with simple functions and can only be accessed in the kernel. The tty is a char device and can be accessed by users.ProgramAccess.
The actual driver, for example, the serial port, registers two times for a physical device, one is tty, the other is console, and establishes a connection by recording the TTY primary and secondary device numbers in the console structure.
In the kernel, both TTY and console can register multiple. When the console = ttys0 and other parameters are specified on the kernel command line, the actual console used by printk is determined as the output, and the correspondence between the console and tty is determined, when you open/dev/console, It is mapped to the corresponding TTY. In one sentence:/dev/console maps to the TTY corresponding to the default console.
By the way, it is a coincidence that console = ttys0 and/dev/ttys0 contain the same device name.