Index: kernel/arch/amd64/Makefile.inc
===================================================================
--- kernel/arch/amd64/Makefile.inc	(revision b4fa652eb2b10684af9602bd804587917a8ed99d)
+++ kernel/arch/amd64/Makefile.inc	(revision b006a2c8990750690f6845007fe696ea0c726deb)
@@ -62,4 +62,6 @@
 
 CONFIG_I8042 = y
+CONFIG_I8042_PC = y
+DEFS += -DCONFIG_I8042_PC
 
 ## Accepted configuration directives
Index: kernel/arch/ia32/Makefile.inc
===================================================================
--- kernel/arch/ia32/Makefile.inc	(revision b4fa652eb2b10684af9602bd804587917a8ed99d)
+++ kernel/arch/ia32/Makefile.inc	(revision b006a2c8990750690f6845007fe696ea0c726deb)
@@ -81,5 +81,6 @@
 
 CONFIG_I8042 = y
-
+CONFIG_I8042_PC = y
+DEFS += -DCONFIG_I8042_PC
 
 ## Accepted configuration directives
Index: kernel/arch/sparc64/Makefile.inc
===================================================================
--- kernel/arch/sparc64/Makefile.inc	(revision b4fa652eb2b10684af9602bd804587917a8ed99d)
+++ kernel/arch/sparc64/Makefile.inc	(revision b006a2c8990750690f6845007fe696ea0c726deb)
@@ -65,4 +65,6 @@
 
 CONFIG_I8042 = y
+CONFIG_I8042_SUN = y
+DEFS += -DCONFIG_I8042_SUN
 
 ARCH_SOURCES = \
Index: kernel/genarch/Makefile.inc
===================================================================
--- kernel/genarch/Makefile.inc	(revision b4fa652eb2b10684af9602bd804587917a8ed99d)
+++ kernel/genarch/Makefile.inc	(revision b006a2c8990750690f6845007fe696ea0c726deb)
@@ -69,3 +69,13 @@
 	GENARCH_SOURCES += \
 		genarch/src/i8042/i8042.c
+		
+	ifeq ($(CONFIG_I8042_PC),y)
+		GENARCH_SOURCES += \
+			genarch/src/i8042/scanc_pc.c
+	endif
+	ifeq ($(CONFIG_I8042_SUN),y)
+		GENARCH_SOURCES += \
+			genarch/src/i8042/scanc_sun.c
+	endif
+	
 endif
Index: kernel/genarch/include/i8042/i8042.h
===================================================================
--- kernel/genarch/include/i8042/i8042.h	(revision b4fa652eb2b10684af9602bd804587917a8ed99d)
+++ kernel/genarch/include/i8042/i8042.h	(revision b006a2c8990750690f6845007fe696ea0c726deb)
@@ -27,5 +27,5 @@
  */
 
- /** @addtogroup genarch	
+/** @addtogroup genarch	
  * @{
  */
@@ -36,18 +36,15 @@
 #define __I8042_H__
 
-/** Scancodes. */
-#define SC_ESC		0x01
-#define SC_BACKSPACE	0x0e
-#define SC_LSHIFT	0x2a
-#define SC_RSHIFT	0x36
-#define SC_CAPSLOCK	0x3a
-#define SC_SPEC_ESCAPE  0xe0
-#define SC_LEFTARR      0x4b
-#define SC_RIGHTARR     0x4d
-#define SC_UPARR        0x48
-#define SC_DOWNARR      0x50
-#define SC_DELETE       0x53
-#define SC_HOME         0x47
-#define SC_END          0x4f
+#ifdef CONFIG_I8042_PC
+#include <genarch/i8042/scanc_pc.h>
+#endif
+#ifdef CONFIG_I8042_SUN
+#include <genarch/i8042/scanc_sun.h>
+#endif
+
+#define SPECIAL		'?'
+
+extern char sc_primary_map[];
+extern char sc_secondary_map[];
 
 extern void i8042_init(void);
@@ -58,5 +55,4 @@
 #endif
 
- /** @}
+/** @}
  */
-
Index: kernel/genarch/include/i8042/scanc_pc.h
===================================================================
--- kernel/genarch/include/i8042/scanc_pc.h	(revision b006a2c8990750690f6845007fe696ea0c726deb)
+++ kernel/genarch/include/i8042/scanc_pc.h	(revision b006a2c8990750690f6845007fe696ea0c726deb)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup genarch	
+ * @{
+ */
+/**
+ * @file
+ * @brief	Scan codes for pc keyboards.
+ */
+
+#ifndef KERN_I8042_PC_H_
+#define KERN_I8042_PC_H_
+
+#define SC_ESC		0x01
+#define SC_BACKSPACE	0x0e
+#define SC_LSHIFT       0x2a
+#define SC_RSHIFT       0x36
+#define SC_CAPSLOCK     0x3a
+#define SC_SPEC_ESCAPE  0xe0
+#define SC_LEFTARR      0x4b
+#define SC_RIGHTARR     0x4d
+#define SC_UPARR        0x48
+#define SC_DOWNARR      0x50
+#define SC_DELETE       0x53
+#define SC_HOME         0x47
+#define SC_END          0x4f
+
+#endif
+
+/** @}
+ */
Index: kernel/genarch/include/i8042/scanc_sun.h
===================================================================
--- kernel/genarch/include/i8042/scanc_sun.h	(revision b006a2c8990750690f6845007fe696ea0c726deb)
+++ kernel/genarch/include/i8042/scanc_sun.h	(revision b006a2c8990750690f6845007fe696ea0c726deb)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup genarch	
+ * @{
+ */
+/**
+ * @file
+ * @brief	Scan codes for sun keyboards.
+ */
+
+#ifndef KERN_I8042_SUN_H_
+#define KERN_I8042_SUN_H_
+
+#define SC_ESC		0x1d
+#define SC_BACKSPACE	0x2b
+#define SC_LSHIFT       0x63
+#define SC_RSHIFT       0x6e
+#define SC_CAPSLOCK     0x77
+#define SC_SPEC_ESCAPE  0xe0	/* ??? */
+#define SC_LEFTARR      0x18
+#define SC_RIGHTARR     0x1c
+#define SC_UPARR        0x14
+#define SC_DOWNARR      0x1b
+#define SC_DELETE       0x42
+#define SC_HOME         0x34
+#define SC_END          0x4a
+
+#endif
+
+/** @}
+ */
Index: kernel/genarch/src/i8042/i8042.c
===================================================================
--- kernel/genarch/src/i8042/i8042.c	(revision b4fa652eb2b10684af9602bd804587917a8ed99d)
+++ kernel/genarch/src/i8042/i8042.c	(revision b006a2c8990750690f6845007fe696ea0c726deb)
@@ -77,5 +77,4 @@
 #define i8042_MOUSE_DATA        0x20
 
-#define SPECIAL		'?'
 #define KEY_RELEASE	0x80
 
@@ -109,164 +108,4 @@
 	.resume = i8042_resume,
 	.read = key_read
-};
-
-/** Primary meaning of scancodes. */
-static char sc_primary_map[] = {
-	SPECIAL, /* 0x00 */
-	SPECIAL, /* 0x01 - Esc */
-	'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',
-	'\b', /* 0x0e - Backspace */
-	'\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n',
-	SPECIAL, /* 0x1d - LCtrl */
-	'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'',
-	'`',
-	SPECIAL, /* 0x2a - LShift */ 
-	'\\',
-	'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/',
-	SPECIAL, /* 0x36 - RShift */
-	'*',
-	SPECIAL, /* 0x38 - LAlt */
-	' ',
-	SPECIAL, /* 0x3a - CapsLock */
-	SPECIAL, /* 0x3b - F1 */
-	SPECIAL, /* 0x3c - F2 */
-	SPECIAL, /* 0x3d - F3 */
-	SPECIAL, /* 0x3e - F4 */
-	SPECIAL, /* 0x3f - F5 */
-	SPECIAL, /* 0x40 - F6 */
-	SPECIAL, /* 0x41 - F7 */
-	SPECIAL, /* 0x42 - F8 */
-	SPECIAL, /* 0x43 - F9 */
-	SPECIAL, /* 0x44 - F10 */
-	SPECIAL, /* 0x45 - NumLock */
-	SPECIAL, /* 0x46 - ScrollLock */
-	'7', '8', '9', '-',
-	'4', '5', '6', '+',
-	'1', '2', '3',
-	'0', '.',
-	SPECIAL, /* 0x54 - Alt-SysRq */
-	SPECIAL, /* 0x55 - F11/F12/PF1/FN */
-	SPECIAL, /* 0x56 - unlabelled key next to LAlt */
-	SPECIAL, /* 0x57 - F11 */
-	SPECIAL, /* 0x58 - F12 */
-	SPECIAL, /* 0x59 */
-	SPECIAL, /* 0x5a */
-	SPECIAL, /* 0x5b */
-	SPECIAL, /* 0x5c */
-	SPECIAL, /* 0x5d */
-	SPECIAL, /* 0x5e */
-	SPECIAL, /* 0x5f */
-	SPECIAL, /* 0x60 */
-	SPECIAL, /* 0x61 */
-	SPECIAL, /* 0x62 */
-	SPECIAL, /* 0x63 */
-	SPECIAL, /* 0x64 */
-	SPECIAL, /* 0x65 */
-	SPECIAL, /* 0x66 */
-	SPECIAL, /* 0x67 */
-	SPECIAL, /* 0x68 */
-	SPECIAL, /* 0x69 */
-	SPECIAL, /* 0x6a */
-	SPECIAL, /* 0x6b */
-	SPECIAL, /* 0x6c */
-	SPECIAL, /* 0x6d */
-	SPECIAL, /* 0x6e */
-	SPECIAL, /* 0x6f */
-	SPECIAL, /* 0x70 */
-	SPECIAL, /* 0x71 */
-	SPECIAL, /* 0x72 */
-	SPECIAL, /* 0x73 */
-	SPECIAL, /* 0x74 */
-	SPECIAL, /* 0x75 */
-	SPECIAL, /* 0x76 */
-	SPECIAL, /* 0x77 */
-	SPECIAL, /* 0x78 */
-	SPECIAL, /* 0x79 */
-	SPECIAL, /* 0x7a */
-	SPECIAL, /* 0x7b */
-	SPECIAL, /* 0x7c */
-	SPECIAL, /* 0x7d */
-	SPECIAL, /* 0x7e */
-	SPECIAL, /* 0x7f */
-};
-
-/** Secondary meaning of scancodes. */
-static char sc_secondary_map[] = {
-	SPECIAL, /* 0x00 */
-	SPECIAL, /* 0x01 - Esc */
-	'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',
-	SPECIAL, /* 0x0e - Backspace */
-	'\t', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n',
-	SPECIAL, /* 0x1d - LCtrl */
-	'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"',
-	'~',
-	SPECIAL, /* 0x2a - LShift */ 
-	'|',
-	'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?',
-	SPECIAL, /* 0x36 - RShift */
-	'*',
-	SPECIAL, /* 0x38 - LAlt */
-	' ',
-	SPECIAL, /* 0x3a - CapsLock */
-	SPECIAL, /* 0x3b - F1 */
-	SPECIAL, /* 0x3c - F2 */
-	SPECIAL, /* 0x3d - F3 */
-	SPECIAL, /* 0x3e - F4 */
-	SPECIAL, /* 0x3f - F5 */
-	SPECIAL, /* 0x40 - F6 */
-	SPECIAL, /* 0x41 - F7 */
-	SPECIAL, /* 0x42 - F8 */
-	SPECIAL, /* 0x43 - F9 */
-	SPECIAL, /* 0x44 - F10 */
-	SPECIAL, /* 0x45 - NumLock */
-	SPECIAL, /* 0x46 - ScrollLock */
-	'7', '8', '9', '-',
-	'4', '5', '6', '+',
-	'1', '2', '3',
-	'0', '.',
-	SPECIAL, /* 0x54 - Alt-SysRq */
-	SPECIAL, /* 0x55 - F11/F12/PF1/FN */
-	SPECIAL, /* 0x56 - unlabelled key next to LAlt */
-	SPECIAL, /* 0x57 - F11 */
-	SPECIAL, /* 0x58 - F12 */
-	SPECIAL, /* 0x59 */
-	SPECIAL, /* 0x5a */
-	SPECIAL, /* 0x5b */
-	SPECIAL, /* 0x5c */
-	SPECIAL, /* 0x5d */
-	SPECIAL, /* 0x5e */
-	SPECIAL, /* 0x5f */
-	SPECIAL, /* 0x60 */
-	SPECIAL, /* 0x61 */
-	SPECIAL, /* 0x62 */
-	SPECIAL, /* 0x63 */
-	SPECIAL, /* 0x64 */
-	SPECIAL, /* 0x65 */
-	SPECIAL, /* 0x66 */
-	SPECIAL, /* 0x67 */
-	SPECIAL, /* 0x68 */
-	SPECIAL, /* 0x69 */
-	SPECIAL, /* 0x6a */
-	SPECIAL, /* 0x6b */
-	SPECIAL, /* 0x6c */
-	SPECIAL, /* 0x6d */
-	SPECIAL, /* 0x6e */
-	SPECIAL, /* 0x6f */
-	SPECIAL, /* 0x70 */
-	SPECIAL, /* 0x71 */
-	SPECIAL, /* 0x72 */
-	SPECIAL, /* 0x73 */
-	SPECIAL, /* 0x74 */
-	SPECIAL, /* 0x75 */
-	SPECIAL, /* 0x76 */
-	SPECIAL, /* 0x77 */
-	SPECIAL, /* 0x78 */
-	SPECIAL, /* 0x79 */
-	SPECIAL, /* 0x7a */
-	SPECIAL, /* 0x7b */
-	SPECIAL, /* 0x7c */
-	SPECIAL, /* 0x7d */
-	SPECIAL, /* 0x7e */
-	SPECIAL, /* 0x7f */	
 };
 
Index: kernel/genarch/src/i8042/scanc_pc.c
===================================================================
--- kernel/genarch/src/i8042/scanc_pc.c	(revision b006a2c8990750690f6845007fe696ea0c726deb)
+++ kernel/genarch/src/i8042/scanc_pc.c	(revision b006a2c8990750690f6845007fe696ea0c726deb)
@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup genarch	
+ * @{
+ */
+/**
+ * @file
+ * @brief	Scan codes for pc keyboards.
+ */
+
+#include <genarch/i8042/i8042.h>
+
+/** Primary meaning of scancodes. */
+char sc_primary_map[] = {
+	SPECIAL, /* 0x00 */
+	SPECIAL, /* 0x01 - Esc */
+	'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',
+	'\b', /* 0x0e - Backspace */
+	'\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n',
+	SPECIAL, /* 0x1d - LCtrl */
+	'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'',
+	'`',
+	SPECIAL, /* 0x2a - LShift */ 
+	'\\',
+	'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/',
+	SPECIAL, /* 0x36 - RShift */
+	'*',
+	SPECIAL, /* 0x38 - LAlt */
+	' ',
+	SPECIAL, /* 0x3a - CapsLock */
+	SPECIAL, /* 0x3b - F1 */
+	SPECIAL, /* 0x3c - F2 */
+	SPECIAL, /* 0x3d - F3 */
+	SPECIAL, /* 0x3e - F4 */
+	SPECIAL, /* 0x3f - F5 */
+	SPECIAL, /* 0x40 - F6 */
+	SPECIAL, /* 0x41 - F7 */
+	SPECIAL, /* 0x42 - F8 */
+	SPECIAL, /* 0x43 - F9 */
+	SPECIAL, /* 0x44 - F10 */
+	SPECIAL, /* 0x45 - NumLock */
+	SPECIAL, /* 0x46 - ScrollLock */
+	'7', '8', '9', '-',
+	'4', '5', '6', '+',
+	'1', '2', '3',
+	'0', '.',
+	SPECIAL, /* 0x54 - Alt-SysRq */
+	SPECIAL, /* 0x55 - F11/F12/PF1/FN */
+	SPECIAL, /* 0x56 - unlabelled key next to LAlt */
+	SPECIAL, /* 0x57 - F11 */
+	SPECIAL, /* 0x58 - F12 */
+	SPECIAL, /* 0x59 */
+	SPECIAL, /* 0x5a */
+	SPECIAL, /* 0x5b */
+	SPECIAL, /* 0x5c */
+	SPECIAL, /* 0x5d */
+	SPECIAL, /* 0x5e */
+	SPECIAL, /* 0x5f */
+	SPECIAL, /* 0x60 */
+	SPECIAL, /* 0x61 */
+	SPECIAL, /* 0x62 */
+	SPECIAL, /* 0x63 */
+	SPECIAL, /* 0x64 */
+	SPECIAL, /* 0x65 */
+	SPECIAL, /* 0x66 */
+	SPECIAL, /* 0x67 */
+	SPECIAL, /* 0x68 */
+	SPECIAL, /* 0x69 */
+	SPECIAL, /* 0x6a */
+	SPECIAL, /* 0x6b */
+	SPECIAL, /* 0x6c */
+	SPECIAL, /* 0x6d */
+	SPECIAL, /* 0x6e */
+	SPECIAL, /* 0x6f */
+	SPECIAL, /* 0x70 */
+	SPECIAL, /* 0x71 */
+	SPECIAL, /* 0x72 */
+	SPECIAL, /* 0x73 */
+	SPECIAL, /* 0x74 */
+	SPECIAL, /* 0x75 */
+	SPECIAL, /* 0x76 */
+	SPECIAL, /* 0x77 */
+	SPECIAL, /* 0x78 */
+	SPECIAL, /* 0x79 */
+	SPECIAL, /* 0x7a */
+	SPECIAL, /* 0x7b */
+	SPECIAL, /* 0x7c */
+	SPECIAL, /* 0x7d */
+	SPECIAL, /* 0x7e */
+	SPECIAL, /* 0x7f */
+};
+
+/** Secondary meaning of scancodes. */
+char sc_secondary_map[] = {
+	SPECIAL, /* 0x00 */
+	SPECIAL, /* 0x01 - Esc */
+	'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',
+	SPECIAL, /* 0x0e - Backspace */
+	'\t', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n',
+	SPECIAL, /* 0x1d - LCtrl */
+	'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"',
+	'~',
+	SPECIAL, /* 0x2a - LShift */ 
+	'|',
+	'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?',
+	SPECIAL, /* 0x36 - RShift */
+	'*',
+	SPECIAL, /* 0x38 - LAlt */
+	' ',
+	SPECIAL, /* 0x3a - CapsLock */
+	SPECIAL, /* 0x3b - F1 */
+	SPECIAL, /* 0x3c - F2 */
+	SPECIAL, /* 0x3d - F3 */
+	SPECIAL, /* 0x3e - F4 */
+	SPECIAL, /* 0x3f - F5 */
+	SPECIAL, /* 0x40 - F6 */
+	SPECIAL, /* 0x41 - F7 */
+	SPECIAL, /* 0x42 - F8 */
+	SPECIAL, /* 0x43 - F9 */
+	SPECIAL, /* 0x44 - F10 */
+	SPECIAL, /* 0x45 - NumLock */
+	SPECIAL, /* 0x46 - ScrollLock */
+	'7', '8', '9', '-',
+	'4', '5', '6', '+',
+	'1', '2', '3',
+	'0', '.',
+	SPECIAL, /* 0x54 - Alt-SysRq */
+	SPECIAL, /* 0x55 - F11/F12/PF1/FN */
+	SPECIAL, /* 0x56 - unlabelled key next to LAlt */
+	SPECIAL, /* 0x57 - F11 */
+	SPECIAL, /* 0x58 - F12 */
+	SPECIAL, /* 0x59 */
+	SPECIAL, /* 0x5a */
+	SPECIAL, /* 0x5b */
+	SPECIAL, /* 0x5c */
+	SPECIAL, /* 0x5d */
+	SPECIAL, /* 0x5e */
+	SPECIAL, /* 0x5f */
+	SPECIAL, /* 0x60 */
+	SPECIAL, /* 0x61 */
+	SPECIAL, /* 0x62 */
+	SPECIAL, /* 0x63 */
+	SPECIAL, /* 0x64 */
+	SPECIAL, /* 0x65 */
+	SPECIAL, /* 0x66 */
+	SPECIAL, /* 0x67 */
+	SPECIAL, /* 0x68 */
+	SPECIAL, /* 0x69 */
+	SPECIAL, /* 0x6a */
+	SPECIAL, /* 0x6b */
+	SPECIAL, /* 0x6c */
+	SPECIAL, /* 0x6d */
+	SPECIAL, /* 0x6e */
+	SPECIAL, /* 0x6f */
+	SPECIAL, /* 0x70 */
+	SPECIAL, /* 0x71 */
+	SPECIAL, /* 0x72 */
+	SPECIAL, /* 0x73 */
+	SPECIAL, /* 0x74 */
+	SPECIAL, /* 0x75 */
+	SPECIAL, /* 0x76 */
+	SPECIAL, /* 0x77 */
+	SPECIAL, /* 0x78 */
+	SPECIAL, /* 0x79 */
+	SPECIAL, /* 0x7a */
+	SPECIAL, /* 0x7b */
+	SPECIAL, /* 0x7c */
+	SPECIAL, /* 0x7d */
+	SPECIAL, /* 0x7e */
+	SPECIAL, /* 0x7f */	
+};
+
+/** @}
+ */
Index: kernel/genarch/src/i8042/scanc_sun.c
===================================================================
--- kernel/genarch/src/i8042/scanc_sun.c	(revision b006a2c8990750690f6845007fe696ea0c726deb)
+++ kernel/genarch/src/i8042/scanc_sun.c	(revision b006a2c8990750690f6845007fe696ea0c726deb)
@@ -0,0 +1,304 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup genarch	
+ * @{
+ */
+/**
+ * @file
+ * @brief	Scan codes for Sun keyboards.
+ */
+
+#include <genarch/i8042/i8042.h>
+
+/** Primary meaning of scancodes. */
+char sc_primary_map[] = {
+	[0x00] = SPECIAL,
+	[0x01] = SPECIAL,
+	[0x02] = SPECIAL,
+	[0x03] = SPECIAL,
+	[0x04] = SPECIAL,
+	[0x05] = SPECIAL,	/* F1 */
+	[0x06] = SPECIAL,	/* F2 */
+	[0x07] = SPECIAL,	/* F10 */
+	[0x08] = SPECIAL,	/* F3 */
+	[0x09] = SPECIAL,	/* F11 */
+	[0x0a] = SPECIAL,	/* F4 */
+	[0x0b] = SPECIAL,	/* F12 */
+	[0x0c] = SPECIAL,	/* F5 */
+	[0x0d] = SPECIAL,	/* RAlt */
+	[0x0e] = SPECIAL,	/* F6 */
+	[0x0f] = SPECIAL,
+	[0x10] = SPECIAL,	/* F7 */
+	[0x11] = SPECIAL,	/* F8 */
+	[0x12] = SPECIAL,	/* F9 */
+	[0x13] = SPECIAL,	/* LAlt */
+	[0x14] = SPECIAL,	/* Up Arrow */
+	[0x15] = SPECIAL,	/* Pause */
+	[0x16] = SPECIAL,
+	[0x17] = SPECIAL,	/* Scroll Lock */
+	[0x18] = SPECIAL,	/* Left Arrow */
+	[0x19] = SPECIAL,
+	[0x1a] = SPECIAL,
+	[0x1b] = SPECIAL,	/* Down Arrow */
+	[0x1c] = SPECIAL,	/* Right Arrow */
+	[0x1d] = SPECIAL,	/* Esc */
+	[0x1e] = '1',
+	[0x1f] = '2',
+	[0x20] = '3',
+	[0x21] = '4',
+	[0x22] = '5',
+	[0x23] = '6',
+	[0x24] = '7',
+	[0x25] = '8',
+	[0x26] = '9',
+	[0x27] = '0',
+	[0x28] = '-',
+	[0x29] = '=',
+	[0x2a] = '`',
+	[0x2b] = '\b',	/* Backspace */
+	[0x2c] = SPECIAL,	/* Insert */
+	[0x2d] = SPECIAL,
+	[0x2e] = '/',		/* numeric keypad */
+	[0x2f] = '*',		/* numeric keypad */
+	[0x30] = SPECIAL,
+	[0x31] = SPECIAL,
+	[0x32] = '.',		/* numeric keypad */
+	[0x33] = SPECIAL,
+	[0x34] = SPECIAL,	/* Home */
+	[0x35] = '\t',		/* Tab */
+	[0x36] = 'q',
+	[0x37] = 'w',
+	[0x38] = 'e',
+	[0x39] = 'r',
+	[0x3a] = 't',
+	[0x3b] = 'y',
+	[0x3c] = 'u',
+	[0x3d] = 'i',
+	[0x3e] = 'o',
+	[0x3f] = 'p',
+	[0x40] = '[',
+	[0x41] = ']',
+	[0x42] = SPECIAL,	/* Del */
+	[0x43] = SPECIAL,
+	[0x44] = '7',		/* numeric keypad */
+	[0x45] = '8',		/* numeric keypad */
+	[0x46] = '9',		/* numeric keypad */
+	[0x47] = '-',		/* numeric keypad */
+	[0x48] = SPECIAL,
+	[0x49] = SPECIAL,
+	[0x4a] = SPECIAL,	/* End */
+	[0x4b] = SPECIAL,
+	[0x4c] = SPECIAL,	/* Control */
+	[0x4d] = 'a',
+	[0x4e] = 's',
+	[0x4f] = 'd',
+	[0x50] = 'f',
+	[0x51] = 'g',
+	[0x52] = 'h',
+	[0x53] = 'j',
+	[0x54] = 'k',
+	[0x55] = 'l',
+	[0x56] = ';',
+	[0x57] = '\'',
+	[0x58] = '\\',
+	[0x59] = '\n',		/* Enter */
+	[0x5a] = '\n',		/* Enter on numeric keypad */
+	[0x5b] = '4',		/* numeric keypad */
+	[0x5c] = '5',		/* numeric keypad */
+	[0x5d] = '6',		/* numeric keypad */
+	[0x5e] = '0',		/* numeric keypad */
+	[0x5f] = SPECIAL,
+	[0x60] = SPECIAL,	/* Page Up */
+	[0x61] = SPECIAL,
+	[0x62] = SPECIAL,	/* Num Lock */
+	[0x63] = SPECIAL,	/* LShift */
+	[0x64] = 'z',
+	[0x65] = 'x',
+	[0x66] = 'c',
+	[0x67] = 'v',
+	[0x68] = 'b',
+	[0x69] = 'n',
+	[0x6a] = 'm',
+	[0x6b] = ',',
+	[0x6c] = '.',
+	[0x6d] = '/',
+	[0x6e] = SPECIAL,	/* RShift */
+	[0x6f] = SPECIAL,
+	[0x70] = '1',		/* numeric keypad */
+	[0x71] = '2',		/* numeric keypad */
+	[0x72] = '3',		/* numeric keypad */
+	[0x73] = SPECIAL,
+	[0x74] = SPECIAL,
+	[0x75] = SPECIAL,
+	[0x76] = SPECIAL,
+	[0x77] = SPECIAL,	/* Caps Lock */
+	[0x78] = SPECIAL,
+	[0x79] = ' ',
+	[0x7a] = SPECIAL,
+	[0x7b] = SPECIAL,	/* Page Down */
+	[0x7c] = SPECIAL,
+	[0x7d] = '+',		/* numeric key pad */
+	[0x7e] = SPECIAL,
+	[0x7f] = SPECIAL
+};
+
+/** Secondary meaning of scancodes. */
+char sc_secondary_map[] = {
+	[0x00] = SPECIAL,
+	[0x01] = SPECIAL,
+	[0x02] = SPECIAL,
+	[0x03] = SPECIAL,
+	[0x04] = SPECIAL,
+	[0x05] = SPECIAL,	/* F1 */
+	[0x06] = SPECIAL,	/* F2 */
+	[0x07] = SPECIAL,	/* F10 */
+	[0x08] = SPECIAL,	/* F3 */
+	[0x09] = SPECIAL,	/* F11 */
+	[0x0a] = SPECIAL,	/* F4 */
+	[0x0b] = SPECIAL,	/* F12 */
+	[0x0c] = SPECIAL,	/* F5 */
+	[0x0d] = SPECIAL,	/* RAlt */
+	[0x0e] = SPECIAL,	/* F6 */
+	[0x0f] = SPECIAL,
+	[0x10] = SPECIAL,	/* F7 */
+	[0x11] = SPECIAL,	/* F8 */
+	[0x12] = SPECIAL,	/* F9 */
+	[0x13] = SPECIAL,	/* LAlt */
+	[0x14] = SPECIAL,	/* Up Arrow */
+	[0x15] = SPECIAL,	/* Pause */
+	[0x16] = SPECIAL,
+	[0x17] = SPECIAL,	/* Scroll Lock */
+	[0x18] = SPECIAL,	/* Left Arrow */
+	[0x19] = SPECIAL,
+	[0x1a] = SPECIAL,
+	[0x1b] = SPECIAL,	/* Down Arrow */
+	[0x1c] = SPECIAL,	/* Right Arrow */
+	[0x1d] = SPECIAL,	/* Esc */
+	[0x1e] = '!',
+	[0x1f] = '@',
+	[0x20] = '#',
+	[0x21] = '$',
+	[0x22] = '%',
+	[0x23] = '^',
+	[0x24] = '&',
+	[0x25] = '*',
+	[0x26] = '(',
+	[0x27] = ')',
+	[0x28] = '_',
+	[0x29] = '+',
+	[0x2a] = '~',
+	[0x2b] = SPECIAL,	/* Backspace */
+	[0x2c] = SPECIAL,	/* Insert */
+	[0x2d] = SPECIAL,
+	[0x2e] = '/',		/* numeric keypad */
+	[0x2f] = '*',		/* numeric keypad */
+	[0x30] = SPECIAL,
+	[0x31] = SPECIAL,
+	[0x32] = '.',		/* numeric keypad */
+	[0x33] = SPECIAL,
+	[0x34] = SPECIAL,	/* Home */
+	[0x35] = SPECIAL,	/* Tab */
+	[0x36] = 'Q',
+	[0x37] = 'W',
+	[0x38] = 'E',
+	[0x39] = 'R',
+	[0x3a] = 'T',
+	[0x3b] = 'Y',
+	[0x3c] = 'U',
+	[0x3d] = 'I',
+	[0x3e] = 'O',
+	[0x3f] = 'P',
+	[0x40] = '{',
+	[0x41] = '}',
+	[0x42] = SPECIAL,	/* Del */
+	[0x43] = SPECIAL,
+	[0x44] = '7',		/* numeric keypad */
+	[0x45] = '8',		/* numeric keypad */
+	[0x46] = '9',		/* numeric keypad */
+	[0x47] = '-',		/* numeric keypad */
+	[0x48] = SPECIAL,
+	[0x49] = SPECIAL,
+	[0x4a] = SPECIAL,	/* End */
+	[0x4b] = SPECIAL,
+	[0x4c] = SPECIAL,	/* Control */
+	[0x4d] = 'A',
+	[0x4e] = 'S',
+	[0x4f] = 'D',
+	[0x50] = 'F',
+	[0x51] = 'G',
+	[0x52] = 'H',
+	[0x53] = 'J',
+	[0x54] = 'K',
+	[0x55] = 'L',
+	[0x56] = ':',
+	[0x57] = '"',
+	[0x58] = '|',
+	[0x59] = SPECIAL,	/* Enter */
+	[0x5a] = SPECIAL,	/* Enter on numeric keypad */
+	[0x5b] = '4',		/* numeric keypad */
+	[0x5c] = '5',		/* numeric keypad */
+	[0x5d] = '6',		/* numeric keypad */
+	[0x5e] = '0',		/* numeric keypad */
+	[0x5f] = SPECIAL,
+	[0x60] = SPECIAL,	/* Page Up */
+	[0x61] = SPECIAL,
+	[0x62] = SPECIAL,	/* Num Lock */
+	[0x63] = SPECIAL,	/* LShift */
+	[0x64] = 'Z',
+	[0x65] = 'X',
+	[0x66] = 'C',
+	[0x67] = 'V',
+	[0x68] = 'B',
+	[0x69] = 'N',
+	[0x6a] = 'M',
+	[0x6b] = '<',
+	[0x6c] = '>',
+	[0x6d] = '?',
+	[0x6e] = SPECIAL,	/* RShift */
+	[0x6f] = SPECIAL,
+	[0x70] = '1',		/* numeric keypad */
+	[0x71] = '2',		/* numeric keypad */
+	[0x72] = '3',		/* numeric keypad */
+	[0x73] = SPECIAL,
+	[0x74] = SPECIAL,
+	[0x75] = SPECIAL,
+	[0x76] = SPECIAL,
+	[0x77] = SPECIAL,	/* Caps Lock */
+	[0x78] = SPECIAL,
+	[0x79] = ' ',
+	[0x7a] = SPECIAL,
+	[0x7b] = SPECIAL,	/* Page Down */
+	[0x7c] = SPECIAL,
+	[0x7d] = '+',		/* numeric key pad */
+	[0x7e] = SPECIAL,
+	[0x7f] = SPECIAL
+};
+
+/** @}
+ */
