Subject: Re: first try on device driver - I got lost
To: None <>
From: Bucky Katz <>
List: tech-kern
Date: 12/26/2006 15:38:38
Richard K=E4stner <> writes:
> vers.c
> #      link  RFK_01/netbsd
> /usr/DATA/NetBSD/evbarm/TOOL/bin/arm--netbsdelf-ld -Map --cref=
> ldscript -X -o netbsd ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
> devsw.o:(.data+0x4ec): undefined reference to `skel_cdevsw'
> *** Failed target:  netbsd
> ---
> Attempts to add `skel_cdevsw' (copying from other sources) led me to ...=
> desert, just deep into desert, I am lost !!!

Take a look at which
is a slightly out of date driver writer guide.

Your immediate problem is that you need to declare your cdevsw entry
in your driver with something like=20

const struct cdevsw skel_cdevsw =3D {
        skelopen, skelclose, skelread, skelwrite, skelioctl,
        nostop, notty, nopoll, nommap, nokqfilter, D_DISK

*and* you need a CFATTACH_DECL entry as well, which might look like

CFATTACH_DECL(skel, sizeof(struct skel_softc),
    skel_match, skel_attach, NULL, NULL);

all of this is explained in the guide.