mmap() vs. character special file

Dmitry Pryanishnikov dmitry at atlantis.dp.ua
Sat Jun 24 22:54:08 UTC 2006


Hello!

On Sat, 24 Jun 2006, Stanislav Sedov wrote:
>> I'm curious about mmap()ing devices (particularly, HDD slices). The manpage
>> mentions character special files only once:
>
> You cannot mmap ata devices (as well as scsi ones), since mmap functions
> was not implemented. Actually, only few devices have such support
> (e.g. drm, bktr).
>
> mmap requires device to return pointer to contigues memory range -
> drm, for example, returns pointer to physical memory of the graphical
> adapter.
>
> Implementing mmap for disk devices involves complicated VM intercations,
> since you cannot simply return pointer to "physical" memory. Actually,
> implementing mmap, IMHO, doesn't worth efforts to do this.

  Thank you for the clarification. Actually I won't say that I can't
live w/o mmap() support for disks ;) I consider mmap() to be handy when
process should modify several bytes of the disk contents and write
them back (e.g., disklabel edition).  Of course, those tasks are very
specific, so implementing mmap() just for them is an overkill.

> Stanislav Sedov         MBSD labs, Inc.         <ssedov at mbsd.msk.ru>
> Россия, Москва		http://mbsd.msk.ru

Sincerely, Dmitry
-- 
Atlantis ISP, System Administrator
e-mail:  dmitry at atlantis.dp.ua
nic-hdl: LYNX-RIPE


More information about the freebsd-hackers mailing list