Communication between two modules

Hi, everyone, does anyone know how to implement a filter driver on the Linux platform, such as intercept the read/write operations to the floppy block device. I mean I want to hook all the read/write operations to the floppy block device in my kernel module. Maybe on Windows platform this can be implement by a filter driver. But how can I implement this on Linux platform?

I am so sorry to post this Linux problem on this NT mail list. But I really need your help. Thank you very much.

Michael


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi,
Have a look at Linux Kernel Module Programming Guide by Ori Pomerantz, so
many nice examples are there, both soft copy and sample source code are
freely downloadable. Read rubini for a better idea!!!

HTH
~Govind

From: “Michael”
Reply-To: “NT Developers Interest List”
To: “NT Developers Interest List”
Subject: [ntdev] Communication between two modules

Hi, everyone, does anyone know how to implement a filter driver on the Linux
platform, such as intercept the read/write operations to the floppy block
device. I mean I want to hook all the read/write operations to the floppy
block device in my kernel module. Maybe on Windows platform this can be
implement by a filter driver. But how can I implement this on Linux
platform?

I am so sorry to post this Linux problem on this NT mail list. But I really
need your help. Thank you very much.

Michael

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

hi
May be u need to hook major file sytem related system
calls like read, write etc.

Regards
Suja.

-----Original Message-----
From: Michael [mailto:xxxxx@yahoo.ca]
Sent: Thursday, December 13, 2001 12:06 PM
To: NT Developers Interest List
Subject: [ntdev] Communication between two modules

Hi, everyone, does anyone know how to implement a
filter driver on the Linux platform, such as intercept
the read/write operations to the floppy block device.
I mean I want to hook all the read/write operations to
the floppy block device in my kernel module. Maybe on
Windows platform this can be implement by a filter
driver. But how can I implement this on Linux
platform?

I am so sorry to post this Linux problem on this NT
mail list. But I really need your help. Thank you very
much.


Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Michael,

I think you can write a filter driver in linux to trap all
read/write call on floopy drive.
If floopy drive??s entry point are exported then you can write a filter
driver for a fake device in which you can capture all the entry point of
floopy drive.

Bye
Tandon

-----Original Message-----
From: Michael [mailto:xxxxx@yahoo.ca]
Sent: Thursday, December 13, 2001 12:06 PM
To: NT Developers Interest List
Subject: [ntdev] Communication between two modules

Hi, everyone, does anyone know how to implement a filter driver on the Linux
platform, such as intercept the read/write operations to the floppy block
device. I mean I want to hook all the read/write operations to the floppy
block device in my kernel module. Maybe on Windows platform this can be
implement by a filter driver. But how can I implement this on Linux
platform?

I am so sorry to post this Linux problem on this NT mail list. But I really
need your help. Thank you very much.

Michael

You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are right. I compiled a module which can hook the
system call a week ago. In that module I hooked the
sys_read and sys_write system call. Then I can get the
read/write operation to the floppy disk. And it works
just fine. But I think it is a high level solution
because my kernel module is located between the Linux
OS and the File System. Now I need a low level
solution or a block level solution. I hope that my
module can be located between the Linux File System
and the floppy block device driver or between the
floppy block device driver and the floppy disk device.
That is a filter driver.

I’ve read some books about Linux kernel and device
driver including Alessandro Rubini’s “Linux device
driver, 2nd Edition”. But no books mentioned the
filter driver.

Another queston, how can I find the floppy block
device’s entry point in Linux?

Thank you very much.

Michael

— SUJA JAMES wrote:
> hi
> May be u need to hook major file sytem related
> system
> calls like read, write etc.
>
> Regards
> Suja.
>
> -----Original Message-----
> From: Michael [mailto:xxxxx@yahoo.ca]
> Sent: Thursday, December 13, 2001 12:06 PM
> To: NT Developers Interest List
> Subject: [ntdev] Communication between two modules
>
> Hi, everyone, does anyone know how to implement a
> filter driver on the Linux platform, such as
> intercept
> the read/write operations to the floppy block
> device.
> I mean I want to hook all the read/write operations
> to
> the floppy block device in my kernel module. Maybe
> on
> Windows platform this can be implement by a filter
> driver. But how can I implement this on Linux
> platform?
>
> I am so sorry to post this Linux problem on this NT
> mail list. But I really need your help. Thank you
> very
> much.
>
>
>
>
> Do You Yahoo!?
> Check out Yahoo! Shopping and Yahoo! Auctions for
> all of
> your unique holiday gifts! Buy at
> http://shopping.yahoo.com
> or bid at http://auctions.yahoo.com
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.ca
> To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

____
Send your holiday cheer with http://greetings.yahoo.ca


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Writing an FS filter for UNIX will be a PITA though due to namei() and vnode chains.
You will need to filter all VFS virtual methods and attach your filter’s vnode with its own vtable instead of the FS’s one to the file object.
Also note that Linux paging IO path (Linux is simpler than NT and has no uncached IO paths for on-disk files - any user read() goes to cache) often bypasses the filesystem, VFS just calls bmap() vnode method, then splits the request itself and sends it down to the disk. The FS does not see the data at all.

Having no kernel debugger :-)))), this can be a very complex task.

On the other hand, I consider the lack of namei() in NT as design flaw #1.
Having no partition support tier and bothering the disk class driver with partition tables is possibly design flaw #2.

Max

----- Original Message -----
From: Parveen Tandon
To: NT Developers Interest List
Sent: Thursday, December 13, 2001 2:01 PM
Subject: [ntdev] RE: Communication between two modules

Hi Michael,

I think you can write a filter driver in linux to trap all read/write call on floopy drive.

If floopy drive??s entry point are exported then you can write a filter driver for a fake device in which you can capture all the entry point of floopy drive.

Bye

Tandon

-----Original Message-----
From: Michael [mailto:xxxxx@yahoo.ca]
Sent: Thursday, December 13, 2001 12:06 PM
To: NT Developers Interest List
Subject: [ntdev] Communication between two modules

Hi, everyone, does anyone know how to implement a filter driver on the Linux platform, such as intercept the read/write operations to the floppy block device. I mean I want to hook all the read/write operations to the floppy block device in my kernel module. Maybe on Windows platform this can be implement by a filter driver. But how can I implement this on Linux platform?

I am so sorry to post this Linux problem on this NT mail list. But I really need your help. Thank you very much.

Michael


You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com