[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

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,



/* 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[] =

/* 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

    #if PS2_MOUSE
       * Make sure that you have selected the COM port and the
       * mouse type in ( c/src/lib/libbsp/i386/pc386/console/serial_mouse.h ).
  /* Standard VGA driver */

#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
{ 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?


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