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 > 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 user

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 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 privs to do this). > > Th

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 > fr

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

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

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 Hello All, I am working on

Re: How to access kernel memory from user space

2009-01-15 Thread Alexej Sokolov
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 ope

Re: How to access kernel memory from user space

2008-12-27 Thread Peter Jeremy
On 2008-Dec-24 15:22:07 -0600, Gerry Weaver wrote: >to keep it minimal. Is there any significant trade off in performance >between the two approaches? No. In both cases, the actual access is managed through the normal hardware translation the same as any other data. About the only difference is

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 wrote: >I

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 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 second or so. Th

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 stat

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, len);

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);

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 w