xulari wrote:
> I wrote a driver xxx, I want it to be loaded when i start the computer
> so i put xxx into /kernel/drv/sparcv9/xxx
> but after i reboot the solaris10, i check the /var/adm/messages
> i found just after driver "attach", it "detach" ...
> then i
> "add_drv xxx" failed , instructions "Driver (xxx) is already installed."
> "modinfo | grep xxx" show noting...
> "rem_drv xxx" success.
> "add_drv xxx" success...
> 
> so i do things as follows:
> vi /etc/init.d/add_drv.sh
> wrote"add_drv xxx" into add_drv.sh
> chmod u+x /etc/init.d/add_drv.sh
> ln -s /etc/init.d/add_drv.sh /etc/rc2.d/S99add_drv
> 
> then reboot again . but i found problem just like before: it attach then 
> detach。
> 

I suggest you read the 'Writing Device Drivers' guide (available at 
docs.sun.com) before you go much further because you obviously aren't 
familiar with how Solaris device drivers work...

You only need to add_drv a driver once. All this essentially does is 
allocate the driver a major number and update some kernel information. 
This also has the side effect of loading and attaching the driver, but 
this is only a side effect. On reconfiguration reboots your driver will 
also be attached, but it will be detached again unless something opens 
it. On subsequent reboots your driver will not be attached unless 
something opens it (since Solaris drivers, unlike Linux kernel modules, 
are demand loaded).

   Paul
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to