Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2001 11:15:26 -0800
From:      "Chuck T." <freebsdfan@hotmail.com>
To:        freebsd-small@freebsd.org, freebsd-hackers@freebsd.org
Subject:   help with loadable module & PicoBSD
Message-ID:  <F20wWkVNqXSvUkBAB7p00001664@hotmail.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F20wWkVNqXSvUkBAB7p00001664>