From owner-freebsd-hackers Sun Jan 23 14:53:56 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail-ob.kamp.net (mail-ob.kamp.net [195.62.97.26]) by hub.freebsd.org (Postfix) with ESMTP id E263514F86 for ; Sun, 23 Jan 2000 14:53:47 -0800 (PST) (envelope-from Joachim.Jaeckel@d.kamp.net) Received: from d.kamp.net (port-25.d.kamp.de [195.62.120.217]) by mail-ob.kamp.net (8.9.3/8.9.3) with ESMTP id XAA03855; Sun, 23 Jan 2000 23:53:41 +0100 Message-ID: <388B8724.D3B9707C@d.kamp.net> Date: Sun, 23 Jan 2000 23:56:36 +0100 From: "Joachim Jäckel" X-Mailer: Mozilla 4.07 [en] (X11; I; FreeBSD 3.3-19991111-STABLE i386) MIME-Version: 1.0 To: asmodai@wxs.nl, nox@jelal.kn-bremen.de, "freebsd-hackers@freebsd.org" Subject: Re: How to write a device-driver? Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello again, thanks for your answers, last week, I was really busy to work, gather information for the card, inspect the existing drivers and so on... Here´s some information to the card I'd like to support: It's a Miro DC10+ Video Grabber Card for Non-Linear Video-Editing. It uses a Siemens SAA7110, a Zoran 36060+36067 and a ADV???? chip to en- and decode the video-information. I got the specifications for the chips from Siemens and Zoran's Web-Sites and a first driver-skeleton was generated through the /usr/share/examples/drivers/make_pci... script for me. Currently I get a boot-message from my kernel, that he has found the card.(I read the pci_id and send a text-message :-) Additionally I found a linux-driver for this card (an early one...) but it is not fully compatible with the documentation, I got. The chip-documentation is a little bit hard to read for someone who is used to program commercial-applications. (and another thing at the moment is to understand, what is needed in the driver to communicate with these chips...) But I'm working on it... (I think that I could get it running one day...) Currently I'm reading the sources of the bktr- and meteor-device to examine the equals etc. Maybe you would allow me one question? (To get a little faster to the information than browsing through the source.) The card uses several registers in the "front-end" chip, the zoran 36067, which are described in the documentation. I found the pci_map_mem function, where I've to pass a virtual and a base address to the function which are usually defined in the softc structure. My softc structure should therefore look something like this: typedef struct mdcten_softc { struct zoran36067_regs *base; vm_offset_t phys_base; ... and the zoran36067_regs like: struct zoran36067_regs { u_int rega; u_int regb; etc. But how get's the zoran36067_regs structure the information from the chip? If I change the content of the structure, which function would change the registers on the chip accordingly? (Or is it done through the call of pci_map_mem? And is everything I change to the structure automatically changed on the card?) It would be nice if you would answer my question, to make it a little bit easier for me. Sorry, if these questions are real dumb ones! Thanks in advance. -- Joachim.Jaeckel@d.kamp.net -- http://home.kamp.net/home/joachim.jaeckel To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message