Subject: first try on device driver - I got lost
To: None <>
From: Richard =?iso-8859-1?q?K=E4stner?= <>
List: tech-kern
Date: 12/26/2006 21:59:01
=46rom Docu:
should (I thought) be a first try path into device drivers ...

Kernel Config file 'RFK_01':
# rfk: skeleton pseudo-device
pseudo-device  	skel

defpseudo skel
file	arch/evbarm/evbarm/skel.c skel	needs-flag

found about this in  mailinglist (~2003)
# from : sys/conf/majors
# Majors 0-143 are reserved for machine-dependent drivers and
# for traditional machine-specific MI driver major mapping.
# Majors 144-159 are reserved for local/vendor use.
# Majors 160-255 are used for the MI drivers.
device-major    skel		char 144		skel

#   compile  RFK_01/vers.o
/usr/DATA/NetBSD/evbarm/TOOL/bin/arm--netbsdelf-gcc  -ffreestanding -fno-ze=
ro-initialized-in-bss   -O2 -Werror -Wall -Wno-main -Wno-format-zero-length=
 -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wswitch -Wshadow=
 -Wcast-qual -Wwrite-strings -Wno-sign-compare -Wno-pointer-sign -Wno-attri=
butes  -fno-strict-aliasing    -I.  -I/usr/DATA/NetBSD/evbarm/SRC/sys/../co=
mmon/include -I/usr/DATA/NetBSD/evbarm/SRC/sys/arch  -I/usr/DATA/NetBSD/evb=
arm/SRC/sys -nostdinc -DMSGBUFSIZE=3D"65536" -DCONSPEED=3D"57600" -DCONUNIT=
BSD/evbarm/SRC/sys/lib/libkern/../../../common/lib/libc/quad -I/usr/DATA/Ne=
tBSD/evbarm/SRC/sys/lib/libkern/../../../common/lib/libc/string -I/usr/DATA=
#      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 ...=20
desert, just deep into desert, I am lost !!!

I got the impression (Mailinglist, sometime in 2003 changes in device=20
numbering, ...)

Could I please get a pointer to an 'entry level' driver / pseudo driver
where I have a chance to figure out, how things work
I thought, I understood how these things work - but nope!

Is there a way, to find out about device majors in a running system?

Thanks in advance!

Richard Kaestner