dev driver

Developing a Dev driver, I have accidentially slayed my Dev.foo
driver by SIGKILL a number of times. When doing this, the devices
(/dev/foo1, /dev/foo2, …) remain registered and I cannot restart my Dev.foo
since the call to dev_drvr_register() fails. I’d rather not restart Dev.
Other ways to do unregister the devices? QNX 4.25.

Thanks / Tom

Tomas H?gstr?m <tomas@scandicraft.se> wrote:

Developing a Dev driver, I have accidentially slayed my Dev.foo
driver by SIGKILL a number of times. When doing this, the devices
(/dev/foo1, /dev/foo2, …) remain registered and I cannot restart my Dev.foo
since the call to dev_drvr_register() fails. I’d rather not restart Dev.
Other ways to do unregister the devices? QNX 4.25.

There is no way to unregister devices that are orphaned this way.

A suggestion – when developping Dev drivers, use a seperate Dev that register
a different prefix using the -N option to Dev, and have your drivers register
with this Dev – maybe, again, command line based with a -N option.

e.g.

Dev -NDev &
Dev.mine -N/Dev/foo &

Then your devices will be /Dev/foo1, /Dev/foo1, etc. And, if you damage
something in Dev, you can just kill off your test Dev without causing
problems for your system.

If you really need to kill off Dev and restart, make sure you write a
script that slays Dev & drivers, and restarts them before trying to return
control. Even so, it may not be happy for things on your system.

-David

Thanks, I’ll use the separate Dev idea!

/ Tom (likes the fast replies of QNX support)

David Gibbs wrote:

Tomas H?gstr?m <> tomas@scandicraft.se> > wrote:
Developing a Dev driver, I have accidentially slayed my Dev.foo
driver by SIGKILL a number of times. When doing this, the devices
(/dev/foo1, /dev/foo2, …) remain registered and I cannot restart my Dev.foo
since the call to dev_drvr_register() fails. I’d rather not restart Dev.
Other ways to do unregister the devices? QNX 4.25.

There is no way to unregister devices that are orphaned this way.

A suggestion – when developping Dev drivers, use a seperate Dev that register
a different prefix using the -N option to Dev, and have your drivers register
with this Dev – maybe, again, command line based with a -N option.

e.g.

Dev -NDev &
Dev.mine -N/Dev/foo &

Then your devices will be /Dev/foo1, /Dev/foo1, etc. And, if you damage
something in Dev, you can just kill off your test Dev without causing
problems for your system.

If you really need to kill off Dev and restart, make sure you write a
script that slays Dev & drivers, and restarts them before trying to return
control. Even so, it may not be happy for things on your system.

-David