From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 12 17:05:53 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 3AD0C16A422 for ; Wed, 12 Oct 2005 17:05:53 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A96043D48 for ; Wed, 12 Oct 2005 17:05:52 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.14] (imini.samsco.home [192.168.254.14]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id j9CH5oOn059948; Wed, 12 Oct 2005 11:05:50 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <434D426E.7010808@samsco.org> Date: Wed, 12 Oct 2005 11:05:50 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.7) Gecko/20050416 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sangwoo Shim References: <434BECA0.9050501@gmail.com> <434D0A73.2010509@samsco.org> <4cbd01f40510120938j3117ae6ap@mail.gmail.com> In-Reply-To: <4cbd01f40510120938j3117ae6ap@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org Cc: freebsd-hackers@freebsd.org, Pete Subject: Re: Driver Development Books? 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, 12 Oct 2005 17:05:53 -0000 Sangwoo Shim wrote: > 2005/10/12, Scott Long : > >>Pete wrote: >> >>>Hello, >>> I have what may seem to be a silly question, but I cannot find any >>>other decent resources on the web. >.< The problem that I am having >>>right now is >>>that I have a fairly nice graphics card which, for the moment is only >>>supported on Windows Operating systems, and old 2.4 Linux kernels. So >>>far there has >>>not been much positive outlook in porting the drivers to *BSD or any of >>>the 2.6 kernels that I know of, let alone 64-bit drivers for non-Win OSes. >>> >>>So I guess that makes my question fairly simple then; I know that driver >>>code is written in C (which I am learning currently) but thats about all >>>I know. I'm probably >>>not far off when I say that I need more to go on. Yet, from looking at >>>Amazon.com I have not been able to find any books on writing driver >>>code, which is really >>>frustrating. >>> >>>One of my security related books, Rootkits, tells me about how to write >>>drivers for a completely different reason so I know a bit more about how >>>they work but again >>>the code involved does not interface hardware to the OS, just injects a >>>custom application. The other tool that I will probably use is Jungo, >>>which is a nice-looking >>>application which automates a skeletal version of the driver you need, >>>but again, I would not know how to fill it out. >>> >>>Any help is appreciated. >>> >>>-Pete >>> >> >>There are indeed no books that I know of on the subject of writing >>drivers for any *BSD, let alone FreeBSD. > > [snip] > > > For me, following book was quite helpful: > Embedded FreeBSD cookbook, by Paul Cevoli > ISBN: 1589950046 > > It tells about basic kernel data structure for driver writing. One of > the best aspect of this book is that it shows you real code for real > device (a simple PCI device). Moreover, it was quite easy to read. > Although it focuses on FreeBSD 4.X. For those who want some > _introduction_ for the FreeBSD driver > writing, I would like to recommend this. > > Regard, > Sangwoo Shim Ah, didn't know about that book. Yes, that sounds like a good foundation, though some aspects of drivers in 5.x and beyond are vastly different than in 4.x and prior, particularly concerning synchronization and interrupt behaviour. The next step is to talk about the different driver APIs and infrastructure, as well as debugging guides. Scott