Index: kbd/arch/ppc32/src/kbd.c
===================================================================
--- kbd/arch/ppc32/src/kbd.c	(revision 0f09bd45eb2e13210528158205dc92b518277346)
+++ kbd/arch/ppc32/src/kbd.c	(revision d3f2cad4e681c4b9b6a60f7769173df90c630006)
@@ -41,13 +41,132 @@
 
 
-static char lchars[0x80] = {
-	'a',  's',  'd',  'f',  'h',  'g',  'z',  'x',  'c',  'v',    0,  'b',  'q',  'w',  'e',  'r',
-	'y',  't',  '1',  '2',  '3',  '4',  '6',  '5',  '=',  '9',  '7',  '-',  '8',  '0',  ']',  'o',
-	'u',  '[',  'i',  'p',   13,  'l',  'j', '\'',  'k',  ';', '\\',  ',',  '/',  'n',  'm',  '.',
-	  9,   32,  '`',    8,    0,   27,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-	  0,  '.',    0,  '*',    0,  '+',    0,    0,    0,    0,    0,  '/',   13,    0,  '-',    0,
-	  0,    0,  '0',  '1',  '2',  '3',  '4',  '5',  '6',  '7',    0,  '8',  '9',    0,    0,    0,
-	  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-	  0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0
+#define SPECIAL		255
+#define FUNCTION_KEYS 0x100
+
+
+static int lchars[0x80] = {
+	'a',
+	's',
+	'd',
+	'f',
+	'h',
+	'g',
+	'z',
+	'x',
+	'c',
+	'v', 
+	SPECIAL,
+	'b',
+	'q',
+	'w',
+	'e',
+	'r',
+	'y',
+	't',
+	'1',
+	'2',
+	'3',
+	'4',
+	'6',
+	'5',
+	'=',
+	'9',
+	'7',
+	'-',
+	'8',
+	'0',
+	']',
+	'o',
+	'u',
+	'[',
+	'i', 
+	'p',
+	'\n',                 /* Enter */
+	'l',
+	'j',
+	'\'',
+	'k',
+	';',
+	'\\',
+	',',
+	'/',
+	'n',
+	'm',
+	'.',
+	'\t',                 /* Tab */
+	' ',
+	'`',
+	'\b',                 /* Backspace */
+	SPECIAL,
+	SPECIAL,              /* Escape */
+	SPECIAL,              /* Ctrl */
+	SPECIAL,              /* Alt */
+	SPECIAL,              /* Shift */
+	SPECIAL,              /* Caps-Lock */
+	SPECIAL,              /* RAlt */
+	SPECIAL,              /* Left */
+	SPECIAL,              /* Right */
+	SPECIAL,              /* Down */
+	SPECIAL,              /* Up */
+	SPECIAL, 
+	SPECIAL,
+	'.',                  /* Keypad . */
+	SPECIAL, 
+	'*',                  /* Keypad * */
+	SPECIAL,
+	'+',                  /* Keypad + */
+	SPECIAL,
+	SPECIAL,              /* NumLock */
+	SPECIAL,
+	SPECIAL,
+	SPECIAL,
+	'/',                  /* Keypad / */
+	'\n',                 /* Keypad Enter */
+	SPECIAL,
+	'-',                  /* Keypad - */
+	SPECIAL,
+	SPECIAL,
+	SPECIAL,
+	'0',                  /* Keypad 0 */
+	'1',                  /* Keypad 1 */
+	'2',                  /* Keypad 2 */
+	'3',                  /* Keypad 3 */
+	'4',                  /* Keypad 4 */
+	'5',                  /* Keypad 5 */
+	'6',                  /* Keypad 6 */
+	'7',                  /* Keypad 7 */
+	SPECIAL,
+	'8',                  /* Keypad 8 */
+	'9',                  /* Keypad 9 */
+	SPECIAL,
+	SPECIAL,
+	SPECIAL,
+	(FUNCTION_KEYS | 5),  /* F5 */
+	(FUNCTION_KEYS | 6),  /* F6 */
+	(FUNCTION_KEYS | 7),  /* F7 */
+	(FUNCTION_KEYS | 3),  /* F3 */
+	(FUNCTION_KEYS | 8),  /* F8 */
+	(FUNCTION_KEYS | 9),  /* F9 */
+	SPECIAL,
+	(FUNCTION_KEYS | 11), /* F11 */
+	SPECIAL,
+	(FUNCTION_KEYS | 13), /* F13 */
+	SPECIAL,
+	SPECIAL,              /* ScrollLock */
+	SPECIAL,
+	(FUNCTION_KEYS | 10), /* F10 */
+	SPECIAL,
+	(FUNCTION_KEYS | 12), /* F12 */
+	SPECIAL,
+	SPECIAL,              /* Pause */
+	SPECIAL,              /* Insert */
+	SPECIAL,              /* Home */
+	SPECIAL,              /* PageUp */
+	SPECIAL,              /* Delete */
+	(FUNCTION_KEYS | 4),  /* F4 */
+	SPECIAL,              /* End */
+	(FUNCTION_KEYS | 2),  /* F2 */
+	SPECIAL,              /* PageDown */
+	(FUNCTION_KEYS | 1)   /* F1 */
 };
 
@@ -61,8 +180,14 @@
 int kbd_arch_process(keybuffer_t *keybuffer, int scan_code) 
 {
-	uint8_t scancode = (uint8_t) scan_code;
+	if (scan_code != -1) {
+		uint8_t scancode = (uint8_t) scan_code;
 	
-	if ((scancode != 0) && ((scancode & 0x80) != 0x80))
-		keybuffer_push(keybuffer, lchars[scancode & 0x7f]);
+		if ((scancode & 0x80) != 0x80) {
+			int key = lchars[scancode & 0x7f];
+			
+			if (key != SPECIAL)
+				keybuffer_push(keybuffer, key);
+		}
+	}
 	
 	return 1;
