Index: bsps/x86_64/amd64/console/console.c
===================================================================
--- bsps/x86_64/amd64/console/console.c	(revision 76c03152e110dcb770253b54277811228e8f78df)
+++ bsps/x86_64/amd64/console/console.c	(revision cf811a4eb2358d66f403cd1397b29829e1827220)
@@ -25,111 +25,48 @@
  */
 
+#include <libchip/ns16550.h>
+#include <rtems/bspIo.h>
 #include <bsp.h>
-#include <rtems/bspIo.h>
-#include <rtems/libio.h>
+#include <bsp/console-termios.h>
+#include <rtems/score/cpuimpl.h>
 
-/*  console_initialize
- *
- *  This routine initializes the console IO driver.
- *
- *  Input parameters: NONE
- *
- *  Output parameters:  NONE
- *
- *  Return values:
- */
-
-rtems_device_driver console_initialize(
-  rtems_device_major_number  major,
-  rtems_device_minor_number  minor,
-  void                      *arg
-)
+static uint8_t amd64_uart_get_register(uintptr_t addr, uint8_t i)
 {
-  (void) major;
-  (void) minor;
-  (void) arg;
-  return RTEMS_SUCCESSFUL;
+  return inport_byte(addr + i);
 }
 
-/*
- *  Open entry point
- */
-
-rtems_device_driver console_open(
-  rtems_device_major_number major,
-  rtems_device_minor_number minor,
-  void                    * arg
-)
+static void amd64_uart_set_register(uintptr_t addr, uint8_t i, uint8_t val)
 {
-  (void) major;
-  (void) minor;
-  (void) arg;
-  return RTEMS_SUCCESSFUL;
+  outport_byte(addr + i, val);
 }
 
+static ns16550_context amd64_uart_context = {
+  .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("UART"),
+  .get_reg = amd64_uart_get_register,
+  .set_reg = amd64_uart_set_register,
+  .port = (uintptr_t) COM1_BASE_IO,
+  .initial_baud = COM1_CLOCK_RATE
+};
+
 /*
- *  Close entry point
+ * XXX: We should use the interrupt based handler once interrupts are supported
  */
+const console_device console_device_table[] = {
+  {
+    .device_file = "/dev/console",
+    .probe = console_device_probe_default,
+    .handler = &ns16550_handler_polled,
+    .context = &amd64_uart_context.base
+  }
+};
+const size_t console_device_count = RTEMS_ARRAY_SIZE(console_device_table);
 
-rtems_device_driver console_close(
-  rtems_device_major_number major,
-  rtems_device_minor_number minor,
-  void                    * arg
-)
+static void output_char(char c)
 {
-  (void) major;
-  (void) minor;
-  (void) arg;
-  return RTEMS_SUCCESSFUL;
+  rtems_termios_device_context *ctx = console_device_table[0].context;
+
+  ns16550_polled_putchar(ctx, c);
 }
 
-/*
- * read bytes from the serial port. We only have stdin.
- */
-
-rtems_device_driver console_read(
-  rtems_device_major_number major,
-  rtems_device_minor_number minor,
-  void                    * arg
-)
-{
-  (void) major;
-  (void) minor;
-  (void) arg;
-  return RTEMS_SUCCESSFUL;
-}
-
-/*
- * write bytes to the serial port. Stdout and stderr are the same.
- */
-
-rtems_device_driver console_write(
-  rtems_device_major_number major,
-  rtems_device_minor_number minor,
-  void                    * arg
-)
-{
-  (void) major;
-  (void) minor;
-  (void) arg;
-  return 0;
-}
-
-/*
- *  IO Control entry point
- */
-
-rtems_device_driver console_control(
-  rtems_device_major_number major,
-  rtems_device_minor_number minor,
-  void                    * arg
-)
-{
-  (void) major;
-  (void) minor;
-  (void) arg;
-  return RTEMS_SUCCESSFUL;
-}
-
-BSP_output_char_function_type     BSP_output_char = NULL;
-BSP_polling_getchar_function_type BSP_poll_char   = NULL;
+BSP_output_char_function_type BSP_output_char   = output_char;
+BSP_polling_getchar_function_type BSP_poll_char = NULL;
Index: c/src/lib/libbsp/x86_64/amd64/Makefile.am
===================================================================
--- c/src/lib/libbsp/x86_64/amd64/Makefile.am	(revision 76c03152e110dcb770253b54277811228e8f78df)
+++ c/src/lib/libbsp/x86_64/amd64/Makefile.am	(revision cf811a4eb2358d66f403cd1397b29829e1827220)
@@ -30,4 +30,6 @@
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/clock/clock-simidle.c
 # console
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios-init.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/x86_64/amd64/console/console.c
 # timer
Index: cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h	(revision 76c03152e110dcb770253b54277811228e8f78df)
+++ cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h	(revision cf811a4eb2358d66f403cd1397b29829e1827220)
@@ -29,4 +29,18 @@
 #endif
 
+static inline uint8_t inport_byte(uint16_t port)
+{
+  uint8_t ret;
+  __asm__ volatile ( "inb %1, %0"
+                     : "=a" (ret)
+                     : "Nd" (port) );
+  return ret;
+}
+
+static inline void outport_byte(uint16_t port, uint8_t val)
+{
+  __asm__ volatile ( "outb %0, %1" : : "a" (val), "Nd" (port) );
+}
+
 #ifdef __cplusplus
 }
Index: cpukit/score/cpu/x86_64/include/rtems/score/x86_64.h
===================================================================
--- cpukit/score/cpu/x86_64/include/rtems/score/x86_64.h	(revision 76c03152e110dcb770253b54277811228e8f78df)
+++ cpukit/score/cpu/x86_64/include/rtems/score/x86_64.h	(revision cf811a4eb2358d66f403cd1397b29829e1827220)
@@ -35,4 +35,7 @@
 #define CPU_MODEL_NAME "XXX: x86-64 generic"
 
+#define COM1_BASE_IO 0x3F8
+#define COM1_CLOCK_RATE (115200 * 16)
+
 #ifdef __cplusplus
 }
