Re: Write on specific IOMedia through filter driver
Re: Write on specific IOMedia through filter driver
- Subject: Re: Write on specific IOMedia through filter driver
- From: Dan Markarian <email@hidden>
- Date: Fri, 6 May 2005 17:30:10 -0400
Hi Imran,
Let us draw a picture.
(A) IOMedia IOMedia (1)
| |
(B) SpsoftSnapDriver SpsoftSnapDriver (2)
| |
(C) IOMedia IOMedia (3)
|_________________|
|
IOApplePartitionScheme
|
What we are looking is to write a buffer on the specific one
partition, so we are not able to find how to issue a write call for
the specific partition as our filter driver is loaded for both the
partitions.
You have a pointer to (B) and a pointer to (2). You can write to (C)
with the pointer to (B). You can write to (3) with the pointer to
(2). You have total control over the choice.
Our aim is to intercept the write call at one partition and read
the data from this partition in a buffer which is going to be
modified by the write call and write this buffer to the another
partition. This is the reason we have loaded our filter driver for
the two partitions. (This is a kind of Snapshot of one partition on
other partition)
You are welcome to have (B) and (2) rendezvous with each other as I
had described before. You wish to differentiate them I take it. Is
there not information in your data structures on disk that can
differentiate them?
You are welcome to differentiate the (B) and (2) with a partition
name as you have proposed. The partition name is not the volume
name, keep in mind. You should set your partition name alongside
your partition hint of 'SpsoftSnap' using pdisk.
Partition map (with 512 byte blocks) on '/dev/rdisk1'
#: type name length base
( size )
1: Apple_partition_map Apple 63 @ 1
2: SpsoftSnap Primary 33292288 @ 64
( 15.9G)
3: SpsoftSnap Secondary 33292288 @ 33292288
( 15.9G)
You can obtain the partition name with media->getName().
Dan
On 6 May 2005, at 10:45 AM, Imran Kazi wrote:
Hi Dan,
We may not be able to explain the complete picture to you. Let me
put it again
We have the filter driver whose content hint is ‘SpsoftSnap’ now we
have two partitions whose content hint is ‘SpsoftSnap’. (We want
our filter driver to be loaded for both the partitions). And all
the writes on these partition goes through our filter driver, but
when we issue the write call with a buffer in that case the buffer
goes to both the partitions. What we are looking is to write a
buffer on the specific one partition, so we are not able to find
how to issue a write call for the specific partition as our filter
driver is loaded for both the partitions.
Our aim is to intercept the write call at one partition and read
the data from this partition in a buffer which is going to be
modified by the write call and write this buffer to the another
partition. This is the reason we have loaded our filter driver for
the two partitions. (This is a kind of Snapshot of one partition on
other partition)
I hope I am able to explain you the situation, if not please let me
know I will try my best to put the details.
Awaiting your valuable reply.
Thanks
Imran
From: Dan Markarian [mailto:email@hidden]
Sent: Friday, May 06, 2005 3:11 AM
To: Imran Kazi
Cc: darwin Mailing List
Subject: Re: Write on specific IOMedia through filter driver
Hi Imran,
You seem to want a global disk area to store information about all
the filters. It seems the information is better kept per filter
rather than in a global disk area, but I am unable to guess what
purpose it serves at the moment, of course. You can have the global
disk area initialized with a signature and the other areas without
a signature, and somehow have your other drivers rendezvous with
the global one at start() time.
Dan
On 5 May 2005, at 9:14 AM, Imran Kazi wrote:
Hi folks,
After a good amount of effort we are now able to successfully write
on the disk using filter scheme driver.
Now my user-space buffer successfully passes to kernel through user-
client. Thanks for all your valuable help.
Thanks specially to Dan, GodFrey, Garth and Parav for helping me
out to solve the problem.
Now my driver exposes two IOMedia's named /Volume/Vol1 and /Volume/
Vol2 and my driver writes the user-space buffer on both the media
at particular byte offset.
Is there any way that my driver write routine writes only on one
specific IOMedia say (/Volume/Vol1),even if my driver matches for
both IOMedia's.
Is it possible to get the name of the media from the IORegistry or
is there any API available to get the partition name from the
IORegistry. So that we can match the partition name which we get
from the IORegistry and if the match gets successful then only my
driver write routine writes on that particular IOMedia say (/Volume/
Vol1)only and not on (/Volume/Vol2).
Awaiting your response
Thanks once again for all valuable help.
Imran
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden