From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 19 14:38:37 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 7441816A4CE for ; Mon, 19 Jan 2004 14:38:37 -0800 (PST) Received: from pythagoras.math.uwaterloo.ca (pythagoras.math.uwaterloo.ca [129.97.140.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D36043D5D for ; Mon, 19 Jan 2004 14:38:29 -0800 (PST) (envelope-from anand@pythagoras.math.uwaterloo.ca) Received: from localhost (anand@localhost)i0JMcSn02770 for ; Mon, 19 Jan 2004 17:38:28 -0500 (EST) Date: Mon, 19 Jan 2004 17:38:28 -0500 (EST) From: Anand Subramanian To: freebsd-hackers@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Mailman-Approved-At: Tue, 20 Jan 2004 05:22:50 -0800 Subject: mmap() on pseudo device 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: Mon, 19 Jan 2004 22:38:37 -0000 Hi, I am trying to share some memory between a networking daemon and the FreeBSD 5.1 kernel. I am trying to implement the shared memory using a pseudo-device via the make_dev() call. "mknod" at the command line prompt no longer seems to work(no longer supported because of the devfs interface? - it would be great if anyone could confirm this). My questions : 1. I'm creating a pseudo device and having a user space process mmap() the device memory into its address space. So the mmap for the device has to be implemented. Are there any useful driver/source files I could look at for this? 2. How can I access the mmaped memory from another kernel loadable module? 3. For the user space program, after it does a mmap() on the pseudo-device, is there any way it can force malloc() to operate on the mmaped memory? Or am I forced to write my own lightweight memory manager? Most of the memory managers around seem to be way too complicated to quickly fix or customize for a simple need. TIA, Anand