lkml.org 
[lkml]   [1999]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdo_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;
}
\
 
 \ /
  Last update: 2005-03-22 13:53    [W:3.141 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site