我正在学习Solaris并编写一个简单的驱动程序;目前我实施了基本的入口点,即_init
,_info
,_finit
,*attach
,*detach
。它编译并链接没有问题,然后我将其复制到/usr/kernel/drv/amd64/
并致电:
% add_drv mydrv
Jul 7 22:54:16 ezhost mydrv: NOTICE: mydrv: _info called
devfsadm: driver failed to attach: mydrv
Warning: Driver (mydrv) successfully added to system but failed to attach
Jul 7 22:54:16 ezhost mydrv: NOTICE: mydrv: _init called
目前我在_attach例程中所做的是:
ddi_get_instance ddi_soft_state_zalloc ddi_get_soft_state
并返回DDI_SUCCESS
并不多,但是当驱动程序加载到内存中时,系统(devfsadm)希望在devfs中创建一些条目,但是我的驱动程序没有注册任何字符设备节点,结果失败了?