Re: ioctl
Re: ioctl
- Subject: Re: ioctl
- From: Dan Markarian <email@hidden>
- Date: Mon, 29 Apr 2002 10:15:02 -0400
Hi Ralph,
May I ask for some pointers on how to call these ioctls, or sample code
for this (or something similar)? I do not know how to call routines in
objects in the driver stack directly.
You need to identify the media you are interested in first, before using
ioctl calls on that media, yes. How to get there depends on how your
application identifies a disk or file system.
Carbon or Disk Arbitration is the usual method of getting notified about
disks. In the Disk Arbitration case, the BSD device node is supplied
right in the notification. You can look up a BSD device node in the
non-Disk Arbitration cases with
Carbon vRefNum -> BSD device node: PBHGetVolParmsSync(), vMDeviceID
BSD mount point -> BSD device node: getmntinfo(), f_mntfromname
To obtain a wealth of information about the disk, one would go to I/O
Kit with
BSD device node -> IOMedia object: IOServiceGetMatchingServices(),
IOBSDNameMatching()
IOMedia object -> properties: IORegistryEntrySearchCFProperty()
I'll leave the details to the respective documentation.
Dan
On Saturday, April 27, 2002, at 10:41 PM, Ralph wrote:
May I ask for some pointers on how to call these ioctls, or sample code
for this (or something similar)? I do not know how to call routines in
objects in the driver stack directly.
Thanks
On Friday, April 26, 2002, at 02:38 , Dan Markarian wrote:
Hi Perry,
You'll find the standard set of ioctl() calls in
<IOKit/storage/IOMediaBSDClient.h>.
Dan
On Wednesday, April 24, 2002, at 04:30 PM, devdrvr wrote:
There is pretty standard C ioctl call we need to make to access and
get info
back from connected ATA disk drives. After you do an open the call
takes a
string of /dev/... for the exact drive you want. We can't seem to
get this
call to come back with anything but an error. Is anyone else using
it or can
attest to it working? Or is there sample code I can look at that
shows how
to properly address devices with the call? We've got the right Darwin
headers etc.
We've done code under Linux that does the same thing and it works. So
between the unices (and in Darwin commands and libs) this call should
be made
a lot.
And yes we are working on using IOKit calls instead. The util we are
coming
out with will have an app under MacOS X. But it also has some disk
commands
for admins to use. I'd like to keep this latter code the same across
platforms if possible is why I ask (unless there is a god reason to
deviate).
Thanks,
--Perry
mailto:email@hidden
_______________________________________________
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.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.