From owner-freebsd-drivers@FreeBSD.ORG Fri Aug 18 00:47:00 2006 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FBFC16A4DA; Fri, 18 Aug 2006 00:47:00 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2DF243D49; Fri, 18 Aug 2006 00:46:58 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Fri, 18 Aug 2006 08:46:57 +0800 id 00102DF1.44E50E01.0001841C References: <6a56d69c0608162129h9e3e085i4ad1f4034833724f@mail.gmail.com> <6a56d69c0608171030o4c37ec37k54de2b99b5071c72@mail.gmail.com> In-Reply-To: <6a56d69c0608171030o4c37ec37k54de2b99b5071c72@mail.gmail.com> From: "Intron is my alias on the Internet" To: "Jonathan Herriott" Date: Fri, 18 Aug 2006 08:46:57 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-drivers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Newbie Question to Device driver writing 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: Fri, 18 Aug 2006 00:47:00 -0000 Jonathan Herriott wrote: > Intron- > > Unfortunately, I have nothing specific in mind as all my hardware > works on FreeBSD. I've almost come to the point where I'm going to go > to Fry's and buy a bunch of stuff and make a simple USB device which > may turn on or off a light (actually hook it up to a light in my home) > just to get some experience with writing drivers. > > Overall, I'd really love to do an opengl driver for a graphics card, > but I figured before I get into something that complex, I might try > something simpler. Any suggestion would be great. > > I'll look into -hackers@ as I would really like to learn the actual > internals of FreeBSD. > > Jon > If you want to know how to write a simple USB driver, you may have a look at /usr/src/sys/dev/usb/uscanner.c and /usr/src/sys/dev/usb/ulpt.c. They are both almost as simple as transfering data between hardware device and userland application. To write a graphics card driver that well supports OpenGL is difficult: 1. Current GPUs produced by NVIDIA or ATI (AMD) are complicated. 2. Some vendors wouldn't publicize programming data sheets of GPUs. You may have a look at http://dri.freedesktop.org/. Some days ago, I would create a C++ driver fundamental structure for FreeBSD, but discussants on -hackers@ threw doubts upon me. These days, I think, if FreeBSD can make use of drivers for Microsoft Windows, FreeBSD will become more powerful. Now FreeBSD and Linux both can use network card driver for Windows, with ndis(4) for FreeBSD and NDISWrapper for Linux (http://ndiswrapper.sf.net). But NDIS driver is one of the simplest drivers in WDM. The idea of WDM (Windows Device Model) simulator is quite challenging. But once WDMulator is realized, it will help FreeBSD deeply. ------------------------------------------------------------------------ From Beijing, China