From owner-freebsd-drivers@FreeBSD.ORG Sun Dec 16 19:06:15 2007 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC8B316A41A for ; Sun, 16 Dec 2007 19:06:15 +0000 (UTC) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by mx1.freebsd.org (Postfix) with ESMTP id 38B3D13C442 for ; Sun, 16 Dec 2007 19:06:14 +0000 (UTC) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by freebsd.czest.pl (8.13.4/8.12.9) with ESMTP id lBGJLTBb062300; Sun, 16 Dec 2007 19:21:30 GMT (envelope-from dunstan@freebsd.czest.pl) Received: (from dunstan@localhost) by freebsd.czest.pl (8.13.4/8.12.9/Submit) id lBGJLTSl062299; Sun, 16 Dec 2007 19:21:29 GMT (envelope-from dunstan) Date: Sun, 16 Dec 2007 19:21:29 +0000 From: "Wojciech A. Koszek" To: Sean Bruno Message-ID: <20071216192129.GA62171@FreeBSD.czest.pl> References: <47642003.3080202@miralink.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <47642003.3080202@miralink.com> User-Agent: Mutt/1.4.2.1i X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-2.0.2 (freebsd.czest.pl [80.48.250.4]); Sun, 16 Dec 2007 19:21:30 +0000 (UTC) Cc: freebsd-drivers@freebsd.org Subject: Re: FreeBSD Kernel "Newbies" X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2007 19:06:15 -0000 On Sat, Dec 15, 2007 at 10:42:11AM -0800, Sean Bruno wrote: > I noticed that the Linux folks have started up a "newbies" project > recently that allows mentoring and growth of new kernel programmers as > well as a conduit for manufacturers to get drivers written and bugs fixed. > http://kernelnewbies.org/ > > Is there any interest in starting up such an endeavor in the FreeBSD > community? I think I could spend ~10 hours a week on such a project, > but my kernel programming skills are mediocre at best. For me personally FreeBSD project was the best place to start for doing anything related with device drivers and kernel and low-level programming in general. Although I don't know if there's a place similar to what Linux hackers have, but freebsd-hackers@ and freebsd-drivers@ are good places to start. I think there is non-written agreement of what is considered to be useful across the kernel, and what seems to be a pretty standard toolset for all kernel developers. Those are: - ioctl() handler: You have very simple example in src/share/examples/kld. - sysctl handler: You have appropriate manual pages (SYSCTL_, sysctl). Within src/sys/kern/... directory there are number of files implementing static sysctls as well as handlers declared with SYSCTL_PROC(), which let you to have an easy way between kernel and user space for exchanging data - system call within your own file hooked to the kernel configuration: This task was pretty educational for me. It gives a sort of feeling of knowing, where to look in case something goes wrong with your future work (it involves a bit of knowledge of FreeBSD build infrastructure). Good places to look at: - src/sys/conf/... - src/sys/i386/conf/... (or whethever your computer architecture is) - src/sys/kern/... (geteuid() from src/sys/kern/kern_prot.c is good example). Remember about style(9). We could put results of experiments like that on the FreeBSD Wiki page if you're bored and could take some snapshots/source code examples for others. If you've done some (or all) of those already, you can look at FreeBSD page about proposed ideas and problems to solve: - http://www.freebsd.org/projects/ideas/ That's a pity we don't have freebsd-kernel@ to discuss only kernel-related ideas, where advanced kernel programmers could share with us some of their "tips & tricks". Hopefully, you also get some feedback from one of those as a follow-up. -- Wojciech A. Koszek wkoszek@FreeBSD.org http://FreeBSD.czest.pl/dunstan/