Subject: port-hp300/3361: "unknown keyboard type" revisited
To: None <gnats-bugs@gnats.netbsd.org>
From: Klaus Klein <kleink@layla.inka.de>
List: netbsd-bugs
Date: 03/19/1997 21:24:45
>Number:         3361
>Category:       port-hp300
>Synopsis:       "unknown keyboard type" revisited
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 19 12:50:02 1997
>Last-Modified:
>Originator:     Klaus Klein
>Organization:
private site
>Release:        970319
>Environment:
System: NetBSD quesera.inka.de 1.2D NetBSD 1.2D (QUESERA) #110: Wed Mar 19 19:59:21 CET 1997 kleink@quesera.inka.de:/a2/src/sys/arch/hp300/compile/QUESERA hp300


>Description:
Back in september (1.2A) I submitted a PR containing a fix for the "unknown
keyboard type" problem I encountered as I was using a german keyboard.
A more elegant solution was commited by thorpej, which looked/read OK but
actually wasn't tested by me as I had already put together a preliminary
german keymap.

When I booted the kernel distributed with the m68k8k upgrade snapshot
(nice work Jason!), each time I pressed an input key a MMU fault
occured. The reason for this lies in gcc/ld not handling external
references correctly in our case when we pull in a "char a[]" by using
"extern char *a"; the external references generated to the default
keymap are invalid and result in MMU faults upon being dereferenced.

>How-To-Repeat:
Boot your hp300 with an "unsupported" console keyboard. Press a key.

>Fix:


Index: hil.c
===================================================================
RCS file: /cvsroot/netbsd/src/sys/arch/hp300/dev/hil.c,v
retrieving revision 1.1.1.1
diff -b -c -r1.1.1.1 hil.c
*** hil.c	1996/12/20 13:25:07	1.1.1.1
--- hil.c	1997/03/19 19:07:19
***************
*** 112,119 ****
  	register int i;
  
  	/* XXX ITE interface */
! 	extern char *us_keymap, *us_shiftmap, *us_ctrlmap,
! 		    *us_ctrlshiftmap, **us_stringmap;
  
  #ifdef DEBUG
  	if (hildebug & HDB_FOLLOW)
--- 112,119 ----
  	register int i;
  
  	/* XXX ITE interface */
! 	extern char us_keymap[], us_shiftmap[], us_ctrlmap[],
! 		    us_ctrlshiftmap[], *us_stringmap[];
  
  #ifdef DEBUG
  	if (hildebug & HDB_FOLLOW)
***************
*** 1186,1192 ****
  	u_char lang;
  
  	/* XXX from hil_keymaps.c */
! 	extern char *us_keymap, *us_shiftmap, *us_ctrlmap;
  
  	hilkbd_cn_device = h;
  
--- 1186,1192 ----
  	u_char lang;
  
  	/* XXX from hil_keymaps.c */
! 	extern char us_keymap[], us_shiftmap[], us_ctrlmap[];
  
  	hilkbd_cn_device = h;
  
>Audit-Trail:
>Unformatted: