<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-11-18)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>jennifer</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-11-18 Jennifer Averett <Jennifer.Averett@OARcorp.com>

        PR 1925
        * Makefile.am, preinstall.am, console/serial_mouse_config.c,
        include/bsp.h, start/start.S: Converted 1386 console to the libchip
        style console
        * console/conscfg.c, console/console_control.c,
        console/printk_support.c, console/vgacons.c, console/vgacons.h: New
        files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/ChangeLog.diff?r1=text&tr1=1.280&r2=text&tr2=1.281&diff_format=h">M</a></td><td width='1%'>1.281</td><td width='100%'>c/src/lib/libbsp/i386/pc386/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/Makefile.am.diff?r1=text&tr1=1.61&r2=text&tr2=1.62&diff_format=h">M</a></td><td width='1%'>1.62</td><td width='100%'>c/src/lib/libbsp/i386/pc386/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/console/conscfg.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">c/src/lib/libbsp/i386/pc386/console/conscfg.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/console/console_control.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">c/src/lib/libbsp/i386/pc386/console/console_control.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/console/printk_support.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">c/src/lib/libbsp/i386/pc386/console/printk_support.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/console/serial_mouse_config.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>c/src/lib/libbsp/i386/pc386/console/serial_mouse_config.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/console/vgacons.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">c/src/lib/libbsp/i386/pc386/console/vgacons.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/console/vgacons.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">c/src/lib/libbsp/i386/pc386/console/vgacons.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/include/bsp.h.diff?r1=text&tr1=1.48&r2=text&tr2=1.49&diff_format=h">M</a></td><td width='1%'>1.49</td><td width='100%'>c/src/lib/libbsp/i386/pc386/include/bsp.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/preinstall.am.diff?r1=text&tr1=1.11&r2=text&tr2=1.12&diff_format=h">M</a></td><td width='1%'>1.12</td><td width='100%'>c/src/lib/libbsp/i386/pc386/preinstall.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/pc386/start/start.S.diff?r1=text&tr1=1.18&r2=text&tr2=1.19&diff_format=h">M</a></td><td width='1%'>1.19</td><td width='100%'>c/src/lib/libbsp/i386/pc386/start/start.S</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/i386/pc386/ChangeLog:1.280 rtems/c/src/lib/libbsp/i386/pc386/ChangeLog:1.281
--- rtems/c/src/lib/libbsp/i386/pc386/ChangeLog:1.280   Mon Oct 17 07:37:23 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/ChangeLog Fri Nov 18 14:11:06 2011
</font><font color='#997700'>@@ -1,3 +1,13 @@
</font><font color='#000088'>+2011-11-18    Jennifer Averett <Jennifer.Averett@OARcorp.com>
+
+       PR 1925
+       * Makefile.am, preinstall.am, console/serial_mouse_config.c,
+       include/bsp.h, start/start.S: Converted 1386 console to the libchip
+       style console
+       * console/conscfg.c, console/console_control.c,
+       console/printk_support.c, console/vgacons.c, console/vgacons.h: New
+       files.
+
</font> 2011-10-17        Ralf Corsépius <ralf.corsepius@rtems.org>
 
        * ne2000/ne2000.c: Remove unused var "stat".

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/i386/pc386/Makefile.am:1.61 rtems/c/src/lib/libbsp/i386/pc386/Makefile.am:1.62
--- rtems/c/src/lib/libbsp/i386/pc386/Makefile.am:1.61  Mon Aug  1 08:41:37 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/Makefile.am       Fri Nov 18 14:11:07 2011
</font><font color='#997700'>@@ -68,16 +68,21 @@
</font> libbsp_a_SOURCES += ../../shared/clockdrv_shell.h
 
 include_rtemsdir = $(includedir)/rtems
<font color='#880000'>-include_rtems_HEADERS = console/keyboard.h console/kd.h console/ps2_drv.h
</font><font color='#000088'>+include_rtems_HEADERS = console/keyboard.h console/kd.h console/ps2_drv.h \
+    ../../shared/console_private.h console/vgacons.h
</font> 
 include_HEADERS += ../../i386/shared/comm/i386_io.h
 # console
<font color='#880000'>-libbsp_a_SOURCES += console/console.c console/inch.c console/outch.c \
</font><font color='#000088'>+libbsp_a_SOURCES += console/inch.c console/outch.c \
</font>     console/defkeymap.c console/fb_vga.c console/keyboard.c \
     console/pc_keyb.c console/ps2_mouse.c \
     console/vgainit.c console/vt.c console/videoAsm.S \
     console/kbd_parser.c console/serial_mouse_config.c \
<font color='#880000'>-    ../../i386/shared/comm/uart.c ../../i386/shared/comm/tty_drv.c
</font><font color='#000088'>+    ../../i386/shared/comm/uart.c ../../i386/shared/comm/tty_drv.c \
+    ../../shared/console.c ../../shared/console_select.c \
+    ../../shared/console_read.c ../../shared/console_write.c \
+    console/console_control.c console/conscfg.c console/printk_support.c \
+    console/vgacons.c
</font> 
 # gdb
 libbsp_a_SOURCES += ../../i386/shared/comm/i386-stub.c \

<font color='#006600'>diff -u /dev/null rtems/c/src/lib/libbsp/i386/pc386/console/conscfg.c:1.1
--- /dev/null   Fri Nov 18 15:12:25 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/console/conscfg.c Fri Nov 18 14:11:07 2011
</font><font color='#997700'>@@ -0,0 +1,163 @@
</font><font color='#000088'>+/*
+ *  This file contains the libchip configuration information
+ *  to instantiate the libchip driver for the VGA console
+ *  and serial ports on a PC.
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <unistd.h> /* write */
+
+#include <bsp.h>
+#include <libchip/serial.h>
+#include <libchip/ns16550.h>
+#include "vgacons.h"
+#include <bsp/irq.h>
+#include <rtems/pci.h>
+
+#define VGA_CONSOLE_FUNCTIONS  &vgacons_fns
+#if 0
+#define COM_CONSOLE_FUNCTIONS  &ns16550_fns_polled
+#else
+#define COM_CONSOLE_FUNCTIONS  &ns16550_fns
+#endif
+
+/*
+ * Base IO for UART
+ */
+#define COM1_BASE_IO  0x3F8
+#define COM2_BASE_IO  0x3E8
+#define COM3_BASE_IO  0x2F8
+#define COM4_BASE_IO  0x2E8
+
+#define CLOCK_RATE     (115200 * 16)
+
+uint8_t com_get_register(uint32_t addr,uint8_t i)
+{
+  register uint8_t val;
+<span style="background-color: #FF0000">  </span>
+  inport_byte( (addr + i),val );
+  return val;
+}
+
+void com_set_register(uint32_t addr,uint8_t i, uint8_t val)
+{
+  outport_byte( (addr+i),val );
+}
+
+console_tbl     Console_Configuration_Ports[] = {
+  {
+    "/dev/vgacons",                        /* sDeviceName */
+    VGA_CONSOLE,                           /* deviceType */
+    VGA_CONSOLE_FUNCTIONS,                 /* pDeviceFns */
+    vgacons_probe,                         /* deviceProbe */
+    NULL,                                  /* pDeviceFlow */
+    16,                                    /* ulMargin */
+    8,                                     /* ulHysteresis */
+    (void *) NULL,              /* NULL */ /* pDeviceParams */
+    0x00000000,                            /* ulCtrlPort1 */
+    0x00000000,                            /* ulCtrlPort2 */
+    0x00000000,                            /* ulDataPort */
+    NULL,                                  /* getRegister */
+    NULL,                                  /* setRegister */
+    NULL,/* unused */                      /* getData */
+    NULL,/* unused */                      /* setData */
+    0X0,                                   /* ulClock */
+    0x0                                     /* ulIntVector -- base for port */
+  },
+  {
+    "/dev/com1",                           /* sDeviceName */
+    SERIAL_NS16550,                        /* deviceType */
+    COM_CONSOLE_FUNCTIONS,                 /* pDeviceFns */
+    NULL,                                  /* deviceProbe, assume it is there */
+    NULL,                                  /* pDeviceFlow */
+    16,                                    /* ulMargin */
+    8,                                     /* ulHysteresis */
+    (void *) 9600,         /* Baud Rate */ /* pDeviceParams */
+    COM1_BASE_IO,                          /* ulCtrlPort1 */
+    0x00000000,                            /* ulCtrlPort2 */
+    COM1_BASE_IO,                          /* ulDataPort */
+    com_get_register,                      /* getRegister */
+    com_set_register,                      /* setRegister */
+    NULL,/* unused */                      /* getData */
+    NULL,/* unused */                      /* setData */
+    CLOCK_RATE,                            /* ulClock */
+    BSP_UART_COM1_IRQ                      /* ulIntVector -- base for port */
+  },
+  {
+    "/dev/com2",                           /* sDeviceName */
+    SERIAL_NS16550,                        /* deviceType */
+    COM_CONSOLE_FUNCTIONS,                 /* pDeviceFns */
+    NULL,                                  /* deviceProbe, assume it is there */
+    NULL,                                  /* pDeviceFlow */
+    16,                                    /* ulMargin */
+    8,                                     /* ulHysteresis */
+    (void *) 9600,         /* Baud Rate */ /* pDeviceParams */
+    COM2_BASE_IO,                          /* ulCtrlPort1 */
+    0x00000000,                            /* ulCtrlPort2 */
+    COM2_BASE_IO,                          /* ulDataPort */
+    com_get_register,                      /* getRegister */
+    com_set_register,                      /* setRegister */
+    NULL,/* unused */                      /* getData */
+    NULL,/* unused */                      /* setData */
+    CLOCK_RATE,                            /* ulClock */
+    BSP_UART_COM2_IRQ                      /* ulIntVector -- base for port */
+  },
+
+  {
+    "/dev/com3",                           /* sDeviceName */
+    SERIAL_NS16550,                        /* deviceType */
+    COM_CONSOLE_FUNCTIONS,                 /* pDeviceFns */
+    NULL,                                  /* deviceProbe, assume it is there */
+    NULL,                                  /* pDeviceFlow */
+    16,                                    /* ulMargin */
+    8,                                     /* ulHysteresis */
+    (void *) 9600,         /* Baud Rate */ /* pDeviceParams */
+    COM3_BASE_IO,                          /* ulCtrlPort1 */
+    0x00000000,                            /* ulCtrlPort2 */
+    COM3_BASE_IO,                          /* ulDataPort */
+    com_get_register,                      /* getRegister */
+    com_set_register,                      /* setRegister */
+    NULL,/* unused */                      /* getData */
+    NULL,/* unused */                      /* setData */
+    CLOCK_RATE,                            /* ulClock */
+    BSP_UART_COM3_IRQ                      /* ulIntVector -- base for port */
+  },
+
+  {
+    "/dev/com4",                           /* sDeviceName */
+    SERIAL_NS16550,                        /* deviceType */
+    COM_CONSOLE_FUNCTIONS,                 /* pDeviceFns */
+    NULL,                                  /* deviceProbe, assume it is there */
+    NULL,                                  /* pDeviceFlow */
+    16,                                    /* ulMargin */
+    8,                                     /* ulHysteresis */
+    (void *) 9600,         /* Baud Rate */ /* pDeviceParams */
+    COM4_BASE_IO,                          /* ulCtrlPort1 */
+    0x00000000,                            /* ulCtrlPort2 */
+    COM4_BASE_IO,                          /* ulDataPort */
+    com_get_register,                      /* getRegister */
+    com_set_register,                      /* setRegister */
+    NULL,/* unused */                      /* getData */
+    NULL,/* unused */                      /* setData */
+    CLOCK_RATE,                            /* ulClock */
+    BSP_UART_COM4_IRQ                      /* ulIntVector -- base for port */
+  },
+
+};
+
+/*
+ *  Define a variable that contains the number of statically configured
+ *  console devices.
+ */
+unsigned long  Console_Configuration_Count = \
+    (sizeof(Console_Configuration_Ports)/sizeof(console_tbl));
</font>
<font color='#006600'>diff -u /dev/null rtems/c/src/lib/libbsp/i386/pc386/console/console_control.c:1.1
--- /dev/null   Fri Nov 18 15:12:25 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/console/console_control.c Fri Nov 18 14:11:07 2011
</font><font color='#997700'>@@ -0,0 +1,65 @@
</font><font color='#000088'>+/*
+ *  This file is an extension of the generic console driver<span style="background-color: #FF0000"> </span>
+ *  shell used by all console drivers using libchip, it contains
+ *  the console_control routine,  This bsp needs its own version
+ *  of this method to handle the keyboard and mouse as a single
+ *  device.
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <bsp.h>
+#include <rtems/libio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <termios.h>
+
+#include <bsp/irq.h>
+
+#include <rtems/termiostypes.h>
+#include <libchip/serial.h>
+#include <rtems/mouse_parser.h>
+#include "keyboard.h"
+#include "../../../shared/console_private.h"
+
+/*
+ *  console_control
+ *
+ *  this routine uses the termios driver to process io
+ */
+rtems_device_driver console_control(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  rtems_libio_ioctl_args_t *args = arg;
+
+  switch (args->command) {
+    default:
+      if( vt_ioctl( args->command, (unsigned long)args->buffer ) != 0 )
+        return rtems_termios_ioctl (arg);
+      break;
+
+    case MW_UID_REGISTER_DEVICE:
+      printk( "SerialMouse: reg=%s\n", args->buffer );
+      register_kbd_msg_queue( args->buffer, 0 );
+      break;
+
+    case MW_UID_UNREGISTER_DEVICE:
+      unregister_kbd_msg_queue( 0 );
+      break;
+  }
+<span style="background-color: #FF0000"> </span>
+  args->ioctl_return = 0;
+  return RTEMS_SUCCESSFUL;
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/c/src/lib/libbsp/i386/pc386/console/printk_support.c:1.1
--- /dev/null   Fri Nov 18 15:12:25 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/console/printk_support.c  Fri Nov 18 14:11:07 2011
</font><font color='#997700'>@@ -0,0 +1,57 @@
</font><font color='#000088'>+/*
+ *  This file contains a stub for the required printk support.
+ *  It is NOT functional!!!
+ *
+ *  This driver uses the termios pseudo driver.
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2007.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include <rtems/bspIo.h>
+#include <rtems/keyboard.h>
+#include <bsp.h>
+#include <libchip/serial.h>
+#include <libchip/ns16550.h>
+
+BSP_output_char_function_type     BSP_output_char = _IBMPC_outch;
+BSP_polling_getchar_function_type BSP_poll_char = BSP_wait_polled_input;
+
+rtems_device_minor_number         BSPPrintkPort = 0;
+
+int ns16550_inbyte_nonblocking_polled(
+  int minor
+);
+
+void BSP_com_outch(char ch)
+{
+  console_tbl                   *cptr;
+
+  cptr = &Console_Configuration_Ports[BSPPrintkPort];
+
+  return cptr->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
+}
+
+int BSP_com_inch( void )<span style="background-color: #FF0000"> </span>
+{
+  int           result;
+  console_tbl   *cptr;
+
+  cptr = &Console_Configuration_Ports[BSPPrintkPort];
+
+  do {
+    result = ns16550_inbyte_nonblocking_polled( BSPPrintkPort );
+  } while (result == -1);
+
+  return result;
+}
+
</font>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/i386/pc386/console/serial_mouse_config.c:1.1 rtems/c/src/lib/libbsp/i386/pc386/console/serial_mouse_config.c:1.2
--- rtems/c/src/lib/libbsp/i386/pc386/console/serial_mouse_config.c:1.1 Mon Mar 14 09:57:00 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/console/serial_mouse_config.c     Fri Nov 18 14:11:07 2011
</font><font color='#997700'>@@ -1,5 +1,5 @@
</font> /*
<font color='#880000'>- *  COPYRIGHT (c) 1989-2007.
</font><font color='#000088'>+ *  COPYRIGHT (c) 1989-2011.
</font>  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
<font color='#997700'>@@ -16,35 +16,31 @@
</font> #include <sys/stat.h>
 #include <fcntl.h>
 
<font color='#000088'>+#include "libchip/serial.h"
+#include "../../../shared/console_private.h"
+
</font> /* select which serial port the mouse is connected to */
<font color='#880000'>-/* XXX - Hook these somewhere */
-#ifdef   SERIAL_MOUSE_COM1
-  #define SERIAL_MOUSE_COM  1
-#elif defined(SERIAL_MOUSE_COM2)
-  #define SERIAL_MOUSE_COM  2
</font><font color='#000088'>+#if defined(SERIAL_MOUSE_COM2)
+  #define MOUSE_DEVICE "/dev/com2"
</font> #else
<font color='#880000'>-  /* Select Default to be COM1  */
-  #define SERIAL_MOUSE_COM  1
</font><font color='#000088'>+  #define MOUSE_DEVICE "/dev/com1"
</font> #endif
 
<font color='#880000'>-extern int BSPConsolePort;
</font><font color='#000088'>+static const char *SerialMouseDevice = MOUSE_DEVICE;
</font> 
 bool bsp_get_serial_mouse_device(
   const char **name,
   const char **type
 )
 {
<font color='#880000'>-  #ifdef SERIAL_MOUSE_COM2
-    *name = "/dev/ttyS2";
-  #else
-    *name = "/dev/ttyS1";
-  #endif
-<span style="background-color: #FF0000">  </span>
</font><font color='#000088'>+  const char *consname;
+
+  *name = SerialMouseDevice;
</font>   *type = "ms";
 
   /* Check if this port is not been used as console */
<font color='#880000'>-  /* XXX configure the serial port, take boot args additionally */
-  if ( BSPConsolePort == SERIAL_MOUSE_COM ) {
</font><font color='#000088'>+  consname = Console_Port_Tbl[ Console_Port_Minor ]->sDeviceName;
+  if ( !strcmp(MOUSE_DEVICE, consname) ) {
</font>     printk( "SERIAL MOUSE: port selected as console.(%s)\n", *name );
     rtems_fatal_error_occurred( -1 );
   }

<font color='#006600'>diff -u /dev/null rtems/c/src/lib/libbsp/i386/pc386/console/vgacons.h:1.1
--- /dev/null   Fri Nov 18 15:12:25 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/console/vgacons.h Fri Nov 18 14:11:08 2011
</font><font color='#997700'>@@ -0,0 +1,45 @@
</font><font color='#000088'>+/*
+ *  COPYRIGHT (c) 1989-2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#ifndef _VGACONS_H_
+#define _VGACONS_H_
+
+#include <libchip/serial.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define VGACONS_STATIC<span style="background-color: #FF0000"> </span>
+
+/*
+ *  This is the ASCII for "PC" in the upper word and 0386<span style="background-color: #FF0000"> </span>
+ *  in the lower which should be unique enough to
+ *  distinguish this type of serial device from others.
+ */
+
+#define VGA_CONSOLE 0x80670386
+
+#define VGACONS_UART0  0
+#define VGACONS_UART1  1
+
+bool vgacons_probe( int minor );
+
+/*
+ * Driver function table
+ */
+extern console_fns vgacons_fns;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _VGACONS_H_ */
</font>
<font color='#006600'>diff -u /dev/null rtems/c/src/lib/libbsp/i386/pc386/console/vgacons.c:1.1
--- /dev/null   Fri Nov 18 15:12:25 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/console/vgacons.c Fri Nov 18 14:11:07 2011
</font><font color='#997700'>@@ -0,0 +1,200 @@
</font><font color='#000088'>+/*
+ *  This file contains the termios TTY driver for the i386<span style="background-color: #FF0000"> </span>
+ *  vga.
+ *
+ *  COPYRIGHT (c) 1989-2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include <rtems/libio.h>
+#include <stdlib.h>
+#include <libchip/serial.h>
+#include <rtems/vgacons.h>
+#include <rtems/keyboard.h>
+#include <libchip/sersupp.h>
+#include <bsp/irq.h>
+#include <bsp.h>
+#include <crt.h>
+
+static int isr_is_on(const rtems_irq_connect_data *irq)
+{
+  return BSP_irq_enabled_at_i8259s(irq->name);
+}
+
+static rtems_irq_connect_data keyboard_isr_data = {
+  BSP_KEYBOARD,
+  keyboard_interrupt,
+  0,
+  NULL,
+  NULL,
+  isr_is_on
+};
+
+/*
+ *  vgacons_init
+ *
+ *  This function initializes the VGA console to a quiecsent state.
+ */
+VGACONS_STATIC void vgacons_init(int minor)
+{
+  /*<span style="background-color: #FF0000"> </span>
+   * Note:  We do not initialize the KBD interface here since
+   *        it was initialized regardless of whether the
+   *        vga is available or not.  Therefore it is initialized
+   *        in bsp_start.
+   */
+}
+
+/*
+ *  vgacons_open
+ *
+ *  This function opens a port for communication.
+ *
+ *  Default state is 9600 baud, 8 bits, No parity, and 1 stop bit.
+ */
+VGACONS_STATIC int vgacons_open(
+  int      major,
+  int      minor,
+  void    *arg
+)
+{
+  return RTEMS_SUCCESSFUL;
+}
+
+/*
+ *  vgacons_close
+ *
+ *  This function shuts down the requested port.
+ */
+VGACONS_STATIC int vgacons_close(
+  int      major,
+  int      minor,
+  void    *arg
+)
+{
+  return(RTEMS_SUCCESSFUL);
+}
+
+/*
+ *  vgacons_write_polled
+ *
+ *  This routine polls out the requested character.
+ */
+VGACONS_STATIC void vgacons_write_polled(
+  int   minor,
+  char  c
+)
+{
+  _IBMPC_outch( c );
+  if( c == '\n')
+    _IBMPC_outch( '\r' );            /* LF = LF + CR */
+}
+
+/*
+ *  vgacons_write_support_polled
+ *
+ *  Console Termios output entry point when using polled output.
+ *
+ */
+VGACONS_STATIC ssize_t vgacons_write_support_polled(
+  int         minor,
+  const char *buf,
+  size_t      len
+)
+{
+  int nwrite = 0;
+
+  /*
+   * poll each byte in the string out of the port.
+   */
+  while (nwrite < len) {
+    vgacons_write_polled(minor, *buf++);
+    nwrite++;
+  }
+
+  /*
+   * return the number of bytes written.
+   */
+  return nwrite;
+}
+
+/*
+ *  vgacons_inbyte_nonblocking_polled
+ *
+ *  Console Termios polling input entry point.
+ */
+VGACONS_STATIC int vgacons_inbyte_nonblocking_polled(
+  int minor
+)
+{
+  if( rtems_kbpoll() ) {
+    int c = getch();
+    return c;
+  }
+
+  return -1;
+}
+
+/*
+ *  vgacons_set_attributes
+ *
+ *  This function sets the UART channel to reflect the requested termios
+ *  port settings.
+ */
+VGACONS_STATIC int vgacons_set_attributes(
+  int minor,
+  const struct termios *t
+)
+{
+  return 0;
+}
+
+bool vgacons_probe(
+  int minor
+)
+{
+  int         status;
+  static bool firstTime = true;
+
+  if ((*(unsigned char*) NB_MAX_ROW_ADDR == 0) &&
+      (*(unsigned short*)NB_MAX_COL_ADDR == 0)) {
+    return false;
+  }
+
+  /*
+   *  If there is a video card, let's assume there is also a keyboard.
+   *  The means that we need the ISR installed in case someone wants to
+   *  use the Keyboard or PS2 Mouse.  With Microwindows, the console
+   *  can be COM1 and you can still use the mouse/VGA for graphics.
+   */
+  if ( firstTime ) {
+    status = BSP_install_rtems_irq_handler(&keyboard_isr_data);
+    if (!status) {
+      printk("Error installing keyboard interrupt handler!\n");
+      rtems_fatal_error_occurred(status);
+    }
+  }
+  firstTime = false;
+
+  return true;
+}
+
+console_fns vgacons_fns =
+{
+  libchip_serial_default_probe,        /* deviceProbe */
+  vgacons_open,                        /* deviceFirstOpen */
+  vgacons_close,                       /* deviceLastClose */
+  vgacons_inbyte_nonblocking_polled,   /* deviceRead */
+  vgacons_write_support_polled,        /* deviceWrite */
+  vgacons_init,                        /* deviceInitialize */
+  vgacons_write_polled,                /* deviceWritePolled */
+  vgacons_set_attributes,              /* deviceSetAttributes */
+  FALSE,                               /* deviceOutputUsesInterrupts */
+};
</font>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/i386/pc386/include/bsp.h:1.48 rtems/c/src/lib/libbsp/i386/pc386/include/bsp.h:1.49
--- rtems/c/src/lib/libbsp/i386/pc386/include/bsp.h:1.48        Fri Feb 11 06:04:30 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/include/bsp.h     Fri Nov 18 14:11:08 2011
</font><font color='#997700'>@@ -201,6 +201,8 @@
</font> void set_debug_traps(void);
 void breakpoint(void);
 
<font color='#000088'>+#define BSP_MAXIMUM_DEVICES 6
+
</font> #ifdef __cplusplus
 }
 #endif

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/i386/pc386/preinstall.am:1.11 rtems/c/src/lib/libbsp/i386/pc386/preinstall.am:1.12
--- rtems/c/src/lib/libbsp/i386/pc386/preinstall.am:1.11        Mon Aug  1 08:41:37 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/preinstall.am     Fri Nov 18 14:11:07 2011
</font><font color='#997700'>@@ -119,6 +119,14 @@
</font>   $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/ps2_drv.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/ps2_drv.h
 
<font color='#000088'>+$(PROJECT_INCLUDE)/rtems/console_private.h: ../../shared/console_private.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
+       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/console_private.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/console_private.h
+
+$(PROJECT_INCLUDE)/rtems/vgacons.h: console/vgacons.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
+       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/vgacons.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/vgacons.h
+
</font> $(PROJECT_INCLUDE)/i386_io.h: ../../i386/shared/comm/i386_io.h $(PROJECT_INCLUDE)/$(dirstamp)
        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/i386_io.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/i386_io.h

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/i386/pc386/start/start.S:1.18 rtems/c/src/lib/libbsp/i386/pc386/start/start.S:1.19
--- rtems/c/src/lib/libbsp/i386/pc386/start/start.S:1.18        Thu Jul 14 10:07:21 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/start/start.S     Fri Nov 18 14:11:08 2011
</font><font color='#997700'>@@ -209,11 +209,6 @@
</font> +---------------------------------------------------------------------*/
        call checkCPUtypeSetCr0
 
<font color='#880000'>-/*---------------------------------------------------------------------+
-| Redirect printk (and console) port if desired
-+---------------------------------------------------------------------*/
-       call SYM(BSP_console_select)
-
</font> #ifdef __SSE__
        call SYM(enable_sse)
 #endif
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>jennifer</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-11-18 Jennifer Averett <Jennifer.Averett@OARcorp.com>

        PR 1925
        * shared/irq/irq.h: Changed i386 console to libchip style console and
        added support for com3 and com4.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/ChangeLog.diff?r1=text&tr1=1.88&r2=text&tr2=1.89&diff_format=h">M</a></td><td width='1%'>1.89</td><td width='100%'>c/src/lib/libbsp/i386/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/i386/shared/irq/irq.h.diff?r1=text&tr1=1.17&r2=text&tr2=1.18&diff_format=h">M</a></td><td width='1%'>1.18</td><td width='100%'>c/src/lib/libbsp/i386/shared/irq/irq.h</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/i386/ChangeLog:1.88 rtems/c/src/lib/libbsp/i386/ChangeLog:1.89
--- rtems/c/src/lib/libbsp/i386/ChangeLog:1.88  Fri Oct 21 23:40:53 2011
+++ rtems/c/src/lib/libbsp/i386/ChangeLog       Fri Nov 18 14:13:00 2011
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-11-18    Jennifer Averett <Jennifer.Averett@OARcorp.com>
+
+       PR 1925
+       * shared/irq/irq.h: Changed i386 console to libchip style console and
+       added support for com3 and com4.
+
</font> 2011-10-22        Ralf Corsépius <ralf.corsepius@rtems.org>
 
        * shared/comm/uart.c (uartError): Remove unused var "uartStatus".

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/i386/shared/irq/irq.h:1.17 rtems/c/src/lib/libbsp/i386/shared/irq/irq.h:1.18
--- rtems/c/src/lib/libbsp/i386/shared/irq/irq.h:1.17   Thu Jul 14 12:30:27 2011
+++ rtems/c/src/lib/libbsp/i386/shared/irq/irq.h        Fri Nov 18 14:13:03 2011
</font><font color='#997700'>@@ -55,6 +55,8 @@
</font> #define BSP_KEYBOARD<span style="background-color: #FF0000">          </span>       1
 #define BSP_UART_COM2_IRQ      3
 #define BSP_UART_COM1_IRQ      4
<font color='#000088'>+#define BSP_UART_COM3_IRQ  5
+#define BSP_UART_COM4_IRQ      6
</font> #define BSP_RT_TIMER1     <span style="background-color: #FF0000">      </span>     8
 #define BSP_RT_TIMER3          10
 #define BSP_SMP_IPI<span style="background-color: #FF0000">   </span>            16
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>