Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 May 2010 09:59:46 +0200 (CEST)
From:      "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" <czerner.lukas@gmail.com>
To:        Ivan Voras <ivoras@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: How to get data from kernel module ?
Message-ID:  <alpine.DEB.1.10.1005070958580.21095@a04-0215a.kn.vutbr.cz>
In-Reply-To: <hrv0pd$iqd$1@dough.gmane.org>
References:  <alpine.DEB.1.10.1005061528380.21095@a04-0215a.kn.vutbr.cz> <hrv0pd$iqd$1@dough.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-791890826-1273219188=:21095
Content-Type: TEXT/PLAIN; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Thu, 6 May 2010, Ivan Voras wrote:

> Date: Thu, 06 May 2010 20:12:07 +0200
> From: Ivan Voras <ivoras@freebsd.org>
> To: freebsd-hackers@freebsd.org
> Subject: Re: How to get data from kernel module ?
> 
> On 05/06/10 15:38, Lukáš Czerner wrote:
> > Hi,
> > 
> > I am creating a kernel module and I need to get some information from
> > that module. I can do this with ioctl and pass the data to the
> > user space but it seems a bit unpractical to me, because I do not know
> > the amount of the data - it can differ. I do not know of any way to
> > pass a list of structures to the userspace through ioctl - is there
> > any?
> > 
> > So my question is, is there any standard way in FreeBSD to do this ?
> > In linux I would probably use the sysfs, but in FreeBSD I can not find
> > anything similar, except just creating some virtual filesystem on my
> > own and obviously this is not what I want to do.
> 
> As others said, sysctl is one way to go, but might not be very convenient if
> the amount of data is large. I'd rather setup a device and a simple protocol
> to read/write to/from it.
> 
> http://www.freebsd.org/doc/en/books/arch-handbook/driverbasics-char.html
> 
> (you want the 5+ version)
> 

That seems even better. Thank you very much!

-Lukas.
--8323329-791890826-1273219188=:21095--



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