Date: Wed, 12 Dec 2001 14:54:26 -0800 (PST) From: Julian Elischer <julian@elischer.org> To: "Chuck T." <freebsdfan@hotmail.com> Cc: freebsd-small@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: help with loadable module & PicoBSD Message-ID: <Pine.BSF.4.21.0112121453240.5654-100000@InterJet.elischer.org> In-Reply-To: <F20wWkVNqXSvUkBAB7p00001664@hotmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0112121453240.5654-100000>