Thread (7 messages) 7 messages, 3 authors, 2007-03-09

Re: Gives Bus error in memcpy() in coping /dev/fb0 to a file.

flat view

From: Vishal Soni <hidden>
Date: 2007-03-09 04:59:14

On Thursday 08 March 2007 18:35, Antonino A. Daplas wrote:
On Wed, 2007-03-07 at 17:20 +0530, Vishal Soni wrote:
quoted
[root@tw pcapp]# ./pcapp
1024x768, 16bpp
framebuffer device mapped to memory @ 0xb7db3000.
FB_FRAME mapped to memory @ 0xb7c33000.
Bus error
I don't think vfb's framebuffer can be mmapped.  It's fixable, but
nobody seems to have a need for it,  yet.

Tony
fb is getting successfully mapped.. its just that memcpy gives bus error when
i try to copy the mapped memory of ""framebuffer device"" to a
"""mapped file""""

Well, I am able to get the ball rolling by writing the mapped framebuffer onto
the file by using the below write system call

write(fdout, src, screensize);
/* where fdout = open("./fb_frame", O_RDWR);
and src = (char *)mmap(0, screensize, PROT_READ|PROT_WRITE, MAP_SHARED, fdin,
0); // fdin=open("/dev/fb0", O_RDONLY)
*/

Interesting is that.... why the below code gives problem in memcpy 'ng
with bus error

memcpy(dst, src, screensize);
/*
where src = mmap (0, screensize, PROT_READ, MAP_PRIVATE, fdin, 0));
and
fdin is descriptor of "/dev/fb0"
and
dst = mmap (0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, fdout,
0);
and
fdout is descriptor of "./fb_frame" file
*/

Had this fdin not been descriptor of device file "/dev/fb0" but an ordinary
file this method of copying the two files works.

Any clues !!!!!!

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help