tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Cannot mmap character device



> the mmap(2) page explicitely notes that we may map character devices.
> Anyone can tell me why this fails?

> [...attempt to map /dev/rxbd1a PROT_READ size 4096 offset 8192...]

You may map character devices in general, but the driver still has to
support the particular request you make.  Offhand, I'd guess that the
driver refused your attempt.

You don't specify what NetBSD rev you tried this on, but I looked at
4.0.1 (what was at ready hand) and the only xbd driver I found there,
arch/xen/xen/xbd.c, specifies nommap as its mmap function.  If that's
the xbd you're using and it's still so in the version you're using,
this is operating exactly as designed.

What kind of character device is more likely to provide a non-dummy
mmap function?  Audio and framebuffers are the ones I'm most aware of,
but I'm sure there are plenty of others.

Why doesn't xbd provide mmap support?  My guess would be it's just a
case of "nobody's needed it enough to bother writing it yet".

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index