From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 24 22:54:08 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B92216A4A6 for ; Sat, 24 Jun 2006 22:54:08 +0000 (UTC) (envelope-from dmitry@atlantis.dp.ua) Received: from postman.atlantis.dp.ua (postman.atlantis.dp.ua [193.108.47.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id C655843D64 for ; Sat, 24 Jun 2006 22:54:07 +0000 (GMT) (envelope-from dmitry@atlantis.dp.ua) Received: from smtp.atlantis.dp.ua (smtp.atlantis.dp.ua [193.108.46.231]) by postman.atlantis.dp.ua (8.13.1/8.13.1) with ESMTP id k5OMrutb064655; Sun, 25 Jun 2006 01:53:56 +0300 (EEST) (envelope-from dmitry@atlantis.dp.ua) Date: Sun, 25 Jun 2006 01:53:56 +0300 (EEST) From: Dmitry Pryanishnikov To: Stanislav Sedov In-Reply-To: <20060624040603.594c44bc.stas@310.ru> Message-ID: <20060625013328.J47342@atlantis.atlantis.dp.ua> References: <20060624010644.Y82000@atlantis.atlantis.dp.ua> <20060624040603.594c44bc.stas@310.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=koi8-u; format=flowed Content-Transfer-Encoding: 8BIT Cc: freebsd-hackers@freebsd.org Subject: Re: mmap() vs. character special file X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jun 2006 22:54:08 -0000 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. > Россия, Москва http://mbsd.msk.ru Sincerely, Dmitry -- Atlantis ISP, System Administrator e-mail: dmitry@atlantis.dp.ua nic-hdl: LYNX-RIPE