[rtems-users] microwindows 0.90-rtems 4.7-pc386 - executing demo problems

Mark Mussetter mark at link-comm.com
Mon Feb 7 16:34:07 UTC 2005


We got that error when we were getting started as well.  Turned out that we 
needed to actually create and install a framebuffer driver 
(/dev/fb0).  Using Rosimildo da Silva's patch for rtems as a starting 
point, this is what we had to do:

1) In rtemscfg.h, changed the 
CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS  define to allow more devices.
2) Added MY_FRAMEBUFFER_DRIVER_TABLE_ENTRY to the Device_drivers table
3) Defined MY_FRAMEBUFFER_DRIVER_TABLE_ENTRY in framebuffer_driver.h
4) Wrote functions FB_Initialize, FB_Open, FB_Close, and FB_Control.

Everything else is pretty hardware specific but this should get you started.

Hope this helps,

Mark


==================================


/* In rtemscfg.h (Values that override settings in confdefs.h) */

...

#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS  10 /* overriding confdefs 
value of 3, so can install our devices including /dev/fb0 */

...

/* List of device drivers loaded by RTEMS at boot time */
rtems_driver_address_table Device_drivers[] =
{
   CONSOLE_DRIVER_TABLE_ENTRY,
   CLOCK_DRIVER_TABLE_ENTRY,

/* this can be a bit tricky if you are using a serial mouse,
    make sure that you do not install and serial driver that
    uses the same port !!!!
*/
#if 0
   TTY2_DRIVER_TABLE_ENTRY,

     #if PS2_MOUSE
       PAUX_DRIVER_TABLE_ENTRY,
     #else
       /*
        * Make sure that you have selected the COM port and the
        * mouse type in ( c/src/lib/libbsp/i386/pc386/console/serial_mouse.h ).
       */
       SERIAL_MOUSE_DRIVER_TABLE_ENTRY,
     #endif
   /* Standard VGA driver */
   FBVGA_DRIVER_TABLE_ENTRY,
#else
   {NULL,NULL,NULL,NULL,NULL,NULL},
   {NULL,NULL,NULL,NULL,NULL,NULL},
   {NULL,NULL,NULL,NULL,NULL,NULL},
#endif
   {NULL,NULL,NULL,NULL,NULL,NULL},
   MY_FRAMEBUFFER_DRIVER_TABLE_ENTRY,
   MY_ADS_DRIVER_TABLE_ENTRY,
   PTY_DRIVER_TABLE_ENTRY
};

#include <confdefs.h>

==================================

/*In framebuffer.h */

rtems_device_driver FB_Open( rtems_device_major_number major,
                                  rtems_device_minor_number minor,
                                  void *args );


rtems_device_driver FB_Close( rtems_device_major_number major,
                          rtems_device_minor_number minor,
                          void *args );


rtems_device_driver FB_Control( rtems_device_major_number major,
                           rtems_device_minor_number minor,
                           void *args );


rtems_device_driver FB_Initialize( rtems_device_major_number major,
                                  rtems_device_minor_number minor,
                                  void *args );


//When using the following driver setup, we don't need a read or write 
function since the subdriver "fblinx.c" handles the pixels directly
#define MY_FRAMEBUFFER_DRIVER_TABLE_ENTRY \
{ FB_Initialize, FB_Open, FB_Close, NULL, NULL, FB_Control }

==================================


At 08:20 AM 2/5/2005, you wrote:
>Hello all,
>
>I've compiled microwindows demo for pc386 bsp.
>
>Trying to run wdemo on real pc and bochs too, I found problem in getting 
>access to /dev/fb0.
>
>In microwindows/src/scr_rtems.c :
>
>....
>static PSD
>fb_open(PSD psd)
>{
>         char *  env;
>         int     type, visual;
>         int     tty;
>         PSUBDRIVER subdriver;
>         struct fb_screeninfo fb_info;
>
>         assert(status < 2);
>
>         /* locate and open framebuffer, get info*/
>         if(!(env = getenv("FRAMEBUFFER")))
>                 env = "/dev/fb0";
>         fb = open( env, O_RDWR);
>         if(fb < 0) {
>                 EPRINTF("Error opening %s: %m\n", env);
>      return NULL;
>   }
>
>Call to open() always returns -1.
>
>Anyone may help?
>
>Thanks.
>
>Luca
Mark Mussetter
Link Communications, Inc.
1035 Cerise Rd
Billings, MT 59101-7378
phone: (406) 245-5002 ext 105
Fax:    (406) 245-4889
WWW: http://www.link-comm.com
MailTo:mark at link-comm.com





More information about the users mailing list