2

I am trying to cross compile directfb and run directfb examples

I have downloaded the directfb sources and cross compiled the same. I got problems while running directfb examples.

I have registered the character device(/dev/fb0) using the following program ( created as .ko file )

static struct file_operations fops=
{
    .open=dev_open,  //To open device - file operation
};
int init_module(void)
{
    static dev_t dev_major;
    static struct cdev*dev_cdev;
    int ret=-EIO;
    /* register char-dev */
    dev_major=MKDEV(29,0);
    ret=register_chrdev_region(dev_major,1,"fb0");
    if (ret)
    {
        printk(KERN_ERR "fb0 : can't get chrdev %d\n",29);
        return ret;
    }
    /* allocate cdev */
    dev_cdev=cdev_alloc();
    dev_cdev->ops=&fops;
    /* cdev_init(&dev_data.cdev,&dev_file_ops); */
    ret=cdev_add(dev_cdev,dev_major,1);
    if (ret)
    {
        printk(KERN_ERR "fb0 : can't allocate cdev\n");
        return ret;
    }
    return 0;
}

After that i have run the following commands,

# insmod directfb_ko.ko
# mknod /dev/fb0 c 29 0

Then i tried to run Directfb example. I got the following errors

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.4.1 |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2001-2009  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------
(*) DirectFB/Core: Single Application Core. (2015-11-19 10:49) 
(!) DirectFB/FBDev/vt: FBIOGET_CON2FBMAP failed!
    --> Inappropriate ioctl for device
(!) DirectFB/FBDev/vt: FBIOPUT_CON2FBMAP failed!
    --> Inappropriate ioctl for device
(*) Direct/Thread: Started 'VT Switcher' (-1) [CRITICAL OTHER/OTHER 0/0] <8388608>...
(*) Direct/Thread: Started 'VT Flusher' (-1) [DEFAULT OTHER/OTHER 0/0] <8388608>...
(!) DirectFB/FBDev: Could not get fixed screen information!
    --> Inappropriate ioctl for device
(!) DirectFB/Core: Could not initialize 'system_core' core!
    --> Initialization error!
(!) Tools/Screen: DirectFBCreate() failed!
    --> Initialization error!

Is there any idea about this error. Please help me to solve this issue.

ivpavici
  • 1,117
  • 2
  • 19
  • 30
  • Don't you need to define [a `ioctl` routine](http://lxr.free-electrons.com/source/include/linux/fs.h#L1622) in your file operations struct? – tangrs Nov 23 '15 at 12:17

0 Answers0