From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 10 20:57:38 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 7FFBA16A421 for ; Wed, 10 Aug 2005 20:57:38 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5A0E43D45 for ; Wed, 10 Aug 2005 20:57:37 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.40.201] (Not Verified[65.202.103.25]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Wed, 10 Aug 2005 17:12:26 -0400 From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 10 Aug 2005 16:40:27 -0400 User-Agent: KMail/1.8 References: <42FA63A3.4040802@mail.pnpi.spb.ru> In-Reply-To: <42FA63A3.4040802@mail.pnpi.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508101640.28555.jhb@FreeBSD.org> Cc: Sergey Uvarov 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 20:57:38 -0000 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. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org