Subject: Re: first try on device driver - I got lost
To: None <tech-kern@netbsd.org>
From: Bucky Katz <bucky@picovex.com>
List: tech-kern
Date: 12/26/2006 15:38:38
Richard K=E4stner <richard.kaestner@kabsi.at> writes:
>
> vers.c
> #      link  RFK_01/netbsd
> /usr/DATA/NetBSD/evbarm/TOOL/bin/arm--netbsdelf-ld -Map netbsd.map --cref=
 -T=20
> 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 ...=
=20
> desert, just deep into desert, I am lost !!!

Take a look at http://netbsd.org/Documentation/kernel/ddwg.html 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.