Re: Scanning devices from inside the kernel
Re: Scanning devices from inside the kernel
- Subject: Re: Scanning devices from inside the kernel
- From: Sam Vaughan <email@hidden>
- Date: Fri, 30 May 2003 10:31:30 +1000
Thanks Dan, getMatchingServices() does exactly what I need. Having the
IOService object for the devices I want to talk to is going to be a
huge help. The key was finding the OS classes in libkern that let you
do CoreFoundation type things in the kernel.
Here's the code for anyone who's interested:
OSDictionary* services = IO
Service::serviceMatching(kIOMediaClass);
if (!services)
return;
OSIterator* iterator = IO
Service::getMatchingServices(services);
if (!iterator)
return;
while (true)
{
IOService* service = OSDynamicCast(IOService,
iterator->getNextObject());
if (!service)
break;
printf("name: %s\n", service->getName());
service->release();
}
iterator->release();
services->release();
Sam
On Thursday, May 29, 2003, at 15:00 Australia/Melbourne,
email@hidden wrote:
If the volume management could be done in mostly in user space, all the
better, easier, safer, etc, but if not, what you want is doable of
course.
You can look up the media objects by BSD name or all media objects by
IOMedia class, just as in user-space. See getMatchingServices().
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.