|
From: Rodger L. <rl...@ta...> - 2007-03-29 15:29:31
|
HI All: =20 I was experiencing this problem that others have reported in other flavours of Solaris through the years. It all comes down to how the driver is compiled on Solaris. =20 # /usr/sbin/add_drv -v tun exit status =3D 0 devfsadm: driver failed to attach: tun exit status =3D 1 Warning: Driver (tun) successfully added to system but failed to attach Driver (tun) installed. =20 Kudos to Avnish Pundir who posted (2006-09-19) his solution to a specific problem that he was having. =20 The details for doing this correctly using Sun Studio and GNU C 32 or 64 bit environments are nicely summarized on the Sun web site at: =20 http://docs.sun.com/app/docs/doc/819-3159/6n5d9rbv8?a=3Dview#fgouv =20 But to summarize the compiling and copying to the correct location .... =20 # Sun Studio targetting 64 bit SPARC % cc -D_KERNEL -xarch=3Dv9 -c tun.c # Sun Studio targetting 64 bit x86 %cc -D_KERNEL -xarch=3Damd64 -xmodel=3Dkernel -c tun.c # Sun Studio targetting 32 bit=20 % cc -D_KERNEL -c tun.c # GNU C Compiler targetting 64 bit SPACE ( optional: mtune=3Dultrasparc -O2 ) % gcc -D_KERNEL -m64 -mcpu=3Dv9 -mcmodel=3Dmedlow -fno-pic -mno-fpu -ffreestanding -nodefaultlibs -c tun.c =20 # GNU C Compiler targetting 64 bit x86 ( optional: mtune=3Dopteron -O2 ) % gcc -D_KERNEL -m64 -mcmodel=3Dkernel -mno-red-zone -ffreestanding -nodefaultlibs -c tun.c =20 # GNU C Compiler targetting 32 bit % gcc -D_KERNEL -ffreestanding -nodefaultlibs -c tun.c The linking is the same for all % usr/ccs/bin/ld -r -o tun tun.o =20 The destination is different for depending on the architecture: =20 # 64 bit sparc cp tun /usr/kernel/drv/sparcv9/tun # 64 bit x86 cp tun /usr/kernel/drv/amd64/tun # 32 bit cp tun /usr/kernel/drv/tun =20 Regards, =20 Rodger Lucas TAZZ Networks Glasgow Scotland, United Kingdom ( Voice: +44 (0)141 222 2126 + Email: rl...@ta... <mailto:rl...@ta...>=20 =20 |