Re: calling open() on an older cd device returns EBUSY??
Re: calling open() on an older cd device returns EBUSY??
- Subject: Re: calling open() on an older cd device returns EBUSY??
- From: Sam Vaughan <email@hidden>
- Date: Fri, 6 May 2005 08:46:23 +1000
David,
I see you've already had a few replies, but I thought I'd point out
where you can look if you want to read about how the devices in /dev
get there and what they do. If you download the IOStorageFamily code
from the Darwin section of developer.apple.com, you'll find a file
inside called IOMediaBSDClient.cpp. This file is responsible for
making IOKit devices such as disks available to BSD, which it does by
adding them to the devfs file system mounted on /dev. (run "mount" to
see all your currently mounted file systems)
If you run /Developer/Applications/Utilities/IORegistryExplorer.app,
open the Find window and search for "IOMediaBSDClient", you can
inspect these IOKit objects and their parents. You'll see the BSD
Name entries for each of your /dev/diskN and /dev/rdiskN devices in
there, along with a lot of other interesting properties.
So as you can see from the calls to devfs in IOMediaBSDClient.cpp,
the names given to these devices are completely arbitrary. The devfs
entries, along with their BSD Major and BSD Minor numbers visible
with `ls -l /dev/*disk*`, are really just a bridge to allow you to
communicate with the relevant IOKit driver for a particular device.
Sam
On 05/05/2005, at 9:39 PM, email@hidden wrote:
so, opendev() gives you the char device, while open() gives you the
block device? I was unsuccessful doing open("disk2"), I *was*
successful doing open("rdisk2"). Are you saying it's better to call
opendev("rdisk2")? what exactly does prepending "r" in front of the
"disk2" do?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden