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: Working backwards from a BSDname to service



There is virtually no information in this message.

What is "myBSDName" is it "disk3"? "/dev/disk3"?

What is dictRef? The entry count is useless. What's in it? Use CFShow to dump out a summary.

What is service? "a reasonable number" means what? a pointer in the heap? Use IORegistryEntryCreateCFProperties to get it's properties to see if it's really what you wanted. You can also use IORegistryEntryGetLocationInPlane to see if the ioservice has the right path.

Shantonu

On Thursday, July 31, 2003, at 6:06AM, Lance Drake wrote:

Hi Darwin Experts - Please help me find the error of my ways...
I'm trying to use my bsdname to find the specific instance of
my driver in the ioreg which is responsible for that media.
My driver is several levels 'up' (or down, depending on your
point of view) and the hope was to iterate up to the parent.
That doesn't seem to want to happen. Here's my short path
to instant failure: (the iterating logic is not shown because
the code fails on the first test)
------------------------------------------------------------
CFMutableDictionaryRef dictRef = NULL;
io_service_t service = 0;
io_registry_entry_t parent = 0;
kern-return_t kr = 0;

dictRef = IOBSDNameMatching(kIOMasterPortDefault, NULL, myBSDName);
service = IOServiceGetMatchingService( kIOMasterPortDefault, dictRef);
kr = IORegistryEntryGetParentEntry(service, kIOServicePlane, &parent);
-----------------------------------------------------------------------
kr = -536870206 or 0x1FFFFD3E or [0xE000 0x02C2]
-----------------------------------------------------------------------
Doing an ioreg at the terminal shows my bsdname item is there.
The count of the items in the dictRef is 2
'service' appears to be a reasonable number.

To me, it appears the initial call to IOBSDNameMatching is the
problem. Any thoughts as to how I am approaching this incorrectly?

Thanks very much!

Lance Drake
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Working backwards from a BSDname to service (From: Lance Drake <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.