Q: what is the need for console write callback if there is serial tx (start_tx) ?
Hello, I am writing a driver with serial tx/rx. I am not sure what is the need console routines, when there is serial/uart tx/rx. Isn't writing to console, the same as outputing chars to serial ? I've tried to find information on this, but found none. Thank you, Ran
On Thu, 15 Sep 2016 23:19:51 +0300, Ran Shalit said:
Isn't writing to console, the same as outputing chars to serial ?
No. For instance, consider any laptop where "console" is an LCD screen, and if it's recent hardware, there isn't a UART anywhere in the device, nor is there a serial port to connect to. Or any system where virtual terminals are in the config, for that matter. Then there's netconsole, console-over-USB, and heaven knows what other variations. See Documentation/console/console.txt for more information.
On Thu, Sep 15, 2016 at 11:50 PM, <Valdis.Kletnieks@vt.edu> wrote:
On Thu, 15 Sep 2016 23:19:51 +0300, Ran Shalit said:
Isn't writing to console, the same as outputing chars to serial ?
No. For instance, consider any laptop where "console" is an LCD screen, and if it's recent hardware, there isn't a UART anywhere in the device, nor is there a serial port to connect to. Or any system where virtual terminals are in the config, for that matter.
Then there's netconsole, console-over-USB, and heaven knows what other variations.
See Documentation/console/console.txt for more information.
Hi, I seen in kernel tty drivers examples where there are both callback for serial (start_tx, etc) , and for console (register_console). I am not sure what reason for having a driver support both console and serial. when there is serail it means there is a uart consoller, according to my understand the console routine also implement put_char with the same uart console (not graphic display for example), so it seems like duplication. I am probably miss understand something. Thanks you, Ran
On Thu, Sep 15, 2016 at 11:19:51PM +0300, Ran Shalit wrote:
Hello,
I am writing a driver with serial tx/rx.
Great! For what type of hardware?
I am not sure what is the need console routines, when there is serial/uart tx/rx.
Isn't writing to console, the same as outputing chars to serial ?
I've tried to find information on this, but found none.
Just follow the "normal" tty api and your driver should be fine and work with all sorts of consoles and programs and line disciplines. good luck! greg k-h
participants (3)
-
Greg KH -
Ran Shalit -
Valdis.Kletnieks@vt.edu