Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Dec 2008 01:20:37 +0000
From:      "Jacky Oh" <assaulter0x80@gmail.com>
To:        "Gerry Weaver" <gerryw@compvia.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: How to access kernel memory from user space
Message-ID:  <ed8027db0812221720u4e9398f0i1b7a829c9acc9249@mail.gmail.com>
In-Reply-To: <20081223000534.f740ca8a@mail01.compvia.com>
References:  <20081223000534.f740ca8a@mail01.compvia.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <gerryw@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 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"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ed8027db0812221720u4e9398f0i1b7a829c9acc9249>