|
楼主 |
发表于 2005-11-28 07:22:29
|
显示全部楼层
我要具体介绍一下自己是怎么改内核补丁的,因为内核更新太快,我又没有时间,也没有兴趣做简单重复的劳动,现在我对阅读fbcon.c发生了兴趣,所以在我搞懂这个之前,可能不会再发布新的补丁,而你们,可以从我的介绍中,自己找到方法来解决问题。
首先,打上日本人的补丁,然后是要修改drivers/input/keyboard/atkbd.c
[PHP]diff -urNp linux/drivers/input/keyboard/atkbd.c /linux/drivers/input/keyboard/atkbd.c
--- linux/drivers/input/keyboard/atkbd.c 2005-11-26 13:39:19.000000000 +0000
+++ linux/drivers/input/keyboard/atkbd.c 2005-11-26 13:55:22.000000000 +0000
@@ -290,6 +290,56 @@ static irqreturn_t atkbd_interrupt(struc
if (!atkbd->enabled)
goto out;
+#ifdef CONFIG_UNICON
+#define LR_CTRL_KEY_DOWN 0x1d
+#define LR_CTRL_KEY_UP (LR_CTRL_KEY_DOWN + 0x80)
+#define L_ALT_KEY_DOWN 0x38
+#define L_ALT_KEY_UP (L_ALT_KEY_DOWN + 0x80)
+#define NUM_LOCK_KEY_DOWN 0x45
+extern int (*Unicon_fnLowerKeyHook) (unsigned char ch);
+extern int (*Unicon_fnKeyHook) (struct tty_struct *tty, \
+ unsigned char ch, char flag);
+extern void (*Unicon_TtyChangeUpdate) (int nTty);
+#endif
+
+#ifdef CONFIG_UNICON
+ if (Unicon_fnLowerKeyHook != NULL)
+ {
+ static int ctrl_pressed = 0,
+ alt_pressed = 0;
+ switch (data)
+ {
+ case NUM_LOCK_KEY_DOWN:
+ if (ctrl_pressed == 1 &&
+ alt_pressed == 1)
+ {
+ Unicon_fnKeyHook = NULL;
+ Unicon_fnLowerKeyHook = NULL;
+ Unicon_TtyChangeUpdate = NULL;
+ printk ("release unicon key hook successfully.\n");
+ }
+ else
+ break;
+ case LR_CTRL_KEY_DOWN:
+ ctrl_pressed = 1;
+ break;
+ case LR_CTRL_KEY_UP:
+ ctrl_pressed = 0;
+ break;
+ case L_ALT_KEY_DOWN:
+ alt_pressed = 1;
+ break;
+ case L_ALT_KEY_UP:
+ alt_pressed = 0;
+ break;
+ }
+ /* return 1 ==> processed by kernel
+ return 0 ==> processed by app */
+ if ((*Unicon_fnLowerKeyHook) (data) == 1)
+ goto out;
+ }
+#endif
+
input_event(&atkbd->dev, EV_MSC, MSC_RAW, code);
if (atkbd->translated) {
[/PHP]
接着是:
[PHP]diff -urNp linux/include/linux/tty_flip.h ./linux/include/linux/tty_flip.h
--- linux/include/linux/tty_flip.h 2005-11-26 13:39:38.000000000 +0000
+++ linux/include/linux/tty_flip.h 2005-11-26 13:55:50.000000000 +0000
@@ -7,9 +7,25 @@
#define _INLINE_ static __inline__
#endif
+#ifdef CONFIG_UNICON
+extern int (*Unicon_fnKeyHook) (struct tty_struct *tty,
+ unsigned char ch, char flag);
+#endif
+
+
_INLINE_ void tty_insert_flip_char(struct tty_struct *tty,
unsigned char ch, char flag)
{
+#ifdef CONFIG_UNICON
+ if (Unicon_fnKeyHook != NULL)
+ {
+ /* return 1 ==> processed by kernel
+ return 0 ==> processed by app */
+ if ((*Unicon_fnKeyHook) (tty, ch, flag) == 1)
+ return;
+ }
+#endif
+
if (tty->flip.count < TTY_FLIPBUF_SIZE) {
tty->flip.count++;
*tty->flip.flag_buf_ptr++ = flag;
[/PHP]
然后看看drivers/video/unicon下面的xl_keymasks.c在不在,不在的就从我的补丁中拷贝一个。
现在去看我那个丑陋的手法,在xl_unikey.c
[PHP]+void device_cls_input_bottom (char *cl)
+{
+ unsigned color;
+ unsigned long flags;
+
+ spin_lock_irqsave(&unikey_read_lock, flags);
+ if (bHasClosed [nCurTty - 1] == 0)
+ copy_from_user(&color, cl, sizeof(unsigned char));
+ else
+ color = 0;
+
+ FbClearRect (&our_fbhzinfo, color,
+ (our_fbhzinfo.height/16)*2-2,
+ (our_fbhzinfo.height/16)*2-1);
+ spin_unlock_irqrestore(&unikey_read_lock, flags);
+}
[/PHP]
看见那个奇怪的 (our_fbhzinfo.height/16)*2-2吗,它和我在unicon中的Unikey.cpp的修改出于一辙,我看都是被fbcon.c的改动坑的。
现在,检查一下别的地方和原来有没有变化就可以了。 |
|