Loading ...
Sorry, an error occurred while loading the content.
 

Framebuffer(/dev/fb0) is not opening in Redhat Linux and Lepton Floppy linux

Expand Messages
  • Crazy Boy
    Hi, First of all, I would like to thankful to you for your fast response. Please forget about yesterdays mail. In my previous mail, I did a mistake. I have one
    Message 1 of 2 , Jan 31, 2006
      Hi,

      First of all, I would like to thankful to you for your fast response. Please forget about yesterdays mail. In my previous mail, I did a mistake.

      I have one more doubt. i.e.,

      When I am trying to execute the below Framebuffer example program in Lepton (http://mulinux.dotsrc.org/lepton.html) linux and Redhat Linux, My program is unable to open the framebuffer device (/dev/fb0). This program is successfully running in SuSe Linux 9.3.

      How can I open the framebuffer (/dev/fb0) device in Redhat or Lepton Linux?

      What can I do? Please show me a solution.

      The example program is:

      #include <unistd.h>
      #include <stdio.h>
      #include <fcntl.h>
      #include <linux/fb.h>
      #include <sys/mman.h>

      int main(void)
      {
      int fbfd,fbfd1,fbfd2;
      struct fb_var_screeninfo vinfo;
      struct fb_fix_screeninfo finfo;

      printf("\nReturn Values of \n\n");

      /* Open the file for reading and writing */
      fbfd = open("/dev/fb0", O_RDWR);
      printf("\nfbfd = %d",fbfd);

      /* Get fixed screen information */
      fbfd1 = ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo);
      printf("\n fbfd1 = %d",fbfd1);

      /* Get variable screen information */
      fbfd2 = ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo);
      printf("\nfbfd2 = %d\n",fbfd2);

      printf("\n\n%dx%d, %dbpp\n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel );

      close(fbfd);
      return 0;
      }

      The output of the above program is :

      Return Values of

      fbfd = -1
      fbfd1 = -1
      fbfd2 = -1

      Thatmeans, Framebuffer device is not opening. So, to achieve this problem, what can I do? This is really very urgent. Please show me a solution. I will be waiting for your reply. Thank you very much for considering your valuable time for me.

      With regards,
      Chandra.



      ---------------------------------

      What are the most popular cars? Find out at Yahoo! Autos

      [Non-text portions of this message have been removed]
    • Hariprasad Govardhanam
      ... open call is returning -1 means errno is set. You have to check the value of errno global variable (errno.h) to see why it is failing. Use perror function
      Message 2 of 2 , Feb 1, 2006
        On 1/31/06, Crazy Boy <crazymoonboy@...> wrote:
        >
        > Hi,
        >
        > When I am trying to execute the below Framebuffer example program in
        > Lepton (http://mulinux.dotsrc.org/lepton.html) linux and Redhat Linux, My
        > program is unable to open the framebuffer device (/dev/fb0). This program is
        > successfully running in SuSe Linux 9.3.
        >
        > How can I open the framebuffer (/dev/fb0) device in Redhat or Lepton
        > Linux?
        >
        > <snip>
        >
        > The output of the above program is :
        >
        > Return Values of
        >
        > fbfd = -1
        > fbfd1 = -1
        > fbfd2 = -1



        open call is returning -1 means errno is set. You have to check the value of
        errno global variable (errno.h) to see why it is failing. Use perror
        function to print error message.
        I think the problem is with permissions. If you can post the error message,
        may be we can help.


        Thatmeans, Framebuffer device is not opening. So, to achieve this problem,
        > what can I do? This is really very urgent. Please show me a solution. I will
        > be waiting for your reply. Thank you very much for considering your valuable
        > time for me.
        >
        > With regards,
        > Chandra.
        >
        >


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.