Re: kernel panic while unloading the driver, USB Bulk device driver KEXT.
Re: kernel panic while unloading the driver, USB Bulk device driver KEXT.
- Subject: Re: kernel panic while unloading the driver, USB Bulk device driver KEXT.
- From: "Herb Petschauer" <email@hidden>
- Date: Tue, 30 May 2006 09:50:34 -0700
Edited and inlined...
On 30/05/06, rohit dhamija <email@hidden> wrote:
Dear All,
IOService * rootDomain;
1. I Register the driver as an interested object by calling the IOService
method
bool myDriver::start(IOService *provider)
{
bool res = super::start(provider);
if(!res)
{
return false;
}
rootDomain = (IOService *)getPMRootDomain();
if (rootDomain)
{
rootDomain->registerInterestedDriver(this);
}
registerService();
return res;
}
4. Deregister the interested object by calling the IOService method
deRegisterInterestedDriver.
void myDriver::stop(IOService *provider)
{
if(rootDomain)
{
deRegisterInterestedDriver (rootDomain );
}
super::stop(provider);
}
/////////////////////////
when I unload the kext, sudo kextunload -v myDriver.kext, the kernel panics.
Did anybody encountered the same situation before? What can be the reason
behind the same ? Please advice.
I suspect that examing the panic log, generating your debugging
symbols and looking at the backtrace in gdb will point to your
problem. That or a 5 minute code review... I'd recommend the first
option as a learning experience (it will also take about 5 minutes,
maybe 15 the first time and you will use it often).
Also , I have another query, In powerStateWillChangeTo function, can we get
IOUSBDevice* using
IOUSBDevice* pDevice = OSDynamicCast(IOUSBDevice, provider) [Yes, my
provider is IOUSBDevice]
and your equivalent question in user space would be:
IOUSBDevice *pDevice = dynamic_cast<IOUSBDevice *>(provider).
Will pDevice return a valid IOUSBDevice if <provider> is_a IOUSBDevice?
<http://www.cplusplus.com/doc/tutorial/typecasting.html>
hth,
Cheers!
-H.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden