Virutal tty device settings problem.

From: dpc@xxxxxxxxxx
Date: Mon Oct 31 2011 - 11:21:34 EST


I'm writing a virtual console driver for paravirtualized setup.

Use case: being able to access paravirtualized guest consoles from "domain 0".

It's similar to HVCS, as I've been analyzing how it works.

Basically in my driver there's a frontend and backend. Backend is used
by domain 0 exposing tty devices: each for every other guest. One can
attach cu/minicom to such device and access guest console.

The frontend is working on the other guest side and communicate via
shared memory/virtual IRQs with backend. It exposes on tty device for
system console / getty.

Little illustration:

| GUEST 0 | |
tty device <--> kernel backend driver <--> magic here <--> kernel
frontend driver <--> tty device

I have the communication working and my driver transmits bytes between
domain 0 and other systems. So the "magic here" can be considered a
bytestream. But I'm lost with all the modes, cr/nl etc. conversions.

I don't understand which part of the kernel is responsible for NL / CR
conversions, what modes should I use on each side of the driver and
stuff like this. At the moment, from what I understand it seems that
some of termios flags are handled above tty driver layer, and other
should be handled inside/below it. Can anyone point me to documents
explaining this things or explain how should I handle this so that the
scenario from the illustration is working seamlessly?

Any help will be much appreciated.
Dawid CiÄÅarkiewicz
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at