From: Geert U. <ge...@li...> - 2001-04-09 06:55:22
|
On Fri, 6 Apr 2001, Bipin T S wrote: > > We are using a Walnut board with a PPC processor. We don't have a > graphics chip/card in this board and so we planned to use the virtual > > frame buffer concept for debugging and testing the frame buffer > system. We build the kernel with the virtual frame buffer enabled in > Console > > drivers and we gave video = vfb:enable (Thanks to Simmons) in the > command line options. > > 1) We tried giving echo "Hello World" > /dev/fb0. It works fine. So fbmem.c:fb_write() works, and info->disp->screen_base is the correct virtual address of the frame buffer. > 2) We wrote an application that mmaps the /dev/fb0 into user memory. > This works fine and mmap() returns a valid address > > fb = open("/dev/fb0", O_RDWR); > addr =(unsigned char*) mmap(NULL, size, PROT_READ|PROT_WRITE, > MAP_SHARED, fb, 0); > > 3) But when we try to write something into the MAPPED address, we get a > segmentation fault!! > *( addr + 10) = 20; > > We would like to know the reason for the above behaviour. Pointers and > references will be appreciated So fbmem.c:fb_mmap() doesn't work. This means either fix.smem_start is not the correct physical address of the frame buffer, or io_remap_page_range() contains a bug. The Walnut has a PPC 8xx CPU, IIRC? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |