From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Vishal Soni <vishal.soni@samsung.com>
Cc: linux-fbdev-devel@lists.sourceforge.net
Subject: Re: Gives Bus error in memcpy() in coping /dev/fb0 to a file.
Date: Sat, 10 Mar 2007 01:55:10 +0800 [thread overview]
Message-ID: <1173462910.4719.3.camel@daplas> (raw)
In-Reply-To: <426888a60703090109i669536b4t455a8ef984dfd278@mail.gmail.com>
On Fri, 2007-03-09 at 14:39 +0530, Vishal Soni wrote:
> > > > 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 write system call
> >
> > Unless you modified vfb yourself, it's not possible because
> > fix->smem_start is not set all (it's pointing to NULL). What's actually
> > being mmapped is physical addres 0UL.
> what i wanted to do......as i wrote in my very first mail........ i
> have got that, now i am able to capture the snapshot using c program
> and the results are output on my screen....
> printf("frame bufffer mapped @ %p\n", src);
> for(i = 0; i < vinfo.xres*vinfo.yres*vinfo.bits_per_pixel/8; i++)
> *src++ = 0xBB;
>
> Framebuffer is getting mapped... by mmap system call
> // Map the device to memory
> src = (char *)mmap(0, screensize, PROT_READ|PROT_WRITE,
> MAP_SHARED, fdin, 0);
> if ((int)src == -1) {
> printf("Error: failed to map framebuffer device to memory.\n");
> return -1;
> }
>
> and therefore physical addres 0UL is not what is mapped.....its the
> framebuffer.
> doubt in my last mail was w.r.t memcpy().
Well you had me confused, you mentioned virtual framebuffer, but I think
you are actually using the VESA framebuffer.
Anyway, the bus error is because the source file is truncated to zero
size. Try instead to open a file whose size is >= screensize.
Tony
-------------------------------------------------------------------------
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
prev parent reply other threads:[~2007-03-09 17:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-07 11:50 Gives Bus error in memcpy() in coping /dev/fb0 to a file Vishal Soni
2007-03-08 13:05 ` Antonino A. Daplas
2007-03-08 17:39 ` Nuno Lucas
2007-03-08 21:49 ` Antonino A. Daplas
[not found] ` <200703091021.46041.vishal.soni@samsung.com>
2007-03-09 8:54 ` Antonino A. Daplas
2007-03-09 4:59 ` Vishal Soni
2007-03-09 9:09 ` Vishal Soni
2007-03-09 17:55 ` Antonino A. Daplas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1173462910.4719.3.camel@daplas \
--to=adaplas@gmail.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=vishal.soni@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.