drivers/char/tty_io.c

Priyanka Grover (priya@cdac.ernet.in)
Thu, 10 Sep 1998 19:07:43 +0530


We, at CDAC, India, are using a technology called "GIST" to proivde support for
Indian Languages. We have a proprietary hardware for the same.

This card provides a functionality of a terminal, allowing one to switch to
different Indian fonts (or the native output from VGA card) without having to
do any changes in software. This is one of the very successful product in Indian
market.

While an independent, serial-card like device interface would have been a
better approach, we have following functionality which made us to use the
existing tty devices:

1. Keyboard had to be redirected to card
2. Capability to switch between normal tty and gist by a simple key sequence,
or by calling a special ioctl,
3. Providing support to switch the output to VGA output and gist output. (VGA
output is fed to the GIST card, and gist card in turn allows switching i.e.
internally it allows VGA output to be redirected to monitor - This is also
the default functionality when booted, so can permananently connect the
VGA output to gist card.)

We have used the existing tty subsystem to achieve the desired functionality
by replacing the console_driver pointer in the tty structure to point to
the "gist driver" routines. We have been able to achieve this with the help of
loadable module, except for one change we had to make to default policy in
tty code.

In the open code for the tty device in tty_io.c, the driver for the device
being opened is reassigned to the original tty driver on every open.

<code snippet from 2.0.xx -- I feel that it remains in current versions of
2.1.xx, but haven't investigated thoroughly. >

file ::
drivers/char/tty_io.c
function ::
static int init_dev(kdev_t device, struct tty_struct **ret_tty)

code ::

tty->driver = *driver; /* N.B. why do this every time?? */
======================

here driver is the console driver for that device obtained using the
"get_tty_driver" function.

Since we redirect the driver to point to the local driver, this reassignment
back to the original tty driver brings the driver' functionality to a still.

We feel that this piece of code is redundant. We are providing a patch for this
to support my driver. And it does not affect the normal behaviour of the system.

What we would like to propose to the community is this , if you feel the code
is not required, can it be removed/commented out? This will save a lot of
trouble to the user base of applying the patch and recompiling the kernel.

We would like to put in more work on this to clean up the tty driver code:

- Make keyboard driver independent of console. It should be possible to
attach the keyboard to required console, especially when there are multiple
VGA cards in the system.
- Support multiple logical keyboards. We wish to have system with two VGA
cards and two keyboards - one standard, other one wireless (through
serial port) or USB.

In essence if I have two monitors and two keyboards, I should be able to
attach whichever kbd I want to other. If there is only one keyboard, allow
a hot key to switch the keyboard to other physical console.

Eagerly waiting for feedback ...

regards,

Priyanka Grover,
(priya@cdac.ernet.in)
Consultant,
CDAC ( Centre for Development of Advanced Computing ),
Pune, INDIA.

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