How to handle console devices

From: Alan Stern
Date: Tue Sep 29 2009 - 13:24:35 EST


Alan:

Jason and I discussed how console devices (both USB-serial and others)
should be handled. My feeling is that these devices should persist
throughout the entire life of the kernel, not disappearing until the
system goes down. So for example, if ttyUSB0 were to be a console and
the user were to unplug the corresponding USB serial device, ttyUSB0
would remain in existence -- unusable but still there -- and any new
USB serial devices would show up as ttyUSB1 or higher.

In addition, console output shouldn't be sent through these devices
before the driver has properly initialized the hardware. And once
initialized, the hardware should never be shut down.

In the end, this amounts to making the kernel open each console device
when it is registered as a console. The open call would create a tty
and termios to go with the device. The open "file" reference would
never be closed, preventing the tty and termios from being released and
preventing the hardware from being shut down.

I don't know what the best way is to accomplish this. Create dummy
inode and file structs and pass them to the usual tty_open() routine?
(But then what about hangup event handling?) What do you think?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/