diff --git a/src/boot.c b/src/boot.c
index 5137345..38cade4 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -285,16 +285,19 @@ interactive_bootmenu(void)
     while (get_keystroke(0) >= 0)
         ;
 
-    printf("Press F12 for boot menu.\n\n");
+    printf("Press '%s' for boot menu.\n\n", CONFIG_BIOS_ENTER_KEY_LABEL );
 
     enable_bootsplash();
-    int scan_code = get_keystroke(CONFIG_BOOTMENU_WAIT);
+    int scan_code = get_keystroke( CONFIG_BOOTMENU_WAIT );
     disable_bootsplash();
-    if (scan_code != 0x86)
+#if 1
+    printf( "Key pressed %x\n", scan_code );
+#endif
+    if ( scan_code != CONFIG_BIOS_ENTER_KEY )
         /* not F12 */
         return;
 
-    while (get_keystroke(0) >= 0)
+    while ( get_keystroke(0) >= 0 )
         ;
 
     printf("Select boot device:\n\n");
diff --git a/src/config.h b/src/config.h
index db3e578..1273dd8 100644
--- a/src/config.h
+++ b/src/config.h
@@ -12,15 +12,25 @@
 #define CONFIG_APPNAME6 "BOCHS "
 #define CONFIG_APPNAME4 "BXPC"
 
+// Configure the BIOS enter key
+// (default) F12 key
+//#define CONFIG_BIOS_ENTER_KEY_LABEL	"F12"
+//#define CONFIG_BIOS_ENTER_KEY		0x86
+// DELETE key
+#define CONFIG_BIOS_ENTER_KEY_LABEL	"DEL"	
+#define CONFIG_BIOS_ENTER_KEY		0x100
+
+
 // Configure as a coreboot payload.
-#define CONFIG_COREBOOT 0
+#define CONFIG_COREBOOT 		1
 
 // Control how verbose debug output is.
-#define CONFIG_DEBUG_LEVEL 1
+#define CONFIG_DEBUG_LEVEL 		1
 // Send debugging information to serial port
-#define CONFIG_DEBUG_SERIAL 0
+#define CONFIG_DEBUG_SERIAL 		1
+#define CONFIG_KEYBOARD_SERIAL		1
 // Screen writes are also sent to debug ports.
-#define CONFIG_SCREEN_AND_DEBUG 1
+#define CONFIG_SCREEN_AND_DEBUG 	1
 
 // Support running hardware initialization in parallel
 #define CONFIG_THREADS 1
@@ -31,7 +41,7 @@
 // Support int13 disk/floppy drive functions
 #define CONFIG_DRIVES 1
 // Support floppy drive access
-#define CONFIG_FLOPPY 1
+#define CONFIG_FLOPPY 0
 // Support USB devices
 #define CONFIG_USB 1
 // Support USB UHCI controllers
@@ -120,7 +130,7 @@
 // Support generation of ACPI tables (for emulators)
 #define CONFIG_ACPI 1
 // Support bios callbacks specific to via vgabios.
-#define CONFIG_VGAHOOKS 0
+#define CONFIG_VGAHOOKS 1
 // Support S3 resume handler.
 #define CONFIG_S3_RESUME 1
 // Run the vga rom during S3 resume.
@@ -200,6 +210,7 @@
 // than the specified value, then the corresponding irq handler will
 // report every enter event.
 #define DEBUG_ISR_02 1
+#define DEBUG_ISR_CON 1
 #define DEBUG_HDL_05 1
 #define DEBUG_ISR_08 20
 #define DEBUG_ISR_09 9
diff --git a/src/romlayout.S b/src/romlayout.S
index 7a14a7f..8cb2fd5 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -472,7 +472,9 @@ irqentryarg:
         DECL_IRQ_ENTRY 75
         DECL_IRQ_ENTRY hwpic1
         DECL_IRQ_ENTRY hwpic2
-
+#if CONFIG_KEYBOARD_SERIAL
+	DECL_IRQ_ENTRY console_serial
+#endif
         // int 18/19 are special - they reset stack and call into 32bit mode.
         DECLFUNC entry_19
 entry_19:
diff --git a/src/serial.c b/src/serial.c
index 21b4bd0..78a9845 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -1,15 +1,404 @@
 // 16bit code to handle serial and printer services.
 //
+// Copyright (C) 2011 Marc Bertens <mbertens@xs4all.nl>
+//		 Added the SERIAL_KEYBOARD (VT100/VT220) stuff
 // Copyright (C) 2008,2009  Kevin O'Connor <kevin@koconnor.net>
 // Copyright (C) 2002  MandrakeSoft S.A.
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
-#include "biosvar.h" // SET_BDA
-#include "util.h" // debug_enter
-#include "bregs.h" // struct bregs
-
+#include "biosvar.h" 	// SET_BDA
+#include "util.h" 	// debug_enter
+#include "bregs.h" 	// struct bregs
+#include "pic.h" 	// eoi_pic1
+
+#if CONFIG_KEYBOARD_SERIAL
+/*
+ *	The same as 'enqueue_key' in kbd.c
+ *
+ *	The function 'enqueue_key' in kbd.c should be made public.
+ */
+static u8 enqueue_ttykey( u8 scan_code, u8 ascii_code )
+{
+	u16 buffer_start	= GET_BDA( kbd_buf_start_offset );
+	u16 buffer_end		= GET_BDA( kbd_buf_end_offset );
+
+	u16 buffer_head		= GET_BDA( kbd_buf_head );
+	u16 buffer_tail		= GET_BDA( kbd_buf_tail );
+
+	u16 temp_tail		= buffer_tail;
+	buffer_tail		+= 2;
+	if ( buffer_tail >= buffer_end )
+	{
+        	buffer_tail = buffer_start;
+	}
+	if ( buffer_tail == buffer_head )
+	{
+	        return ( 0 );
+	}
+	SET_FARVAR( SEG_BDA, *(u8*)(temp_tail + 0), ascii_code );
+	SET_FARVAR( SEG_BDA, *(u8*)(temp_tail + 1), scan_code );
+	SET_BDA( kbd_buf_tail, buffer_tail );
+	return ( 1 );
+}
 
+/* typedef struct for storing the TTY key sequence */
+typedef struct tag_tty_key
+{
+	char				code;
+	u8				scan;
+	u8				ascii;
+	const struct tag_tty_key*	next;
+} TTY_KEY;
+
+/* Table for gettting the scan code of a character */
+static struct charinfo
+{
+	u8	scan;
+	u8	ascii;
+} scan_to_scanascii[] VAR16 = {
+	{	0,	0,	},	
+	{	0x0e,	0x08	},	/* Backspace */
+	{	0x0f,	0x09	},	// TAB */
+	{	0x1c,	0x0d	},	/* Enter */
+	{	0x39,	0x20	},	/* space */
+	{	0x02,	0x21	},	/* ! */		
+	{	0x28,	0x22	},	/* " */
+	{	0x04,	0x23	},	/* # */		
+	{	0x05,	0x24	},	/* $ */		
+	{	0x06,	0x25	},	/* % */		
+	{	0x08,	0x26	},	/* & */		
+	{	0x28,	0x27	},	/* ' */
+	{	0x0a,	0x28	},	/* ( */		
+	{	0x0b,	0x29	},	/* ) */	
+	{	0x09,	0x2a	},	/* * */		
+	{	0x0d,	0x2b	},	/* + */	
+	{	0x33,	0x2c	},	/* , */
+	{	0x0c,	0x2d	},	/* - */	
+	{	0x34,	0x2e	},	/* . */
+	{	0x35,	0x2f	},	/* / */
+	{	0x0b,	0x30	},	/* 0 */		
+	{	0x02,	0x31	},	/* 1 */		
+	{	0x03,	0x32	},	/* 2 */		
+	{	0x04,	0x33	},	/* 3 */		
+	{	0x05,	0x34	},	/* 4 */		
+	{	0x06,	0x35	},	/* 5 */		
+	{	0x07,	0x36	},	/* 6 */		
+	{	0x08,	0x37	},	/* 7 */		
+	{	0x09,	0x38	},	/* 8 */		
+	{	0x0a,	0x39	},	/* 9 */		
+	{	0x27,	0x3a	},	/* : */
+	{	0x27,	0x3b	},	/* ; */
+	{	0x33,	0x3c	},	/* < */
+	{	0x0d,	0x3d	},	/* = */	
+	{	0x34,	0x3e	},	/* > */
+	{ 	0x35,	0x3f	},	/* ? */
+	{	0x03,	0x40	},	/* @ */	
+	{ 	0x1e,	0x41	}, 	/* A */
+	{ 	0x30,	0x42	}, 	/* B */
+	{ 	0x2e,	0x43	}, 	/* C */
+	{ 	0x20,	0x44	}, 	/* D */
+	{ 	0x12,	0x45	}, 	/* E */
+	{ 	0x21,	0x46	}, 	/* F */
+	{ 	0x22,	0x47	}, 	/* G */
+	{ 	0x23,	0x48	}, 	/* H */
+	{ 	0x17,	0x49	}, 	/* I */
+	{ 	0x24,	0x4a	}, 	/* J */
+	{ 	0x25,	0x4b	}, 	/* K */
+	{ 	0x26,	0x4c	}, 	/* L */
+	{ 	0x32,	0x4d	}, 	/* M */
+	{ 	0x31,	0x4e	}, 	/* N */
+	{ 	0x18,	0x4f	}, 	/* O */
+	{ 	0x19,	0x50	},	/* P */
+	{ 	0x10,	0x51	}, 	/* Q */
+	{ 	0x13,	0x52	}, 	/* R */
+	{ 	0x1f,	0x53	}, 	/* S */
+	{ 	0x14,	0x54	}, 	/* T */
+	{ 	0x16,	0x55	}, 	/* U */
+	{ 	0x2f,	0x56	},	/* V */
+	{ 	0x11,	0x57	}, 	/* W */
+	{ 	0x2d,	0x58	}, 	/* X */
+	{ 	0x15,	0x59	}, 	/* Y */
+	{ 	0x2c,	0x5a	}, 	/* Z */
+	{	0x1a,	0x5b	},	/* [ */
+	{	0x2b,	0x5c	},	/* \ */
+	{	0x1b,	0x5d	},	/* ] */
+	{	0x07,	0x5e	},	/* ^ */	
+	{	0x0c,	0x5f	},	/* _ */
+	{	0x29,	0x60	},	/* ` */
+	{	0x1e,	0x61	}, 	/* a */
+	{	0x30,	0x62	}, 	/* b */
+	{	0x2e,	0x63	}, 	/* c */
+	{	0x20,	0x64	}, 	/* d */
+	{	0x12,	0x65	}, 	/* e */
+	{	0x21,	0x66	}, 	/* f */
+	{	0x22,	0x67	}, 	/* g */
+	{	0x23,	0x68	}, 	/* h */
+	{	0x17,	0x69	}, 	/* i */
+	{	0x24,	0x6a	}, 	/* j */
+	{	0x25,	0x6b	}, 	/* k */
+	{	0x26,	0x6c	}, 	/* l */
+	{	0x32,	0x6d	}, 	/* m */
+	{	0x31,	0x6e	}, 	/* n */
+	{	0x18,	0x6f	}, 	/* o */
+	{	0x19,	0x70	}, 	/* p */
+	{	0x10,	0x71	},	/* q */
+	{	0x13,	0x72	}, 	/* r */
+	{	0x1f,	0x73	}, 	/* s */
+	{	0x14,	0x74	}, 	/* t */	
+	{	0x16,	0x75	}, 	/* u */
+	{	0x2f,	0x76	}, 	/* v */
+	{	0x11,	0x77	}, 	/* w */
+	{	0x2d,	0x78	}, 	/* x */
+	{	0x15,	0x79	}, 	/* y */
+	{	0x2c,	0x7a	}, 	/* z */
+	{	0x1a,	0x7b	},	/* { */
+	{	0x2b,	0x7c	},	/* | */
+	{	0x1b,	0x7d	},	/* } */
+	{	0x29,	0x7e	},	/* ~ */
+	{	0,	0	} };
+
+/* 
+ * The actual TTY structs, storing the key sequences
+ */
+/* END TABLE */
+static const TTY_KEY	tty_end_table[]	= {	
+	{  '~', 0x3f, 0x00, 		NULL 			},	// F5          	esc [ 1 6 ~ 		
+	{  '~', 0x40, 0x00, 		NULL 			},	// F6          	esc [ 1 7 ~ 	
+	{  '~', 0x41, 0x00, 		NULL 			},	// F7          	esc [ 1 8 ~ 	
+	{  '~', 0x42, 0x00, 		NULL 			},	// F8          	esc [ 1 9 ~ 
+	{  '~', 0x43, 0x00, 		NULL 			},	// F9          	esc [ 2 0 ~ 	
+	{  '~', 0x44, 0x00, 		NULL 			},	// F10         	esc [ 2 1 ~ 
+	{  '~', 0x85, 0x00, 		NULL 			},	// F11        	esc [ 2 3 ~ 
+	{  '~', 0x86, 0x00, 		NULL 			},	// F12         	esc [ 2 4 ~ 
+	{  '~', 0x00, 0x00, 		NULL 			},	// F13         	esc [ 2 5 ~ 
+	{  '~', 0x00, 0x00, 		NULL 			},	// F14         	esc [ 2 6 ~ 
+	{  '~', 0x00, 0x00, 		NULL 			},	// HELP        	esc [ 2 8 ~ 
+	{  '~', 0x00, 0x00, 		NULL 			},	// DO          	esc [ 2 9 ~ 
+	{  '~', 0x00, 0x00, 		NULL 			},	// F17         	esc [ 3 1 ~ 
+	{  '~', 0x00, 0x00, 		NULL 			},	// F18         	esc [ 3 2 ~ 
+	{  '~', 0x00, 0x00, 		NULL 			},	// F19         	esc [ 3 3 ~ 
+	{  '~', 0x00, 0x00, 		NULL 			},	// F20         	esc [ 3 4 ~ 
+	{  '~', 0x00, 0x00, 		NULL 			},	// select      	esc [ 4 ~
+	{  '~', 0x49, 0x00, 		NULL 			},	// prev scrn   	esc [ 5 ~
+	{  '~', 0x51, 0x00, 		NULL 			},	// next scrn   	esc [ 6 ~
+	};
+
+/* SUB TABLE 1. */
+#define TABLE_1_SIZE		5
+static const TTY_KEY	tty_sub_table_1[ TABLE_1_SIZE ]	= {	
+	{  '~', 0x00, 0x00, 		NULL			},	// find        	esc [ 1 ~
+	{  '5',    0,    0, 		&tty_end_table[0]	},	// F5          	esc [ 1 6 ~ 	
+	{  '7',    0,    0, 		&tty_end_table[1]	},	// F6          	esc [ 1 7 ~ 
+	{  '8',    0,    0, 		&tty_end_table[2]	},	// F7          	esc [ 1 8 ~ 
+	{  '9',    0,    0, 		&tty_end_table[3]	} };	// F8          	esc [ 1 9 ~
+
+/* SUB TABLE 2. */
+#define TABLE_2_SIZE		9
+static const TTY_KEY	tty_sub_table_2[ TABLE_2_SIZE ]	= {	
+	{  '~', 0x52, 0x00, 		NULL 			},	// insert     	esc [ 2 ~
+  	{  '0',    0,    0, 		&tty_end_table[4] 	},	// F9          	esc [ 2 0 ~ 	
+	{  '1',    0,    0, 		&tty_end_table[5]	},	// F10         	esc [ 2 1 ~ 
+	{  '3',    0,    0, 		&tty_end_table[6]	},	// F11        	esc [ 2 3 ~ 
+	{  '4',    0,    0, 		&tty_end_table[7]	},	// F12         	esc [ 2 4 ~ 
+  	{  '5',    0,    0, 		&tty_end_table[8] 	},	// F13         	esc [ 2 5 ~ 
+	{  '6',    0,    0, 		&tty_end_table[9]	},	// F14         	esc [ 2 6 ~ 
+	{  '8',    0,    0, 		&tty_end_table[10]	},	// HELP        	esc [ 2 8 ~ 
+	{  '9',    0,    0, 		&tty_end_table[11]	} };	// DO          	esc [ 2 9 ~ 
+
+/* SUB TABLE 3. */
+#define TABLE_3_SIZE		5
+static const TTY_KEY	tty_sub_table_3[ TABLE_3_SIZE ]	= {	
+	{  '~', 0x53, 0x00, 		NULL 			},	// remove      	esc [ 3 ~
+	{  '1',    0,    0, 		&tty_end_table[12]	},	// F17         	esc [ 3 1 ~ 
+	{  '2',    0,    0, 		&tty_end_table[13]	},	// F18         	esc [ 3 2 ~ 
+	{  '3',    0,    0, 		&tty_end_table[14]	},	// F19         	esc [ 3 3 ~ 
+	{  '4',    0,    0, 		&tty_end_table[15]	} };	// F20         	esc [ 3 4 ~ 
+
+/* SUB TABLE '[' */
+#define TABLE_BRACE_SIZE	12
+static const TTY_KEY	tty_sub_table_brace[ TABLE_BRACE_SIZE ]	= { 	
+	{  'A', 0x48, 0x00, 		NULL	 		},	// up-arrow    	esc [ A	
+	{  'B', 0x50, 0x00, 		NULL 			},	// down-arrow  	esc [ B
+	{  'C', 0x4d, 0x00, 		NULL 			},  	// right-arrow 	esc [ C
+	{  'D', 0x4b, 0x00, 		NULL 			},	// left-arrow  	esc [ D
+	{  'F', 0x4f, 0x00, 		NULL 			},  	//
+	{  'H', 0x47, 0x00, 		NULL 			},	//
+	{  '1',    0,    TABLE_1_SIZE,	tty_sub_table_1 	},	// find,   F5-F8
+	{  '2',    0,    TABLE_2_SIZE,	tty_sub_table_2 	},	// insert, F9-F14, DO, HELP
+	{  '3',    0,    TABLE_3_SIZE,	tty_sub_table_3 	},	// remove, F17-F20
+	{  '4',    0,    1, 		&tty_end_table[16] 	},	// select      	esc [ 4 ~
+	{  '5',    0,    1, 		&tty_end_table[17]	},	// prev scrn   	esc [ 5 ~
+	{  '6',    0,    1, 		&tty_end_table[18]	} };	// next scrn   	esc [ 6 ~
+
+/* SUB TABLE 'O' */
+#define TABLE_O_SIZE		18
+static const TTY_KEY	tty_sub_table_O[ TABLE_O_SIZE ]	= {
+	{  'p', 0x00, 0x00, 		NULL			},	// keypad 0	esc O p
+	{  'q', 0x00, 0x00, 		NULL			},	// keypad 1    	esc O q
+	{  'r', 0x00, 0x00, 		NULL			},	// keypad 2    	esc O r
+	{  's', 0x00, 0x00, 		NULL			},	// keypad 3    	esc O s
+	{  't', 0x00, 0x00, 		NULL			},	// keypad 4    	esc O t
+	{  'u', 0x00, 0x00, 		NULL			},	// keypad 5    	esc O u
+	{  'v', 0x00, 0x00, 		NULL			},	// keypad 6    	esc O v
+	{  'w', 0x00, 0x00, 		NULL			},	// keypad 7    	esc O w
+	{  'x', 0x00, 0x00, 		NULL			},	// keypad 8    	esc O x
+	{  'y', 0x00, 0x00, 		NULL			},	// keypad 9   	esc O y
+	{  'm', 0x00, 0x00, 		NULL			},	// keypad -    	esc O m
+	{  'l', 0x00, 0x00,		NULL			},	// keypad ,    	esc O l
+	{  'n', 0x00, 0x00, 		NULL			},	// keypad .    	esc O n
+	{  'M', 0x00, 0x00, 		NULL			},	// enter       	esc O M	
+	{  'P', 0x00, 0x00, 		NULL			},	// pf1         	esc O P
+	{  'Q', 0x00, 0x00, 		NULL			},	// pf2         	esc O Q
+	{  'R', 0x00, 0x00, 		NULL			},	// pf3         	esc O R
+	{  'S', 0x00, 0x00, 		NULL			} };	// pf4         	esc O S
+
+/* The ENTRY point is ESC	*/
+static const TTY_KEY	tty_table[] 		= {	
+	/* Root VT100/VT220 table */
+	{ 0x1B,	   0, 	 3, 		&tty_table[ 1 ] 	},	// to ESCAPE table
+	/* ESCAPE table */
+	{  '[',    0, TABLE_BRACE_SIZE,	tty_sub_table_brace	},
+	{  'O',    0, TABLE_O_SIZE, 	tty_sub_table_O 	},
+	{ 0x1B, 0x01, 0x1B, 		NULL 			} };	// ESCAPE key
+
+/*
+	Terminal input sequences (vt100/vt220)
+
+	These are sequences generated by the keyboard.
+
+	title _____ sequence	PC
+
+	up-arrow    esc [ A	UP
+	down-arrow  esc [ B	DOWN 
+	right-arrow esc [ C	RIGHT
+	left-arrow  esc [ D	LEFT
+	find        esc [ 1 ~   
+	insert      esc [ 2 ~   INS
+	remove      esc [ 3 ~   DEL
+	select      esc [ 4 ~   
+	prev scrn   esc [ 5 ~   Page up
+	next scrn   esc [ 6 ~	Page down
+	F6          esc [ 1 7 ~ 
+	F7          esc [ 1 8 ~ 
+	F8          esc [ 1 9 ~ 
+	F9          esc [ 2 0 ~ 
+	F10         esc [ 2 1 ~ 
+	F11         esc [ 2 3 ~ 
+	F12         esc [ 2 4 ~ 
+	F13         esc [ 2 5 ~ 
+	F14         esc [ 2 6 ~ 
+	HELP        esc [ 2 8 ~ 
+	DO          esc [ 2 9 ~ 
+	F17         esc [ 3 1 ~ 
+	F18         esc [ 3 2 ~ 
+	F19         esc [ 3 3 ~ 
+	F20         esc [ 3 4 ~ 
+
+	keypad 0    esc O p	
+	keypad 1    esc O q
+	keypad 2    esc O r
+	keypad 3    esc O s
+	keypad 4    esc O t
+	keypad 5    esc O u
+	keypad 6    esc O v
+	keypad 7    esc O w
+	keypad 8    esc O x
+	keypad 9    esc O y
+	keypad -    esc O m
+	keypad ,    esc O l
+	keypad .    esc O n
+	enter       esc O M	
+
+	pf1         esc O P	F1
+	pf2         esc O Q	F2
+	pf3         esc O R	F3
+	pf4         esc O S	F4
+
+*/
+/*	
+ * 	The number of entries in the current table, for the next character to walk through when it commes in 
+ */
+static int		cnt_table_curr	= 0;
+/*	
+ *	The current table where the next character will be checked against 
+ */
+static const TTY_KEY*	tty_table_curr	= NULL;
+/*	
+ *	The port address for COM1, COM2, COM3 or COM4 
+ */
+static u16 		con_addr;
+
+/* 
+ *	INT(3/4)h : Serial Hardware Service Entry Point (for keyboard handling)	
+ *
+ * The is reffered from romlayout.S at the label irqentryarg: there is now 
+ * the 'DECL_IRQ_ENTRY console_serial'
+ */
+void VISIBLE16 handle_console_serial( void )
+{
+	u8 lsr;
+	debug_isr( DEBUG_ISR_CON );
+	lsr = inb( con_addr + SEROFF_LSR );
+        if ( lsr & 0x01 ){
+		u8 		i;
+		u8		ascii_code;
+		/* Success - can read data	*/
+		ascii_code = inb( con_addr + SEROFF_DATA );
+		/* Enter the TTY table ? 	*/
+		if ( tty_table_curr == NULL && tty_table[ 0 ].ascii == ascii_code )
+		{
+			/* 
+			 * This can be done differently, but for now like it, maybe there are other
+			 * control sequences that need to be handled.
+			 */	
+			tty_table_curr	= tty_table[ 0 ].next;
+			cnt_table_curr	= tty_table[ 0 ].scan;
+			/* There are more chars needed, so exit and wait for more */
+			goto done;
+		}
+		if ( tty_table_curr != NULL )
+		{
+			for ( i = 0; i < cnt_table_curr; i++ )
+			{
+				if ( tty_table_curr[ i ].next->code == ascii_code )
+				{
+					if ( tty_table_curr[ i ].next->next )
+					{
+						tty_table_curr = (const TTY_KEY*)tty_table_curr[ i ].next;	
+						/* There are more chars needed, so exit and wait for more	*/
+					}
+					else
+					{
+						/* key found	*/
+						enqueue_ttykey( tty_table_curr[ i ].scan, ascii_code );
+						tty_table_curr	= NULL;
+						cnt_table_curr	= 0;
+					}
+					goto done;
+				}
+			}
+			/* Some key was not recognized,	fall through add key with scancode */
+			tty_table_curr	= NULL; 
+			cnt_table_curr	= 0;
+		}
+		i = 64; /* half way */
+		/* Found a normal character, get the scancode */
+		char j	= ( ascii_code > scan_to_scanascii[ i ].ascii ? 1 : -1 );	/* UP or DOWN throught the array */
+		for ( ; scan_to_scanascii[ i ].scan != 0; i += j )
+		{
+			if ( scan_to_scanascii[ i ].ascii == ascii_code )
+			{
+				enqueue_ttykey( scan_to_scanascii[ i ].scan, ascii_code );					
+				break;
+			}	 
+		}
+		goto done;
+        }
+done:
+	eoi_pic1();
+}
+#endif
 /****************************************************************
  * COM ports
  ****************************************************************/
@@ -48,6 +437,15 @@ serial_setup(void)
     // Equipment word bits 9..11 determing # serial ports
     u16 eqb = GET_BDA(equipment_list_flags);
     SET_BDA(equipment_list_flags, (eqb & 0xf1ff) | (count << 9));
+#if CONFIG_KEYBOARD_SERIAL
+	con_addr = GET_BDA( port_com[ CONFIG_KEYBOARD_SERIAL - 1 ] );
+	dprintf( 3, "keyboard on serial port %x\n", con_addr ); 
+# if CONFIG_KEYBOARD_SERIAL == 1 || CONFIG_KEYBOARD_SERIAL == 3 
+	enable_hwirq( 4, FUNC16( entry_console_serial ) );
+# else
+	enable_hwirq( 3, FUNC16( entry_console_serial ) );
+# endif
+#endif
 }
 
 static u16
@@ -313,3 +711,4 @@ handle_17(struct bregs *regs)
     default:   handle_17XX(regs); break;
     }
 }
