On 12/26/2013 09:49 PM, Jakub Klama wrote: > I was investigating how to properly implement serial console > in userspace. I see two possibilities here: > > a) adapt existing srv/hid/input and srv/hid/output to use > UART character device node. Is it possible for two tasks > to have opened char device simultaneously (one for reading > only, other for writing only)?
Take a look at the SLIP server. Slip needs to be able to write to the serial port while blocking in the read operation, and vice versa, so it uses multiple fibrils to achieve this. There are some issues related to this. For example, I had to allow multiple opens of the serial device node in the ns8250 driver to support this, and because of: #508 Parallel sessions don't mix well with call forwarding I had to use two separate sessions. > b) create something like 'srv/hid/sercons' based on remcons > which will create console service and connect input and > output to serial port. During the HelenOS Camp, someone raised the question whether we need all the remcons, sercons and possibly any other specialized *cons and if all these tools could not be unified, just using different transports (network and serial). *Jiri*? *Maurizio*? > Approach a) is much better in terms of code duplication, as > srv/hid/output already implements things like terminal emulation > and srv/hid/input keyboard layouts, etc. But is it possible? I would like someone else to give his opinion on this. But note that there is also the problem of selecting which serial port to use for the user console. In this regard, your option b) seems more flexible. Jakub _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
