Index: kernel/genarch/Makefile.inc
===================================================================
--- kernel/genarch/Makefile.inc	(revision 95b99639fffc643d77610ff187c406c029738c9a)
+++ kernel/genarch/Makefile.inc	(revision 70047478224039b394ba6d1a4ba25ae4fb58ab81)
@@ -34,4 +34,5 @@
 		genarch/src/acpi/madt.c
 endif
+
 ifeq ($(CONFIG_PAGE_PT),y)
 	GENARCH_SOURCES += \
@@ -39,4 +40,5 @@
 		genarch/src/mm/as_pt.c
 endif
+
 ifeq ($(CONFIG_PAGE_HT),y)
 	GENARCH_SOURCES += \
@@ -44,12 +46,15 @@
 		genarch/src/mm/as_ht.c
 endif
+
 ifeq ($(CONFIG_ASID),y)
 	GENARCH_SOURCES += \
 		genarch/src/mm/asid.c
 endif
+
 ifeq ($(CONFIG_ASID_FIFO),y)
 	GENARCH_SOURCES += \
 		genarch/src/mm/asid_fifo.c
 endif
+
 ifeq ($(CONFIG_SOFTINT),y)
 	GENARCH_SOURCES += \
@@ -57,5 +62,4 @@
 endif
 
-## Framebuffer
 ifeq ($(CONFIG_FB),y)
 	GENARCH_SOURCES += \
@@ -63,8 +67,6 @@
 		genarch/src/fb/logo-196x66.c \
 		genarch/src/fb/fb.c
-	DEFS += -DCONFIG_FB
 endif
 
-## i8042 controller
 ifeq ($(CONFIG_I8042),y)
 	GENARCH_SOURCES += \
@@ -74,5 +76,4 @@
 endif
 
-## Sun keyboard
 ifeq ($(CONFIG_SUN_KBD),y)
 	GENARCH_SOURCES += \
@@ -81,5 +82,4 @@
 endif
 
-## z8530 controller
 ifeq ($(CONFIG_Z8530),y)
 	GENARCH_SOURCES += \
@@ -87,5 +87,4 @@
 endif
 
-## ns16550 controller
 ifeq ($(CONFIG_NS16550),y)
 	GENARCH_SOURCES += \
@@ -93,6 +92,4 @@
 endif
 
-
-## OpenFirmware Device Tree
 ifeq ($(CONFIG_OFW_TREE), y)
 	GENARCH_SOURCES += \
@@ -105,5 +102,4 @@
 endif
 
-## EGA
 ifeq ($(CONFIG_EGA), y)
 	GENARCH_SOURCES += \
Index: kernel/genarch/src/kbd/i8042.c
===================================================================
--- kernel/genarch/src/kbd/i8042.c	(revision 95b99639fffc643d77610ff187c406c029738c9a)
+++ kernel/genarch/src/kbd/i8042.c	(revision 70047478224039b394ba6d1a4ba25ae4fb58ab81)
@@ -38,7 +38,5 @@
 
 #include <genarch/kbd/i8042.h>
-#ifdef ia64
 #include <arch/drivers/kbd.h>
-#endif
 #include <genarch/kbd/key.h>
 #include <genarch/kbd/scanc.h>
@@ -172,8 +170,8 @@
 	i8042_mouse_irq.handler = i8042_irq_handler;
 	irq_register(&i8042_mouse_irq);
-#ifndef ia64	
+	
 	trap_virtual_enable_irqs(1 << kbd_inr);
 	trap_virtual_enable_irqs(1 << mouse_inr);
-#endif	
+	
 	/*
 	 * Clear input buffer.
@@ -190,5 +188,5 @@
 #ifdef KBD_LEGACY
 	sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY);
-#endif	
+#endif
 	sysinfo_set_item_val("mouse", NULL, true);
 	sysinfo_set_item_val("mouse.devno", NULL, mouse_devno);
@@ -210,10 +208,11 @@
 char i8042_key_read(chardev_t *d)
 {
-	char ch;	
-
-	while(!(ch = active_read_buff_read())) {
+	char ch;
+	
+	while (!(ch = active_read_buff_read())) {
 		uint8_t x;
-		while (!(i8042_status_read() & i8042_BUFFER_FULL_MASK))
-			;
+		
+		while (!(i8042_status_read() & i8042_BUFFER_FULL_MASK));
+		
 		x = i8042_data_read();
 		if (x & KEY_RELEASE)
@@ -232,5 +231,5 @@
 {
 	uint8_t x;
-
+	
 	while (((x = i8042_status_read() & i8042_BUFFER_FULL_MASK))) {
 		x = i8042_data_read();
Index: kernel/genarch/src/kbd/key.c
===================================================================
--- kernel/genarch/src/kbd/key.c	(revision 95b99639fffc643d77610ff187c406c029738c9a)
+++ kernel/genarch/src/kbd/key.c	(revision 70047478224039b394ba6d1a4ba25ae4fb58ab81)
@@ -41,5 +41,5 @@
 #endif
 
-#if (defined(sparc64))
+#if (defined(US)) || (defined(US3))
 #include <genarch/kbd/scanc_sun.h>
 #endif
Index: kernel/genarch/src/kbd/ns16550.c
===================================================================
--- kernel/genarch/src/kbd/ns16550.c	(revision 95b99639fffc643d77610ff187c406c029738c9a)
+++ kernel/genarch/src/kbd/ns16550.c	(revision 70047478224039b394ba6d1a4ba25ae4fb58ab81)
@@ -40,7 +40,4 @@
 #include <genarch/kbd/scanc_sun.h>
 #include <arch/drivers/kbd.h>
-#ifndef ia64
-#include <arch/drivers/ns16550.h>
-#endif
 #include <ddi/irq.h>
 #include <ipc/irq.h>
@@ -131,9 +128,7 @@
 	ns16550_irq.cir_arg = cir_arg;
 	irq_register(&ns16550_irq);
-
-
+	
 	while ((ns16550_lsr_read(&ns16550) & LSR_DATA_READY)) 
 		ns16550_rbr_read(&ns16550);
-
 	
 	sysinfo_set_item_val("kbd", NULL, true);
@@ -143,20 +138,18 @@
 	sysinfo_set_item_val("kbd.address.virtual", NULL, port);
 	sysinfo_set_item_val("kbd.port", NULL, port);
-
+	
 #ifdef CONFIG_NS16550_INTERRUPT_DRIVEN
 	/* Enable interrupts */
-    	ns16550_ier_write(&ns16550, IER_ERBFI);
+	ns16550_ier_write(&ns16550, IER_ERBFI);
 	ns16550_mcr_write(&ns16550, MCR_OUT2);
 #endif
-
-#ifdef ia64
-    	uint8_t c;
-    	// This switches rbr & ier to mode when accept baudrate constant
-    	c = ns16550_lcr_read(&ns16550);
-    	ns16550_lcr_write(&ns16550, 0x80 | c);
-    	ns16550_rbr_write(&ns16550, 0x0c);
-    	ns16550_ier_write(&ns16550, 0x00);
-    	ns16550_lcr_write(&ns16550, c);
-#endif
+	
+	uint8_t c;
+	// This switches rbr & ier to mode when accept baudrate constant
+	c = ns16550_lcr_read(&ns16550);
+	ns16550_lcr_write(&ns16550, 0x80 | c);
+	ns16550_rbr_write(&ns16550, 0x0c);
+	ns16550_ier_write(&ns16550, 0x00);
+	ns16550_lcr_write(&ns16550, c);
 	
 	ns16550_grab();
@@ -186,8 +179,8 @@
 	while(!(ch = active_read_buff_read())) {
 		uint8_t x;
-		while (!(ns16550_lsr_read(&ns16550) & LSR_DATA_READY))
-			;
+		while (!(ns16550_lsr_read(&ns16550) & LSR_DATA_READY));
+		
 		x = ns16550_rbr_read(&ns16550);
-#ifndef ia64
+		
 		if (x != IGNORE_CODE) {
 			if (x & KEY_RELEASE)
@@ -196,13 +189,4 @@
 				active_read_key_pressed(x);
 		}
-#else
-		extern chardev_t kbrd;
-		if(x != 0x0d) {
-			if(x == 0x7f)
-				x = '\b';
-			 chardev_push_character(&kbrd, x);
-		}    
-#endif		
-
 	}
 	return ch;
@@ -215,5 +199,5 @@
 void ns16550_poll(void)
 {
-#ifndef CONFIG_NS16550_INTERRUPT_DRIVEN 
+#ifndef CONFIG_NS16550_INTERRUPT_DRIVEN
 	ipl_t ipl;
 
@@ -241,5 +225,5 @@
 		
 		x = ns16550_rbr_read(&ns16550);
-#ifndef ia64
+		
 		if (x != IGNORE_CODE) {
 			if (x & KEY_RELEASE)
@@ -248,13 +232,4 @@
 				key_pressed(x);
 		}
-#else
-		extern chardev_t kbrd;
-		if(x != 0x0d) {
-			if (x == 0x7f)
-				x = '\b';
-			chardev_push_character(&kbrd, x);
-		}    
-#endif		
-
 	}
 }
