Re: How to access kernel memory from user space

2012-02-23 Thread John Baldwin
On Wednesday, February 22, 2012 8:06:20 pm Ryan Stone wrote: On Wed, Feb 22, 2012 at 2:15 PM, Ian Lepore free...@damnhippie.dyndns.org wrote: I've never done this, but if I needed to, I think the first thing I'd try is to use an mmap(2) of /dev/kmem to map the memory you need into

How to access kernel memory from user space

2012-02-22 Thread Svetlin Manavski
Hi all, I have a very similar problem as described in this thread back in 2009: http://lists.freebsd.org/pipermail/freebsd-hackers/2009-January/027367.html I have a kernel module producing networking stats which I need to frequently read from the user space. A copy of the data structure would be

Re: How to access kernel memory from user space

2012-02-22 Thread Ian Lepore
On Wed, 2012-02-22 at 17:24 +, Svetlin Manavski wrote: Hi all, I have a very similar problem as described in this thread back in 2009: http://lists.freebsd.org/pipermail/freebsd-hackers/2009-January/027367.html I have a kernel module producing networking stats which I need to

Re: How to access kernel memory from user space

2012-02-22 Thread Ryan Stone
On Wed, Feb 22, 2012 at 2:15 PM, Ian Lepore free...@damnhippie.dyndns.org wrote: I've never done this, but if I needed to, I think the first thing I'd try is to use an mmap(2) of /dev/kmem to map the memory you need into userspace (of course your userspace app will need to be running with root

Re: How to access kernel memory from user space

2009-01-16 Thread Alexej Sokolov
On Thu, Jan 15, 2009 at 01:22:18PM -0600, Gerry Weaver wrote: _ From: Alexej Sokolov [mailto:bsd.qu...@googlemail.com] To: Gerry Weaver [mailto:ger...@compvia.com] Cc: freebsd-hackers@freebsd.org Sent: Thu, 15 Jan 2009 12:31:00 -0600 Subject: Re: How to access kernel memory from user

Re: How to access kernel memory from user space

2009-01-15 Thread Alexej Sokolov
2008/12/23 Gerry Weaver ger...@compvia.com 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

Re: How to access kernel memory from user space

2009-01-15 Thread Gerry Weaver
_ From: Alexej Sokolov [mailto:bsd.qu...@googlemail.com] To: Gerry Weaver [mailto:ger...@compvia.com] Cc: freebsd-hackers@freebsd.org Sent: Thu, 15 Jan 2009 12:31:00 -0600 Subject: Re: How to access kernel memory from user space 2008/12/23 Gerry Weaver ger...@compvia.com Hello All

Re: How to access kernel memory from user space

2008-12-24 Thread Peter Jeremy
On 2008-Dec-22 18:05:34 -0600, Gerry Weaver ger...@compvia.com wrote: 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

Re: How to access kernel memory from user space

2008-12-24 Thread Gerry Weaver
_ From: Peter Jeremy [mailto:peterjer...@optushome.com.au] To: Gerry Weaver [mailto:ger...@compvia.com] Cc: freebsd-hackers@freebsd.org Sent: Wed, 24 Dec 2008 02:44:45 -0600 Subject: Re: How to access kernel memory from user space On 2008-Dec-22 18:05:34 -0600, Gerry Weaver ger

Re: How to access kernel memory from user space

2008-12-23 Thread Roman Divacky
On Mon, Dec 22, 2008 at 06:05:34PM -0600, Gerry Weaver wrote: 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

How to access kernel memory from user space

2008-12-22 Thread 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

Fwd: How to access kernel memory from user space

2008-12-22 Thread Jacky Oh
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);

Re: How to access kernel memory from user space

2008-12-22 Thread Jacky Oh
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,