Re: Scanning devices from inside the kernel
Re: Scanning devices from inside the kernel
- Subject: Re: Scanning devices from inside the kernel
- From: Dan Markarian <email@hidden>
- Date: Wed, 28 May 2003 23:17:46 -0400
Hi Sam,
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().
http://developer.apple.com/techpubs/macosx/Darwin/General/
WritingDeviceDriver/IOService/chapter_4_section_3.html
http://developer.apple.com/techpubs/macosx/Darwin/Reference/Kernel/
IOService/Classes/IOService/Functions/Functions.html
http://developer.apple.com/techpubs/macosx/Darwin/Reference/Kernel/
IORegistryEntry/Classes/IORegistryEntry/Functions/Functions.html
Dan
On Wednesday, May 28, 2003, at 09:13 PM, Sam Vaughan wrote:
I'm porting a volume manager that is part of a file system to Mac OS
X. One of the first things I need to do is to scan the device tree
and find the disks I'm interested in. The only related documentation
I've found describes how to access hardware from applications using
IOKit.
What I ended up doing in my kext is including a Darwin header,
xnu/bsd/miscfs/devfs/devfsdefs.h, and walking the device tree to find
the disks and their dev_t (and thus major and minor) numbers. I know
this is frowned upon, but I couldn't find another way of doing it from
inside the kernel.
The problem I have now is distinguishing the disk entries I'm
interested in from the ones I'm not. How can I talk to the driver
associated with each device? I'd like to get target and lun numbers
for the disks that are connected via a fibre channel HBA. Whilst I
can see these numbers in IORegistryExplorer, I can't find a way of
accessing them from inside the kernel.
What is the recommended approach for getting information on devices in
the device tree from inside the kernel? Also, am I wrong in my
assumption that the IOKit is of little use to me inside a kext?
Sam
_______________________________________________
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.
_______________________________________________
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.