Hi all,
I got some (strange ?) results when mapping the framebuffer device (VESA
VGA framebuffer, but I don't think it matters) under 2.3.10. I have attached
the program that triggers the "problem". If I mmap() with MAP_SHARED nothing
special happens, but when I use MAP_PRIVATE I get:
Jul 17 16:52:20 newton kernel: do_wp_page: bogus page at address 40014000
(a0000000)
Jul 17 16:52:20 newton kernel: VM: killing process fb
I don't really think this is a problem since we are trying to
copy-on-write the framebuffer, but maybe you find it interesting.
-Petru
--r5Pyd7+fXNt84Ff3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="fb.c"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define MEMSIZE 4096
int main()
{
char *fb;
int fd, i;
fd = open("/dev/fb0", O_RDWR);
if (fd == -1) {
perror("open");
exit(1);
}
fb = (char*)mmap(0, MEMSIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (fb == MAP_FAILED) {
perror("mmap");
exit(1);
}
for (i=0; i<MEMSIZE; i++)
fb[i] = 255;
munmap(fb, MEMSIZE);
close(fd);
return 0;
}
--r5Pyd7+fXNt84Ff3--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/