Messages in this thread | | | Date | Sat, 17 Jul 1999 17:04:29 +0300 | From | Petru Paler <> | Subject | do_wp_page: bogus page (2.3.10) |
| |
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 #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; }
| |