I am also writing Virtual USB Host Controller. I also have the some
question about can't create root hub device. In
IOUSBController::CreateRootHubDevice() function, it will happen kernel
panic.
My architecture is writing a I/O Kit Extension inherit
IOUSBControllerV2. And refer the source code of AppleUSBEHCI which
download from Apple to implement my driver. I dump the console message
to show which function was executed. It only shows:
------------------------------------------------------------------------
[VHCI]Init
[VHCI]Start
[VHCI]UIMInitialize
[VHCI]GetRootHubDeviceDescriptor
[VHCI]SetHubAddress = 1
[VHCI]UIMCreateControlEndpoint(1,0,64,1 @(0,0))
[VHCI]GetRootHubDeviceDescriptor
[VHCI]GetRootHubStringDescriptor, index = 1
[VHCI]GetRootHubStringDescriptor, index = 1
[VHCI]GetRootHubStringDescriptor, index = 2
[VHCI]GetRootHubStringDescriptor, index = 2
unexpected kernel trap .................
-----------------------------------------------------------------------
After kernel panic, I using GDB to trace, is shows
Program received signal SIGTRAP, Trace/breakpoint trap.
0x003c6a82 in OSSymbol::MetaClass::MetaClass ()
(gdb) up
#1 0x1501bcd0 in ?? ()
(gdb) up
#2 0x003c6ec1 in OSSymbol::withCStringNoCopy ()
(gdb) up
#3 0x00385794 in IORegistryEntry::setLocation ()
(gdb) up
#4 0x0051d7ea in IOUSBController::CreateRootHubDevice ()
(gdb) up
#5 0x0051d29e in IOUSBController::start ()
(gdb)
==============================================
Because this is a Virtual Driver, so far, it did not need initialize
some HW. So, I skip implement UIMInitialize(), SetHubAddress() and
UIMCreateControlEndpoint(). Now, those function are empty, only return
kIOReturnSuccess. Otherwise, other functions are almost the same as
AppleUSBEHCI. I refer apple's IOUSBFamily source code.
I think it mast is I forgot to provide some information for
IOUSBController, but how to trace what happen on
IOUSBController::CreateRootHubDevice () ?? and what happen on
IORegistryEntry::setLocation ()??
Regards,
James Chan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden