Re: processing IOService in kext
Re: processing IOService in kext
- Subject: Re: processing IOService in kext
- From: email@hidden
- Date: Wed, 17 Nov 2004 20:19:52 +0100
Garth,
Thanks for your explanation, this gives me a more clear understanding
of the situation.
-DM-
At 09:58 -0800 17/11/2004, Garth Cummings wrote:
Mime-Version: 1.0 (Apple Message framework v619)
Content-Type: multipart/signed; micalg=sha1;
boundary=Apple-Mail-2-519140; protocol="application/pkcs7-signature"
Hi DM,
On Nov 17, 2004, at 9:22 AM, email@hidden wrote:
gc,
Why do you want to intercept file I/O calls?
I am implementing this over a disk image.
Then I copy ANY application into the disk image in order to cache /
optimize / re route it's requests.
(say its looking for a certain file on the disk, which is not
there, but I can get it from else where)
Ah, thanks.
Again, at this layer you have no information about files. In your
hypothetical case, the open call from the application would end up
in the filesystem name lookup code. The filesystem plugin would
determine that the file didn't exist and your filter scheme wouldn't
even be called.
(The filter scheme would be called when the filesystem plugin read
in the filesystem blocks from disk, but the filter scheme would have
no way to tell that the read calls came from the filesystem plugin
without basically reimplementing the filesystem code in the filter
scheme, which is a really bad idea.)
I don't have a simple answer for you. Perhaps someone on the list
will, or you can always submit a paid tech support incident to DTS
if you'd like us to help you research possible solutions.
-DM-
--gc
Mime-Version: 1.0 (Apple Message framework v619)
Content-Type: multipart/signed; micalg=sha1;
boundary=Apple-Mail-41--2092227;
protocol="application/pkcs7-signature"
Hello DM,
On Nov 17, 2004, at 2:04 AM, email@hidden wrote:
--
Hi,
I am trying to further implement the following Apple Kernel sample.
How do I parse / filter / the IOService which is handed to me?
I have tried several options, but am getting nowhere.
I need to know the name of the class (open, create, etc) and the
specific params for each call
client->serviceMatching( "open", table );
A filter scheme is located well below the filesystem, so it has no
knowledge of UNIX syscalls or files. A filter scheme only knows
about reading/writing a buffer at a particular location on an
IOMedia object. An IOMedia object is typically either a partition
or the entire medium.
The IOService handed to you is the IOMedia object published by the
filter scheme.
Why do you want to intercept file I/O calls?
--gc
P.S. Please do not cross-post to multiple lists. If you do, people
on one list don't know anything about the responses on the other
list. I'm replying to the darwin-dev list only.
Note: this is a kext with KERNEL = 1, so not all api's are accessible.
Thanks, DM
======= Apple Code =======
void com_apple_dts_driver_SampleFilterScheme::read(IOService*
client ,
UInt64 byteStart,
IOMemoryDescriptor* buffer,
IOStorageCompletion completion)
{
// Read data from the storage object at the specified byte
offset into the
// specified buffer, asynchronously. When the read
completes, the caller
// will be notified via the specified completion action.
//
// The buffer will be retained for the duration of the read.
//
// For simple partition schemes, the default behavior is to
simply pass the
// read through to the provider media. More complex
partition schemes such
// as RAID will need to do extra processing here.
//
getProvider()->read(this, byteStart, buffer, completion);
}
_______________________________________________
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
__________________________________________________________________
Garth Cummings
Apple Developer Technical Support email@hidden
http://developer.apple.com/technicalsupport
Attachment converted: ek disk:smime 1.p7s ( / ) (001184FC)
--
===========================
Erez Kaplan
Collector and Researcher
Mechanical Calculating Machines
Virtual Museum:
http://www.webcom.com/calc
===========================
__________________________________________________________________
Garth Cummings 1 Infinite Loop, MS 303-2T
Apple Developer Technical Support Cupertino, CA 95014
"The last good thing written in C was 408-974-7711 phone
Franz Schubert's Symphony No. 9." 408-862-7602 fax
--Erwin Dieterich email@hidden
Attachment converted: ek disk:smime 2.p7s ( / ) (00118516)
--
===========================
Erez Kaplan
Collector and Researcher
Mechanical Calculating Machines
Virtual Museum:
http://www.webcom.com/calc
===========================
_______________________________________________
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