Re: Regarding IOMedia init function...
Re: Regarding IOMedia init function...
- Subject: Re: Regarding IOMedia init function...
- From: Kevin Elliott <email@hidden>
- Date: Wed, 24 Jul 2013 15:50:35 -0700
> 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:
Unfortunately, the content hin in this context doesn't really mean what you think. Basically, it's exposing the data that was written into the partition map, which basically has nothing to do with the actual filesystem written to a particular partition.
> What should be changed here to support NTFS or FAT as well with HFS?
Nothing really, at least in functional terms. I haven't tested it recently, but I believe if you were to simply erase one of your partitions and replace it with FAT32, everything would continue to work as is. DiskUtility might be updating the partition map, in which case the content hint would change, but nothing in the system requires that. That's easy to confirm by writing the new filesystem using the command line.
> Or to support NTFS and FAT devices do i need to write some other Kernel module and not use IOMedia.
In general, I can't think of any reason why you'd need to write an IOMedia driver to support other filesystems.
On Jul 19, 2013, at 6:54 AM, Kumar Gaurav <email@hidden> wrote:
> Hi,
>
> 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:
>
> if (childMedia->init(
> /* base */ 0,
> /* size */ media->getSize(),
> /* preferredBlockSize */ media->getPreferredBlockSize(),
> /* isEjectable */ media->isEjectable(),
> /* isWhole */ false,
> /* isWritable */ media->isWritable(),
> /* contentHint */ "Apple_HFS" ))
> {
> // Set a name for this partition.
>
> UInt32 partitionID = 1;
>
> char name[24];
> sprintf(name, "MY_CONTENT %ld", partitionID);
> childMedia->setName(name);
>
> // Set a location value (the partition number) for this partition.
>
> char location[12];
> sprintf(location, "%ld", partitionID);
> childMedia->setLocation(location);
>
> // Attach the new media to this driver
>
> _childMedia = childMedia;
>
> childMedia->attach(this);
>
>
> childMedia->registerService();
>
> return true;
>
> }
>
> What should be changed here to support NTFS or FAT as well with HFS?
> Or to support NTFS and FAT devices do i need to write some other Kernel module and not use IOMedia.
>
> Thanks And Regards,
> Kumar Gaurav
>
>
>
>
>
> _______________________________________________
> 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