From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 23 01:30:55 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 C36D81065670 for ; Tue, 23 Dec 2008 01:30:55 +0000 (UTC) (envelope-from assaulter0x80@gmail.com) Received: from mail-bw0-f19.google.com (mail-bw0-f19.google.com [209.85.218.19]) by mx1.freebsd.org (Postfix) with ESMTP id 3A6B78FC42 for ; Tue, 23 Dec 2008 01:30:55 +0000 (UTC) (envelope-from assaulter0x80@gmail.com) Received: by bwz12 with SMTP id 12so6573792bwz.19 for ; Mon, 22 Dec 2008 17:30:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=wpx895KIwxsFLZAFuOD7kxKz+ZH2TP3Lu6CdLRcOwW0=; b=rNNT1WmeaDm5V794uki+4EFlziXsEms2o3Ii1A7dwu1gOkirYT536FQR/EEkDA0ieU 0RZ9J1MRkLHffoXf0AZKF8hlJcl7lFRUTik0dVB+EbOEN2DpUlaU0dv5oPlKGS5/wvag iepQn+uwYvAY7jrQUalQi4lsfJ4ZDA0P+4ofI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=pGn+GxAYRNW0NO6y1LOIkOXufetZxsURAe1eKpGvb7dNkr5FjiYSt9FeLmnG9AS09/ WtvLc3Znj2X9TJd35/SYfIwJJN6s/N3m1Biffjq+8fcZY2qABi7hpOHnIRpbceYun7rb DWbxZc7yfpybO8FaI8QkbDF3N4kT8NCIRMOqM= Received: by 10.103.221.5 with SMTP id y5mr2552191muq.66.1229995851578; Mon, 22 Dec 2008 17:30:51 -0800 (PST) Received: by 10.103.177.9 with HTTP; Mon, 22 Dec 2008 17:30:51 -0800 (PST) Message-ID: Date: Tue, 23 Dec 2008 01:30:51 +0000 From: "Jacky Oh" To: freebsd-hackers@freebsd.org In-Reply-To: MIME-Version: 1.0 References: <20081223000534.f740ca8a@mail01.compvia.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Fwd: 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 01:30:56 -0000 hi Gerry.. you may be interested in the following functions: int copyin(const void *uaddr, void *kaddr, size_t len); int copyout(const void *kaddr, void *uaddr, size_t len); int copyinstr(const void *uaddr, void *kaddr, size_t len, size_t *done); int bcopy(const void *src, const void *dst, len); this functions are using for syscalls related work, among other things..lucky!! Jacky Ohwers 2008/12/23 Gerry Weaver Hello All, > > I am working on a driver that collects various network statistics via pfil. > I have a simple array of structures that I use to store the statistics. I > also have a user space process that needs to collect these statistics 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 direct access to > my kernel array from user space? The user process would only 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 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >