Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision b2ac3998f80b325688c672166d5691a55d8f7811)
+++ HelenOS.config	(revision 3296df5ebf486ef213eaea03ce982d78f1997fa9)
@@ -457,4 +457,7 @@
 ! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=serial)&PLATFORM=ia64&MACHINE=i460GX] CONFIG_NS16550 (y/n)
 
+% Support for NS16550 controller
+! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=serial)&(PLATFORM=ia32|PLATFORM=amd64)] CONFIG_NS16550 (y/n)
+
 % Support for ARM926 on-chip UART
 ! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=integratorcp] CONFIG_ARM926_UART (y/n)
@@ -485,5 +488,5 @@
 
 % Serial line input module
-! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_ARM926_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)] CONFIG_SRLN (y)
+! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_ARM926_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)|(PLATFORM=ia32&CONFIG_NS16550=y)|(PLATFORM=amd64&CONFIG_NS16550=y)] CONFIG_SRLN (y)
 
 % EGA support
Index: kernel/arch/amd64/include/interrupt.h
===================================================================
--- kernel/arch/amd64/include/interrupt.h	(revision b2ac3998f80b325688c672166d5691a55d8f7811)
+++ kernel/arch/amd64/include/interrupt.h	(revision 3296df5ebf486ef213eaea03ce982d78f1997fa9)
@@ -53,4 +53,6 @@
 #define IRQ_KBD       1
 #define IRQ_PIC1      2
+/* NS16550 at COM1 */
+#define IRQ_NS16550   4
 #define IRQ_PIC_SPUR  7
 #define IRQ_MOUSE     12
Index: kernel/arch/amd64/src/amd64.c
===================================================================
--- kernel/arch/amd64/src/amd64.c	(revision b2ac3998f80b325688c672166d5691a55d8f7811)
+++ kernel/arch/amd64/src/amd64.c	(revision 3296df5ebf486ef213eaea03ce982d78f1997fa9)
@@ -50,7 +50,9 @@
 #include <genarch/drivers/ega/ega.h>
 #include <genarch/drivers/i8042/i8042.h>
+#include <genarch/drivers/ns16550/ns16550.h>
 #include <genarch/drivers/legacy/ia32/io.h>
 #include <genarch/fb/bfb.h>
 #include <genarch/kbrd/kbrd.h>
+#include <genarch/srln/srln.h>
 #include <genarch/multiboot/multiboot.h>
 #include <genarch/multiboot/multiboot2.h>
@@ -215,4 +217,21 @@
 	}
 #endif
+
+#ifdef CONFIG_NS16550
+	/*
+	 * Initialize the ns16550 controller. Then initialize the serial
+	 * input module and connect it to ns16550.
+	 */
+	ns16550_instance_t *ns16550_instance
+	    = ns16550_init((ns16550_t *) NS16550_BASE, IRQ_NS16550, NULL, NULL);
+	if (ns16550_instance) {
+		srln_instance_t *srln_instance = srln_init();
+		if (srln_instance) {
+			indev_t *sink = stdin_wire();
+			indev_t *srln = srln_wire(srln_instance, sink);
+			ns16550_wire(ns16550_instance, srln);
+		}
+	}
+#endif
 	
 	if (irqs_info != NULL)
Index: kernel/arch/ia32/include/interrupt.h
===================================================================
--- kernel/arch/ia32/include/interrupt.h	(revision b2ac3998f80b325688c672166d5691a55d8f7811)
+++ kernel/arch/ia32/include/interrupt.h	(revision 3296df5ebf486ef213eaea03ce982d78f1997fa9)
@@ -53,4 +53,6 @@
 #define IRQ_KBD       1
 #define IRQ_PIC1      2
+/* NS16550 at COM1 */
+#define IRQ_NS16550   4
 #define IRQ_PIC_SPUR  7
 #define IRQ_MOUSE     12
Index: kernel/arch/ia32/src/ia32.c
===================================================================
--- kernel/arch/ia32/src/ia32.c	(revision b2ac3998f80b325688c672166d5691a55d8f7811)
+++ kernel/arch/ia32/src/ia32.c	(revision 3296df5ebf486ef213eaea03ce982d78f1997fa9)
@@ -51,7 +51,9 @@
 #include <genarch/drivers/ega/ega.h>
 #include <genarch/drivers/i8042/i8042.h>
+#include <genarch/drivers/ns16550/ns16550.h>
 #include <genarch/drivers/legacy/ia32/io.h>
 #include <genarch/fb/bfb.h>
 #include <genarch/kbrd/kbrd.h>
+#include <genarch/srln/srln.h>
 #include <genarch/multiboot/multiboot.h>
 #include <genarch/multiboot/multiboot2.h>
@@ -169,4 +171,21 @@
 	}
 #endif
+
+#ifdef CONFIG_NS16550
+	/*
+	 * Initialize the ns16550 controller. Then initialize the serial
+	 * input module and connect it to ns16550.
+	 */
+	ns16550_instance_t *ns16550_instance
+	    = ns16550_init((ns16550_t *) NS16550_BASE, IRQ_NS16550, NULL, NULL);
+	if (ns16550_instance) {
+		srln_instance_t *srln_instance = srln_init();
+		if (srln_instance) {
+			indev_t *sink = stdin_wire();
+			indev_t *srln = srln_wire(srln_instance, sink);
+			ns16550_wire(ns16550_instance, srln);
+		}
+	}
+#endif
 	
 	if (irqs_info != NULL)
