mmap device doesn't work? and NR_MEM_LIST in 1.3.90

John Taves (jt@raf.com)
Fri, 26 Apr 1996 08:06:56 -0700


I am trying to make my device driver mmap its buffer. It doesn't seem to
work. I am using 1.3.59. The driver allocates 16MB of memory using
__get_free_pages (I had to modify NR_MEM_LIST in mm.h to make this
possible). I write a magic number to the first long at that location so
that I can be sure that the mmap works. The code for the mmap is a direct
copy of the code in mem.c. The program that is calling mmap(2) gets a
pointer, so there is no error, but when it looks at the long it is 0 not
my magic number. I put printk's into the mmap driver function and all my
parameters look fine and again no errors seem to be returned from
remap... I assume that I should be calling mmap(2) with PROT_READ. I
think I have tried a bunch of different protections, but none work.

My second question is how do I get 1.3.90 to give me 16MB of memory from
__get_free_pages. I didn't see an obvious equivalent to NR_MEM_LIST to
bump up.

Thanks for any help. Please e-mail me since I can't conveniently get back
to this group.

jt
jt@raf.com