From owner-freebsd-hackers@FreeBSD.ORG Wed May 19 15:29:20 2004 Return-Path: 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 5355116A4CE; Wed, 19 May 2004 15:29:20 -0700 (PDT) Received: from wattres.Watt.COM (wattres.watt.com [66.93.133.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 104D043D58; Wed, 19 May 2004 15:29:19 -0700 (PDT) (envelope-from steve@Watt.COM) Received: (from steve@localhost) by wattres.Watt.COM (8.12.11/8.12.11) id i4JMT95J087312; Wed, 19 May 2004 15:29:09 -0700 (PDT) (envelope-from steve) Message-Id: <200405192229.i4JMT95J087312@wattres.Watt.COM> X-Newsgroups: local.freebsd-hackers In-Reply-To: <20040519143453.GZ845@darkness.comp.waw.pl> References: <20040519122907.GO81341@elvis.mu.org> Organization: Watt Consultants, San Jose, CA, USA From: steve@Watt.COM (Steve Watt) Date: Wed, 19 May 2004 15:29:09 -0700 X-Mailer: Mail User's Shell (7.2.6 beta(5) jp(8) 11/23/00) To: pjd@freebsd.org cc: hackers@freebsd.org Subject: Re: api for sharing memory from kernel to userspace? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2004 22:29:20 -0000 In article <20040519143453.GZ845@darkness.comp.waw.pl> you write: > >On Wed, May 19, 2004 at 05:29:07AM -0700, Alfred Perlstein wrote: >+> I need to share about 100megs of memory between kernel and userspace. >+> >+> The memory can not be paged and should appear contig in the process's >+> address space. Any suggestions? >+> >+> I need a way to either: >+> map user memory into the kernel's address space. >+> map kernel memory into the user's address space. >+> >+> I was looking at pmap_qenter() but it didn't see attractive because >+> it's for "short term mappings", this mapping will exist for quite a >+> while. > >In mapping kernel memory into user's address space I am interested as well >for GEOM Gate and other evil projects. The way we accomplished this in some other operating system was to create a shared memory segment with an implementation-reserved name, and then have the application shm_open the name and mmap it in. Shouldn't be hard with a device driver. -- Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" Internet: steve @ Watt.COM Whois: SW32 Free time? There's no such thing. It just comes in varying prices...