Index: c/src/lib/libbsp/m68k/mvme162/console/console.c
===================================================================
--- c/src/lib/libbsp/m68k/mvme162/console/console.c	(revision c6fb8e90960d4504018e61bbe2bf06ff7f116d72)
+++ c/src/lib/libbsp/m68k/mvme162/console/console.c	(revision 3a4ae6c210bcc37754767966f1128ae23c77b6af)
@@ -22,8 +22,7 @@
 #define M162_INIT
 
-#include <rtems.h>
-#include "console.h"
-#include "bsp.h"
-#include "ringbuf.h"
+#include <bsp.h>
+#include <rtems/libio.h>
+#include <ringbuf.h>
 
 Ring_buffer_t  Buffer[2];
@@ -55,10 +54,9 @@
   rtems_device_major_number  major,
   rtems_device_minor_number  minor,
-  void                      *arg,
-  rtems_id                   self,
-  rtems_unsigned32          *status
+  void                      *arg
 )
 {
   int     i;
+  rtems_status_code status;
   
   /*
@@ -80,5 +78,32 @@
   mcchip->SCC_int_ctl = 0x13;     /* SCC IEN, IPL3 */
 
-  *status = RTEMS_SUCCESSFUL;
+  status = rtems_io_register_name(
+    "/dev/console",
+    major,
+    (rtems_device_minor_number) 0
+  );
+ 
+  if (status != RTEMS_SUCCESSFUL)
+    rtems_fatal_error_occurred(status);
+ 
+  status = rtems_io_register_name(
+    "/dev/tty00",
+    major,
+    (rtems_device_minor_number) 0
+  );
+ 
+  if (status != RTEMS_SUCCESSFUL)
+    rtems_fatal_error_occurred(status);
+ 
+  status = rtems_io_register_name(
+    "/dev/tty01",
+    major,
+    (rtems_device_minor_number) 0
+  );
+ 
+  if (status != RTEMS_SUCCESSFUL)
+    rtems_fatal_error_occurred(status);
+ 
+  return RTEMS_SUCCESSFUL;
 }
 
@@ -101,5 +126,5 @@
  */
 
-char char_wait(int port)
+char inbyte(int port)
 {
   unsigned char tmp_char;
@@ -114,5 +139,5 @@
  */
 
-void char_put(int port, char ch)
+void outbyte(int port, char ch)
 {
   while (1) {
@@ -123,44 +148,107 @@
 
 /*
- *    Map port A (1) to stdin, stdout, and stderr.
- *    Map everything else to port B (0).
- */
-
-int __read(int fd, char *buf, int nbytes)
-{
-  int i, port;
-
-  if ( fd <= 2 ) port = 1;
-  else           port = 0;
-
-  for (i = 0; i < nbytes; i++) {
-    *(buf + i) = char_wait(port);
-    if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
-      (*(buf + i++)) = '\n';
-      (*(buf + i)) = 0;
+ *  Open entry point
+ */
+
+rtems_device_driver console_open(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  return RTEMS_SUCCESSFUL;
+}
+ 
+/*
+ *  Close entry point
+ */
+
+rtems_device_driver console_close(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  return RTEMS_SUCCESSFUL;
+}
+
+/*
+ * 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
+)
+{
+  rtems_libio_rw_args_t *rw_args;
+  char *buffer;
+  int maximum;
+  int count = 0;
+ 
+  rw_args = (rtems_libio_rw_args_t *) arg;
+
+  buffer = rw_args->buffer;
+  maximum = rw_args->count;
+
+  if ( minor > 1 )
+    return RTEMS_INVALID_NUMBER;
+
+  for (count = 0; count < maximum; count++) {
+    buffer[ count ] = inbyte( minor );
+    if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
+      buffer[ count++ ]  = '\n';
+      buffer[ count ]  = 0;
       break;
     }
   }
-  return (i);
-}
-
-/*
- *  Map port A (1) to stdin, stdout, and stderr.
- *  Map everything else to port B (0).
- */
-
-int __write(int fd, char *buf, int nbytes)
-{
-  int i, port;
- 
-  if ( fd <= 2 ) port = 1;
-  else           port = 0;
- 
-  for (i = 0; i < nbytes; i++) {
-    if (*(buf + i) == '\n') {
-      char_put (port, '\r');
+
+  rw_args->bytes_moved = count;
+  return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
+}
+
+/*
+ * 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
+)
+{
+  int count;
+  int maximum;
+  rtems_libio_rw_args_t *rw_args;
+  char *buffer;
+
+  rw_args = (rtems_libio_rw_args_t *) arg;
+
+  buffer = rw_args->buffer;
+  maximum = rw_args->count;
+
+  if ( minor > 1 )
+    return RTEMS_INVALID_NUMBER;
+
+  for (count = 0; count < maximum; count++) {
+    if ( buffer[ count ] == '\n') {
+      outbyte('\r', minor );
     }
-    char_put (port, *(buf + i));
-  }
-  return (nbytes);
-}
+    outbyte( buffer[ count ], minor  );
+  }
+  return maximum;
+}
+
+/*
+ *  IO Control entry point
+ */
+
+rtems_device_driver console_control(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  return RTEMS_SUCCESSFUL;
+}
