25 Oct 2010 20:23
Question about 'device' field of struct console
Timur Tabi <timur <at> freescale.com>
2010-10-25 18:23:30 GMT
2010-10-25 18:23:30 GMT
I'm trying to write a console and TTY driver that's not based on a serial port, and I'm confused by the "device' field of 'struct console'. I found this text in http://www.linux.it/~rubini/docs/sercons/sercons.html: "The purpose of the UDP console device is sending kernel messages through the network. Unlike serial or vt consoles, which are associated to real tty devices, this console has no tty associated, and that's why the device function is not defined. In a real console device, the device function is used to return the device number associated to this console as a kdev_t value. Only one serial port can be elected as a console, for example, and the device function defined by the serial driver is used to tell the caller which one is. The function is used in drivers/char/tty_io.c to redirect any access to /dev/console. Thus, a process that opens /dev/console will actually open a different device, provided at least one of the active console drivers has a device function and the device returned is known to the tty layer. " I don't really understand this. What is a "real tty device"? What am I missing if I don't have a real TTY device? Using other drivers as an example, I can fill the 'device' field with a pointer to this function ehv_bc_console_device(): static struct tty_driver *ehv_bc_driver; static struct tty_driver *ehv_bc_console_device(struct console *c, int *index) { *index = c->index;(Continue reading)
RSS Feed