From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 10 21:08:03 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D91D316A41F for ; Wed, 10 Aug 2005 21:08:03 +0000 (GMT) (envelope-from uvarovsl@mail.pnpi.spb.ru) Received: from mail.lsi.ru (mail.lsi.ru [212.58.192.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 741E243D45 for ; Wed, 10 Aug 2005 21:08:03 +0000 (GMT) (envelope-from uvarovsl@mail.pnpi.spb.ru) Received: by mail.lsi.ru (Postfix, from userid 426) id AD917386E24; Thu, 11 Aug 2005 01:08:02 +0400 (MSD) Received: from [10.0.0.3] (unknown [212.58.210.222]) by mail.lsi.ru (Postfix) with ESMTP id 65E7B386E1A for ; Thu, 11 Aug 2005 01:08:01 +0400 (MSD) Message-ID: <42FA6D78.4020306@mail.pnpi.spb.ru> Date: Thu, 11 Aug 2005 01:11:20 +0400 From: Sergey Uvarov User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <42FA63A3.4040802@mail.pnpi.spb.ru> <200508101640.28555.jhb@FreeBSD.org> In-Reply-To: <200508101640.28555.jhb@FreeBSD.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: preferable way to control 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: Wed, 10 Aug 2005 21:08:04 -0000 John Baldwin wrote: > On Wednesday 10 August 2005 04:29 pm, Sergey Uvarov wrote: > >>Hello hackers, >> >>I'm writing a kernel module for my own needs. AFAIK the following >>methods could be used: >> >>1) allocate not used system call with help of SYSCALL_MODULE macro >> >>2) allocate proprieatry oid via SYSCTL_OID(OID_AUTO) and write an >>appropriate sysctl handler(s) >> >>3) add a file in /dev and use ioctl(2) call >> >>What is a preferable way to control my module? > > > It depends on what you want to do really. I've used sysctl's for simple debug > modules where I write to the sysctl to have it perform a desired action. I need to pass some configuration parameters to my module and retrieve a status back. Interface is quite similar to ptrace(2) syscall. I don't need to pass large amount of data. Thanks, Sergey.