• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Regarding IOMedia init function...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regarding IOMedia init function...


  • Subject: Re: Regarding IOMedia init function...
  • From: Kumar Gaurav <email@hidden>
  • Date: Fri, 26 Jul 2013 11:45:16 +0530

Hi Chris,

Thanks for your inputs, yes i also tested the filter scheme and is working with other filesystems as well, by changing the init function.
Basic need is that the device few sectors could be encrypted, i need to create a child media which would read the boot sector encrypt on the fly and allow it to mount. But not change anything on the drive and it remains encrypted on other system.
Also, i need to control the access of external drives to read only.

Moving ahead i have following queries:
1. As the partition on the drives could be GUID partition scheme, Apple partition map and MBR partition map.
I can use PDISK utility to change the "Content Hint" of Apple partition without destroying the drive to load my driver, what utility should i use to change type for other two. The drives volumes and partition already exists.
2. If both parent media drive and child media drive gets mounted if Content Hint of both are same, how i can detach parent. I have tried to use this function ((void) attachMediaObjectToDeviceTree(childMedia)) but the parent media of drive is not detached. Do i need modify this function to detach parent and only child media is attached. As this function comments suggests it does the same for boot volume, so i understand that it should work same for external drives.

bool attachMediaObjectToDeviceTree(IOMedia* media)
{
//
// Attach the given media object to the device tree plane.
//

IORegistryEntry* child;

    DEBUG_LOG("%s[%p]::%s(%p)\n", getName(), this, __FUNCTION__, media);

if ((child = getParentEntry(gIOServicePlane))) {

IORegistryEntry* parent;

if ((parent = child->getParentEntry(gIODTPlane))) {

const char* location = child->getLocation(gIODTPlane);
const char* name     = child->getName(gIODTPlane);

if (media->attachToParent(parent, gIODTPlane)) {
media->setLocation(location, gIODTPlane);
media->setName(name, gIODTPlane);

child->detachFromParent(parent, gIODTPlane);

return true;
}
}
}

return false;
}

Thanks,
Kumar
On Jul 25, 2013, at 4:51 AM, Chris Suter wrote:

Hi Kumar,

On Fri, Jul 19, 2013 at 11:54 PM, Kumar Gaurav <email@hidden> wrote:
I would like to know about applying filter scheme to work for HFS and Non-HFS volumes. Is it possible?
The current code as from SampleFilterScheme that works with HFS+ volumes:

Yes. You need to provide appropriate matching criteria in your Info.plist. I imagine that the sample code you’re looking at will be matching on the Content Hint property so as a minimum you will need to remove that.

What should be changed here to support NTFS or FAT as well with HFS?

You need to change the code to pass the content hint from your provider, rather than always using “Apple_HFS.”
 
Or to support NTFS and FAT devices do i need to write some other Kernel module and not use IOMedia.

No.

Kind regards,

Chris

 _______________________________________________
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

References: 
 >Regarding IOMedia init function... (From: Kumar Gaurav <email@hidden>)
 >Re: Regarding IOMedia init function... (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Regarding IOMedia init function...
  • Next by Date: Re: Regarding IOMedia init function...
  • Previous by thread: Re: Regarding IOMedia init function...
  • Next by thread: AuthorizationRightSet unexpectedly fails on os x 10.9 DP1; authd logs strange error
  • Index(es):
    • Date
    • Thread