From owner-freebsd-small Wed Dec 12 15: 0:26 2001 Delivered-To: freebsd-small@freebsd.org Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by hub.freebsd.org (Postfix) with ESMTP id 920F937B419; Wed, 12 Dec 2001 15:00:17 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20011212230017.KKCK5010.rwcrmhc51.attbi.com@InterJet.elischer.org>; Wed, 12 Dec 2001 23:00:17 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA11856; Wed, 12 Dec 2001 14:54:27 -0800 (PST) Date: Wed, 12 Dec 2001 14:54:26 -0800 (PST) From: Julian Elischer To: "Chuck T." Cc: freebsd-small@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: help with loadable module & PicoBSD In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-small@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG also look at (in current only!) /usr/share/examples/drivers/make_device_driver.sh is makes a driver with ISA, and PCI-based interfaces. On Wed, 12 Dec 2001, Chuck T. wrote: > I'm trying to write an ISA device driver from scratch and I'm also trying to > make it a kernel loadable to make my debugging life easier. I started with > /usr/share/examples/kld/cdev and have modified it by adding the following: > > static int > xxx_isa_probe(device_t dev) > { > int ret = ENXIO; > > device_printf(dev,"xxx_isa_probe() called.\n"); > > if(device_get_unit(dev) == 0) { > ret = 0; > } > return ret; > } > > static int > xxx_isa_attach(device_t dev) > { > device_printf(dev,"xxx_isa_attach() called.\n"); > return 0; > } > > static int > xxx_isa_detach(device_t dev) > { > device_printf(dev,"xxx_isa_detach() called.\n"); > return 0; > } > > static struct isa_pnp_id xxx_ids[] = { > { 0, NULL } > }; > > static device_method_t xxx_isa_methods[] = { > /* Device interface */ > DEVMETHOD(device_probe, xxx_isa_probe), > DEVMETHOD(device_attach, xxx_isa_attach), > DEVMETHOD(device_detach, xxx_isa_detach), > > { 0, 0 } > }; > > static driver_t xxx_isa_driver = { > driver_name, > xxx_isa_methods, > 0 > }; > > static devclass_t xxx_devclass; > > /* Declare the module to the system */ > DRIVER_MODULE(xxx, isa, xxx_isa_driver, xxx_devclass, cdev_load, 0); > > When I load the skeletion on my development machine (FreeBSD 4.4) both > cdev_load() and xxx_isa_probe() are called as expected. However when I load > the same binary on my PicoBSD target it only cdev_load() is called, *NOT* > xxx_isa_probe(). My PicoBSD is built from the same sources as my > development machine and both are FreeBSD 4.4-release. Both include the isa > bus in their configuration files. I'm sure I'm doing something wrong as I > have been able to load stock Ethernet driver kernel modules on Pico before. > > Any suggestions ? I'm lost. I tried removing the stripping step in the > PicoBSD build thinking that was on obvious difference between a Pico build > and a full build, but that didn't help. > > _________________________________________________________________ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-small" in the body of the message