Subject: first try on device driver - I got lost
To: None <tech-kern@netbsd.org>
From: Richard =?iso-8859-1?q?K=E4stner?= <richard.kaestner@kabsi.at>
List: tech-kern
Date: 12/26/2006 21:59:01
=46rom Docu:
http://www.netbsd.org/Documentation/kernel/pseudo/
should (I thought) be a first try path into device drivers ...
Kernel Config file 'RFK_01':
=2E..
# rfk: skeleton pseudo-device
pseudo-device skel
=2D--
files.rfk_01=20
=2E..
defpseudo skel
file arch/evbarm/evbarm/skel.c skel needs-flag
=2D--
found about this in mailinglist (~2003)
/usr/src/sys/arch/arm/conf/majors.arm32:=20
# 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
=2D--
Result:
# 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=
=3D"0" -DDIAGNOSTIC -DMAXUSERS=3D32 -D_KERNEL -D_KERNEL_OPT -I/usr/DATA/Net=
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=
/NetBSD/evbarm/SRC/sys/lib/libkern/../../../common/lib/libc/arch/arm/string=
-c=20
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
=2D--
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!
=2D-=20
Richard Kaestner
richard.kaestner@ycn.com
richard.kaestner@kabsi.at