From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 10 20:36:57 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 AEF6C16A41F for ; Wed, 10 Aug 2005 20:36:57 +0000 (GMT) (envelope-from vladgalu@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 469A543D48 for ; Wed, 10 Aug 2005 20:36:57 +0000 (GMT) (envelope-from vladgalu@gmail.com) Received: by zproxy.gmail.com with SMTP id z6so137950nzd for ; Wed, 10 Aug 2005 13:36:56 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=e3/G8/47F1SJiYJx03GhOfQvwZpkLDrzv/h3rbPQHSYYiKR2/IViS+7ENFhS9mKV/8VOqhC1PgSY08Voa7xUdI6ogqDuHRJD6aNmnrQ2b+D+IcUREnc+IqjsEPWKg6S1sUc9TGP9v6rXYIO0AZyhs8FdlKUVO5U7AKKDFTos7TM= Received: by 10.36.221.9 with SMTP id t9mr759753nzg; Wed, 10 Aug 2005 13:36:56 -0700 (PDT) Received: by 10.36.86.4 with HTTP; Wed, 10 Aug 2005 13:36:56 -0700 (PDT) Message-ID: <79722fad050810133651d0bc25@mail.gmail.com> Date: Wed, 10 Aug 2005 23:36:56 +0300 From: Vlad GALU To: Sergey Uvarov In-Reply-To: <42FA63A3.4040802@mail.pnpi.spb.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <42FA63A3.4040802@mail.pnpi.spb.ru> Cc: freebsd-hackers@freebsd.org 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:36:57 -0000 On 8/10/05, Sergey Uvarov wrote: > Hello hackers, >=20 > I'm writing a kernel module for my own needs. AFAIK the following > methods could be used: >=20 > 1) allocate not used system call with help of SYSCALL_MODULE macro >=20 1 syscall > 2) allocate proprieatry oid via SYSCTL_OID(OID_AUTO) and write an > appropriate sysctl handler(s) > 1 syscall + some work on the handler, but less flexibility. You can't pass much information as an OID value. =20 > 3) add a file in /dev and use ioctl(2) call >=20 at least 2 syscalls (open()/ioctl()). The flexibility would be the same as 1), since you would also probably pass info packed in a structure that is the argument for the ioctl(). But you'd have to do slightly more work involving the /dev entry. > What is a preferable way to control my module? >=20 =20 I would go for 1. But then again, I might be wrong. Better wait to hear more suggestions before choosing a design. > Thanks in advance, > Sergey. > _______________________________________________ > 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= " >=20 --=20 If it's there, and you can see it, it's real. If it's not there, and you can see it, it's virtual. If it's there, and you can't see it, it's transparent. If it's not there, and you can't see it, you erased it.