From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 23 01:45:52 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 B0EB41065670 for ; Tue, 23 Dec 2008 01:45:52 +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 2C3268FC1D for ; Tue, 23 Dec 2008 01:45:51 +0000 (UTC) (envelope-from assaulter0x80@gmail.com) Received: by bwz12 with SMTP id 12so6583224bwz.19 for ; Mon, 22 Dec 2008 17:45: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:cc:in-reply-to:mime-version:content-type:references; bh=zOHOc+/+e3u+fWk+KCvUJ/OIT6qQiyej80saZcOkAu8=; b=ho8sbLCybHFhsC3M8D1Tv6utw5dLRi3uxzOooNoRMuw49D2dRk1MSAHRV8aAFF9+aW H8Tz1lwLCZ68FWkI6GpzDh8qYBSKU0jYEpLXJvc+/cGNpOE222fEUqW/MGop9IgsxeUA MRaQuF7mqGfWxvp26MmeeHdGPTJ/7H7zm55Ds= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=HfKm5imnCxbpTkfs8hiMFhwO0GHfClGSzRFxxEc0bKim3V6z3HkkGh78kNcJCCQhFt 48VA8NjeKFdJNLxQrB5fhK1pbO9XutQIbnhqdDduMZI2+Ry6kxCyxsOhxFe0QPAIg+tu QGUwsJBO4fkBdFpmBU7LwKyf9jaw9nHO0P/T4= Received: by 10.103.172.9 with SMTP id z9mr2542243muo.109.1229995237345; Mon, 22 Dec 2008 17:20:37 -0800 (PST) Received: by 10.103.177.9 with HTTP; Mon, 22 Dec 2008 17:20:37 -0800 (PST) Message-ID: Date: Tue, 23 Dec 2008 01:20:37 +0000 From: "Jacky Oh" To: "Gerry Weaver" In-Reply-To: <20081223000534.f740ca8a@mail01.compvia.com> 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 Cc: freebsd-hackers@freebsd.org Subject: Re: 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:45:52 -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" >