From: Vojtech P. <vo...@su...> - 2000-06-09 07:35:22
|
On Thu, Jun 08, 2000 at 08:06:59PM -0400, James Simmons wrote: > That can end up being alot of devices. I see you have a ioctl to tell what > device you are attached to. The next question is how to hand a multiheaded > system. You don't want a user to grab someone else mouse at a workstation > 3 offices down. Hum? We will have to think about this. Yes. > I was think about keybdev.c. Not what it does now but using it to > initailize the keyboard indepedent of CONFIG_VT. What about a system with > only a serial console and if someone attaches a keyboard. In this case we > don't have /dev/tty but we should get a /dev/input/event0 for it. A cool > app would grab data from teh keyboard and then do a write on /dev/ttyS0. > PS/2 Keyboard data could be displayed on a serial console then :) So we > should initalize the keyboard outside of keyboard.c to make it avaliable > in any system. Then keyboard.c would be compiled in a VT system to be > translate the events to a tty keymap. If you plug in a PS/2 keyboard (and the i8042 kbd port is active, there is going to be some changes to better support hot-plugging PS/2 keyboards and mice) then the atkbd.c module initializes it and registers it with the input subsystem. evdev.c gets offered the input device, and accepts it, because it accepts any input device. It creates /dev/input/event0. keyboard.c doesn't get offered the device, because it's not compiled in when ve don't have VT's. > I'm using struct vt_struct to represent each physical VT (a display and > a physical keyboard). Btw, can this approach handle two displays with one keyboard? > I'm using number in input_dev as the keyboard > identifier in vt_struct. Maybe it'd be better to use struct input_handle *handle as the keyboard identifier in the vt_struct. > For the function kbd_keycode I pass in this > number. This way I can look threw the vt_structs to find the VT the > keyboard is attached to. Once I find it I have the vt_struct that > represents this physical VT. Searching is not nice. A better way would be to set up the handle->private pointer to point to the VT struct - this way you don't have to search for anything. > The only problem is you use struct tty_struct > which I can't readly grab from vt_struct. Hum? I'm going to have to think > some more. I realize now I need vt_struct as a link list. A link list will > not be that big of performace hit to search since it will never have large > size for multihead systems. Well, it needs to be rethought what's is going to be in struct vt_struct, struct kbd_struct and others and where we can have what pointers to avoid searching. I think almost all searching could be avoided except when adding/removing VTs, consoles, keyboars, mice. > Ug!!! I have to think of a way to tty visiable without using ttytab. In > the future the ttys will dynamic in number so a static array wouldn't > work. By the way, does console switching work for you in the last version on vgacon? -- Vojtech Pavlik SuSE Labs |