From owner-freebsd-hackers Tue Jan 9 2:31:43 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from tele-post-20.mail.demon.net (tele-post-20.mail.demon.net [194.217.242.20]) by hub.freebsd.org (Postfix) with ESMTP id A15FA37B400 for ; Tue, 9 Jan 2001 02:31:25 -0800 (PST) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by tele-post-20.mail.demon.net with esmtp (Exim 2.12 #2) id 14Fw3i-000KZm-0K; Tue, 9 Jan 2001 10:31:19 +0000 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.1/8.8.8) with ESMTP id f09AVHs22335; Tue, 9 Jan 2001 10:31:18 GMT (envelope-from dfr@nlsystems.com) Date: Tue, 9 Jan 2001 10:31:17 +0000 (GMT) From: Doug Rabson To: Vijo Cherian Cc: hackers@freebsd.org, mhsu@clickarray.com Subject: Re: kobj, makedevops.pl etc. In-Reply-To: <01010817314705.21412@b52.clickarray.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 8 Jan 2001, Vijo Cherian wrote: > hi, > > I have some questions... but most of them may be prerry lame because I am new > to FreeBSD. > > I am running 5.0 and I have a driver for a card which was written for 4.1. > The driver uses bus_if.h, device_if.h and pci_if.h and these files are generated > by makedevops.pl. The driver is written as a module and is loaded using kldload. > But loading fails because BUS_READ_IVAR and friends are not available. > Using makeobjops.pl works. My questions are > 1. Is this the right way? > 2. When did kobj find place in the kernel? (which release) > (that is what makeobjops.pl does,right?) > 3. If all that I did is wrong, what is the right way? > 4. Can you point me to a driver that can be loaded as kld? > > waiting to see how the community treats a new convert ;-) Unfortunately, the device driver ABIs (and many others) are different between 4.1 and 5.0-current so you cannot load a binary driver intended for 4.1 on a 5.0-current system. For newbus at least, the programming API is the same, although in 5.0 it uses kobj for its object model instead of the slightly less flexible system used in 4.x. You need to rebuild the driver, using makeobjops.pl instead of makedevops.pl. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message