From owner-freebsd-questions Tue Sep 4 2:56: 1 2001 Delivered-To: freebsd-questions@freebsd.org Received: from screech.weirdnoise.com (209-128-78-198.bayarea.net [209.128.78.198]) by hub.freebsd.org (Postfix) with ESMTP id D690837B408 for ; Tue, 4 Sep 2001 02:55:56 -0700 (PDT) Received: from screech.weirdnoise.com (localhost [127.0.0.1]) by screech.weirdnoise.com (8.11.4/8.9.3) with ESMTP id f84A0nv55943; Tue, 4 Sep 2001 03:00:50 -0700 (PDT) Message-Id: <200109041000.f84A0nv55943@screech.weirdnoise.com> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Manas Cc: freebsd-questions@FreeBSD.ORG Subject: Re: how to write device driver In-Reply-To: Your message of "Tue, 04 Sep 2001 01:54:57 PDT." <20010904085457.64565.qmail@web10705.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 04 Sep 2001 03:00:49 -0700 From: Ed Hall Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Manas wrote: : hi all, : I upgraded my box from 4.0 to 4.3-stable but my sound : card is still not getting recognised. So i thought why : not write my own device driver. It might be a better idea to at least ask about support for your sound card. You might just be having a configuration problem. Someone may be working on a driver for it. And so forth. : Since i am totally : novice in this area, i searched some places. I found : in the ports collections (/usr/ports/share/examples) : some shell scripts which generate some skeleton driver : structures. : My questions is how should i proceed :) (sounds : cliched but i can't help it). Find the existing sound card driver closest to what you need -- you'll need full documentation for your sound card and a good idea of what other cards have a similar architecture. Then look in /usr/src/sys/dev/sound for a similar driver. Study the driver it until you understand it, using the examples you've found and the man pages to help answer questions. If you're completely stumped on a specific question you can try asking here, but don't expect a step-by-step description; the steps you need to take are going to be unique to your card. Once you have a good idea of what is needed, start hacking away, starting with recognition and initialization of your card, then signal routing/mixing (you only need to start with a canned configuration to get I/O going, then come back and finish), then try to get some sound out (usually easier than getting sound in), then finish up what's left. Or take the path that seems most suitable to you. Learn "ddb" -- you'll be needing it as well as a lot of patience in figuring out why your box just locked up without a peep. Driver programming has few of the comforts of applications programming. : thanks : -manas : ps : please don't say that give your device : information and someone in the freebsd group will : write it. I want to write it on my own:) It's not likely that someone will offer to write it anyway unless there is a more general need for supporting the card. But you could have been more forthcoming as to the details of your card -- you'd probably have wound up with better advice. -Ed To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message