From ae7b924322c902f89a7c386c3ab9e09b8e3874ce Mon Sep 17 00:00:00 2001 From: dsl Date: Sat, 13 Mar 2004 22:41:37 +0000 Subject: [PATCH] Translate ascii keycode to help those with azerty keyboard type straight. --- sys/arch/i386/stand/boot/Makefile.boot | 3 ++- sys/arch/i386/stand/lib/boot_params.S | 3 ++- sys/arch/i386/stand/lib/pcio.c | 16 ++++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/arch/i386/stand/boot/Makefile.boot b/sys/arch/i386/stand/boot/Makefile.boot index d528a2fd6965..c197fea81437 100644 --- a/sys/arch/i386/stand/boot/Makefile.boot +++ b/sys/arch/i386/stand/boot/Makefile.boot @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.boot,v 1.13 2003/11/08 00:02:02 dsl Exp $ +# $NetBSD: Makefile.boot,v 1.14 2004/03/13 22:41:37 dsl Exp $ S= ${.CURDIR}/../../../../../ @@ -58,6 +58,7 @@ CPPFLAGS+= -DDIRECT_SERIAL CPPFLAGS+= -DSUPPORT_SERIAL=boot_params.bp_consdev CPPFLAGS+= -DCONSPEED=boot_params.bp_conspeed +CPPFLAGS+= -DCONSOLE_KEYMAP=boot_params.bp_keymap CPPFLAGS+= -DSUPPORT_USTARFS CPPFLAGS+= -DSUPPORT_DOSFS diff --git a/sys/arch/i386/stand/lib/boot_params.S b/sys/arch/i386/stand/lib/boot_params.S index e2c59ebbf470..2d8192179e2e 100644 --- a/sys/arch/i386/stand/lib/boot_params.S +++ b/sys/arch/i386/stand/lib/boot_params.S @@ -1,4 +1,4 @@ -/* $NetBSD: boot_params.S,v 1.1 2003/10/09 10:29:39 dsl Exp $ */ +/* $NetBSD: boot_params.S,v 1.2 2004/03/13 22:41:37 dsl Exp $ */ /* Default boot parameters */ @@ -7,3 +7,4 @@ .long 0 /* console device 0 => CONSDEV_PC */ .long 9600 /* serial baud rate */ .space 16 /* md5 boot password */ + .space 16 /* keyboard xlat map */ diff --git a/sys/arch/i386/stand/lib/pcio.c b/sys/arch/i386/stand/lib/pcio.c index fd8aeae56ba2..2d51cd4c1632 100644 --- a/sys/arch/i386/stand/lib/pcio.c +++ b/sys/arch/i386/stand/lib/pcio.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcio.c,v 1.15 2003/10/08 04:25:45 lukem Exp $ */ +/* $NetBSD: pcio.c,v 1.16 2004/03/13 22:41:38 dsl Exp $ */ /* * Copyright (c) 1996, 1997 @@ -244,13 +244,21 @@ putchar(c) int getchar() { -#ifdef SUPPORT_SERIAL int c; +#ifdef SUPPORT_SERIAL switch (iodev) { default: /* to make gcc -Wall happy... */ case CONSDEV_PC: #endif - return (congetc()); + c = congetc(); +#ifdef CONSOLE_KEYMAP + { + char *cp = strchr(CONSOLE_KEYMAP, c); + if (cp != 0 && cp[1] != 0) + c = cp[1]; + } +#endif + return c; #ifdef SUPPORT_SERIAL case CONSDEV_COM0: case CONSDEV_COM1: @@ -333,7 +341,7 @@ awaitkey(timeout, tell) out: if (tell) - printf("0\n"); + printf("0 \n"); return(c); }