From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 23 00:35:38 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE2A61065670 for ; Tue, 23 Dec 2008 00:35:38 +0000 (UTC) (envelope-from gerryw@compvia.com) Received: from mail01.compvia.com (mail01.compvia.com [12.147.132.91]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1B88FC17 for ; Tue, 23 Dec 2008 00:35:38 +0000 (UTC) (envelope-from gerryw@compvia.com) Received: from [10.10.20.11] ([10.10.20.11]) by mail01.compvia.com (Kerio MailServer 6.5.1) for freebsd-hackers@freebsd.org; Mon, 22 Dec 2008 18:05:34 -0600 To: freebsd-hackers@freebsd.org From: "Gerry Weaver" Message-ID: <20081223000534.f740ca8a@mail01.compvia.com> Date: Mon, 22 Dec 2008 18:05:34 -0600 X-Mailer: Kerio MailServer 6.5.1 WebMail X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b1) Gecko/20081007 Firefox/3.1b1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: How to access kernel memory from user space 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: Tue, 23 Dec 2008 00:35:38 -0000 Hello All, I am working on a driver that collects various network statistics via pf= il. I have a simple array of structures that I use to store the statisti= cs. I also have a user space process that needs to collect these statist= ics every second or so. A copy operation from kernel to user space would= be too expensive. Is there a mechanism that would allow me to gain dire= ct access to my kernel array from user space=3F The user process would o= nly need read access. It seems like maybe this could be done with mmap, = but since this is not a character driver, there is no device file etc.. = I'm a newbie, so I apologize if this is something that should be obvious= . Thanks in advance, Gerry