From owner-freebsd-hackers@FreeBSD.ORG Fri May 7 07:59:58 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43927106566B for ; Fri, 7 May 2010 07:59:58 +0000 (UTC) (envelope-from czerner.lukas@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C10198FC17 for ; Fri, 7 May 2010 07:59:57 +0000 (UTC) Received: by fxm15 with SMTP id 15so630987fxm.13 for ; Fri, 07 May 2010 00:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:in-reply-to:message-id:references:user-agent:mime-version :content-type; bh=qfI39jfwFWMGDa/BERdwwHoLqnpa5H7lCTvRkYuYvTI=; b=rJSQWASG0DVB7BdF+fB/5/Xs373ziO+GEiu2AclGUv3fUi/mqQ6ug3MRejzN2tL7eT KSGrXzLmXX43f+F2IF+yyTHyppkYG4jt2qW9Y3jvt1ucVNSzv2gKw2qnLwzGo0twZBjQ oen9CgKA3aHKmOigfPXZIWyOHPNjMYnr8aFIA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=JU6LsoNS25cf1l2v96EJ2NPvzo0kXO8DXo4OvQm9jVKNMpe7V4ehzfUr1gsdfhJNaZ IJQQwLjUeZ8r2dMc2JHvUjwJaYrCxMmBb9ZC72Us5XSfLIkx0S+0TR7l/b641bjr3eWL onoFFOTmolaEpRZgEkhV8L7GfkvUD/arlv5Fk= Received: by 10.223.100.141 with SMTP id y13mr1130679fan.15.1273219189251; Fri, 07 May 2010 00:59:49 -0700 (PDT) Received: from a04-0215a.kn.vutbr.cz (a04-0215a.kn.vutbr.cz [147.229.216.20]) by mx.google.com with ESMTPS id z10sm3604467fka.1.2010.05.07.00.59.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 07 May 2010 00:59:48 -0700 (PDT) Date: Fri, 7 May 2010 09:59:46 +0200 (CEST) From: "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" X-X-Sender: bratt@a04-0215a.kn.vutbr.cz To: Ivan Voras In-Reply-To: Message-ID: References: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-791890826-1273219188=:21095" Cc: freebsd-hackers@freebsd.org Subject: Re: How to get data from kernel module ? 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: Fri, 07 May 2010 07:59:58 -0000 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 > 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--