Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Hi..Challenging problem and doubt

 
   Soft32 Home -> Linux -> Development RSS
Next:  How to active Xscreensaver login as root on Fedor..  
Author Message
crazymoonboy

External


Since: Jan 30, 2006
Posts: 1



(Msg. 1) Posted: Mon Jan 30, 2006 2:50 am
Post subject: Hi..Challenging problem and doubt
Archived from groups: linux>redhat>devel (more info?)

Hi,

First of all, I would like to thankful to you for giving good
guidelines and encouragement to solve my problem. Your suggessions are
very helpful to me and for my work. Thank you very much for your quick
response.

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, My program is
unable to read the Fixed screen information(FBIOGET_FSCREENINFO) and
Variable screen information (FBIOGET_VSCREENINFO). But, it is
successfully initialized and open the framebuffer (/dev/fb0) device.
The same thing (problem) is repeating in RedHat Linux also. What can I
do? Please show me a solution.

The below program is successfully running in SuSe Linux 9.3. But, it is
not running in Lepton Linux.

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 = 0;
struct fb_var_screeninfo vinfo;
struct fb_fix_screeninfo finfo;
long int screensize = 0;
char *fbp = 0;

/* Open the file for reading and writing */
fbfd = open("/dev/fb0", O_RDWR);
if (!fbfd)
{
printf("Error: cannot open framebuffer device.\n");
exit(1);
}
printf("The framebuffer device was opened successfully.\n");

/* Get fixed screen information */
if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo))
{
printf("Error reading fixed information.\n");
exit(2);
}

/* Get variable screen information */
if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo))
{
printf("Error reading variable information.\n");
exit(3);
}

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

/* Figure out the size of the screen in bytes */
screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;

/* Map the device to memory */
fbp = (char *)mmap(0, screensize, PROT_READ | PROT_WRITE,
MAP_SHARED, fbfd, 0);
if ((int)fbp == -1)
{
printf("Error: failed to map framebuffer device to memory.\n");
exit(4);
}
printf("The framebuffer device was mapped to memory
successfully.\n");

munmap(fbp, screensize);
close(fbfd);
return 0;
}

The above program is displaying 3 errors. Those are:

Error reading fixed information
Error reading variable information.
Error: failed to map framebuffer device to memory.

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.
Back to top
Login to vote
Display posts from previous:   
Related Topics:
ftp - problem - Hi, I'm progressing in my setup of the wu-ftpd daemon. Now I can log in, the ftpd does a chroot to my home ..

problem with getch() with gcc - I am trying to use getch() in a terminal app. In curses.h getch() is first declared as: extern NCURSES_EXPORT int..

RH 9.0 +glut link problem - All my open GL code that uses the glut library fails to link under RH 9.0. It works fine under RH 8.0. Lib glut can'...

"Thundering Herd" problem on Lynux - I'm development server app on Linux (Redhat, kernel 2.4.21-4.ELsmp), where multiple child processes do simultaneous..

kernel upgrade boot problem - Please Help - All, I installed a new copy of Fedora Core 2 on a Dell GX280 with and 80 Gig SATA disk drive. Everything installed..

funny problem with sleep (syscall as well as command) .... - Hi! I have a simple program: /**********************************/ #include <stdio.h> #include <stdlib.h> ...
       Soft32 Home -> Linux -> Development All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]