Re: Porting newbie seeks help with a couple of things
Re: Porting newbie seeks help with a couple of things
- Subject: Re: Porting newbie seeks help with a couple of things
- From: Dan Markarian <email@hidden>
- Date: Thu, 4 Nov 2004 09:18:57 -0500
Hi Mike,
We do not support the same ioctl requests.
HDIO_GET_IDENTITY
See <sys/disk.h>.
flush the disk
See DKIOCSYNCHRONIZECACHE.
Dan
On 2 Nov 2004, at 1:49 PM, Michael Dupuis wrote:
Greetings,
I've been tasked to port a project from Linux to Mac OS X, and am in
the process of doing that now. I've run into a few things that I'm not
sure about. It's been a long time since I've been in the 'innards' of
a Unix platform, and I'm usually a GUI/Framework guy, not a
driver/disk developer.
My first question is about the correct way to port from Linux ioctl
requests to Darwin (OS X). What I have on Linux right now is a call
like this:
ioctl(dev, HDIO_GET_IDENTITY, &id)
where HDIO_GET_ENTITY and id, which is a hd_driveid struct, are
defined in /linux/hdreg.h. If I copy this file from a Linux box,
things will compile, but I'm guessing that the request definition and
struct might be used differently on the Mac. Is there any info on the
correct way to make this change from Linux? I haven't had much
searching.
My second question is similar: I need to be able to flush the disk
(device) and the Linux code does this using ioctl(fd, HDIO_DRIVE_CMD,
&flushcmd) where flushcmd is defined:
const unsigned char flushcmd[4] = {0xe7,0,0,0} and HDIO_DRIVE_CMD is
defined in hdreg.h. Again, with by including the linux header file,
things will compile, but I'm not sure they are working. Is there any
place I can look to make sure I'm doing this correctly?
Thanks in advance for any help getting this stuff running on OS X.
Mike
_______________________________________________
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
_______________________________________________
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