Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to create and initialize root hub device



Hi David,

Thanks your reply first, I will think about using DTS( DTS means "ADC Technical Support", Right??). But the major problem is I can not debug by myself!! I tried using GDB to trace what happen on the IOUSBController::CreateRootHubDevice(), but the information is wrong between GDB and the source code which download from Darwin open source project. Let me explain on the below.

My Host and target system are Mac OS 10.4.10. (because there is no the source code of Mac OS 10.4.11 on the Darwin project)
I also download the Kernel Debug Kit 10.4.10 (Intel) build 8R2218 from apple's web site and create symbol file of IOUSBFamily.kext.
After that, I running GDB, add symbol file, attach to the target and add breakpoint on IOUSBController::CreateRootHubDevice().
GDB shows "Breakpoint 1 at 0x51d553: file IOUSBFamily/Classes/IOUSBController.cpp, line 2844".


But there is no line 2844 on the source code, IOUSBController.cpp only line 2817 on the source code.

After the GDB stop on the breakpoint, it shows:
========================================================================================
Breakpoint 2, IOUSBController::CreateRootHubDevice (this=0x3d97400, provider=0x36fbe00, rootHubDevice=0x3d97458) at IOUSBFamily/Classes/IOUSBController.cpp:2844
Line number 2844 out of range; IOUSBFamily/Classes/IOUSBController.cpp has 2817 lines.
(gdb) n
Current language: auto; currently c++
Line number 2851 out of range; IOUSBFamily/Classes/IOUSBController.cpp has 2817 lines.
==========================================================================================


Does anything wrong in my debug environment?? Why the line number shows in GDB is different with the source code download form apple??
Does the source code which in the Darwin project is not the same version as the release version??
Does this issue needs using DTS??


Regards,
James Chan


David Ferguson wrote:
James,

You should look at the Darwin sources for IOUSBFamily, that should help you trace what is happening when a controller & root hub are initialized.

This is a more complicated problem than can be handled on the USB Mailing list. I suggest you would really get your money's worth from a DTS incident.

David Ferguson
Apple

On Dec 19, 2007, at 11:06 PM, James Chan wrote:

Hi Sir,

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

==============================================
(gdb)
Continuing.

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

This email sent to email@hidden




--
James Chan
Software Engineer
Elitesilicon

_______________________________________________
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

This email sent to email@hidden
References: 
 >Re: Unable to create and initialize root hub device (From: James Chan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.