mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Points to fs architecture
@ 2004-07-05 21:38 surfing t
  2004-07-05 22:53 ` Chris Wedgwood
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: surfing t @ 2004-07-05 21:38 UTC (permalink / raw)
  To: linux-kernel

Hello,

I want to create a utility that "hooks" into the the filesystem. What I want to do is to be able to review
all file system read/write/seek requests, most of the time without affecting file system operation (ie after
review the request is passed on to the entity that would have received it had my utility not been installed, however
some of the requests my driver should handle itself. My problem is that while I have first-hand experience on kernel
programming I have never done anything on a UNIX og Linux kernel and I only know its structure from a user-level
perspective. Where can I find documentation on how to code drivers for the Linux kernel and about how the entire
file system works (by "file system" I don't refer to ext3 or reiserfs or anything like that - I mean the architecture that allows all these things to co-exist). I want my driver to be at a level above things like ext3/reiserfs if possible. Basically I just want to "hijack" the system calls that applications use to access files and then pass them on to the original system call. Is this possible and how do I do it? Any help will be greatly appreciated and the utility I have in mind will benefit the entire community (I will GPL it of course) and I believe it could so some extent make Linux more popular. I am a bit secretive right now because I really want to implement this idea myself. I will give credit to those who responds to this message.

Thank you in advance!
-- 
_______________________________________________
Find what you are looking for with the Lycos Yellow Pages
http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Points to fs architecture
  2004-07-05 21:38 Points to fs architecture surfing t
@ 2004-07-05 22:53 ` Chris Wedgwood
  2004-07-06 12:56 ` Horst von Brand
  2004-07-06 18:34 ` Matthew Dharm
  2 siblings, 0 replies; 4+ messages in thread
From: Chris Wedgwood @ 2004-07-05 22:53 UTC (permalink / raw)
  To: surfing t; +Cc: linux-kernel

On Mon, Jul 05, 2004 at 04:38:58PM -0500, surfing t wrote:

> I want to create a utility that "hooks" into the the filesystem.

OK

> What I want to do is to be able to review all file system
> read/write/seek requests, most of the time without affecting file
> system operation (ie after review the request is passed on to the
> entity that would have received it had my utility not been
> installed, however some of the requests my driver should handle
> itself.

Strictly speaking what you want then is not going to be at the
filesystem layer, since the filesystem layer doesn't generally see
seeks, writes, etc.

It sounds like you want to instrument the system calls, look at the
man pages for 'strace' and similar.

> Basically I just want to "hijack" the system calls that applications
> use to access files and then pass them on to the original system
> call.  Is this possible and how do I do it?

The ptrace system call and a little effort will let you do this.  You
can also use LD_PRELOAD and over-ride some glibc hooks for the file IO
operations --- there are plenty of things that do this I'm sure
already.


  --cw

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Points to fs architecture
  2004-07-05 21:38 Points to fs architecture surfing t
  2004-07-05 22:53 ` Chris Wedgwood
@ 2004-07-06 12:56 ` Horst von Brand
  2004-07-06 18:34 ` Matthew Dharm
  2 siblings, 0 replies; 4+ messages in thread
From: Horst von Brand @ 2004-07-06 12:56 UTC (permalink / raw)
  To: surfing t; +Cc: linux-kernel


> I want to create a utility that "hooks" into the the filesystem. What I
> want to do is to be able to review all file system read/write/seek
> requests, most of the time without affecting file system operation (ie
> after review the request is passed on to the entity that would have
> received it had my utility not been installed, however some of the
> requests my driver should handle itself.

Prelink something that handles read/write to your application(s). No kernel
stuff involved at all. Better yet, this in completely independent of the
underlying filesystem.
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Points to fs architecture
  2004-07-05 21:38 Points to fs architecture surfing t
  2004-07-05 22:53 ` Chris Wedgwood
  2004-07-06 12:56 ` Horst von Brand
@ 2004-07-06 18:34 ` Matthew Dharm
  2 siblings, 0 replies; 4+ messages in thread
From: Matthew Dharm @ 2004-07-06 18:34 UTC (permalink / raw)
  To: surfing t; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2401 bytes --]

This sounds like a job for dazuko (www.dazuko.org) -- I know that utilities
like ClamAV use that to accomplish some very similar things to what you're
describing.

Matt

On Mon, Jul 05, 2004 at 04:38:58PM -0500, surfing t wrote:
> Hello,
> 
> I want to create a utility that "hooks" into the the filesystem. What I want to do is to be able to review
> all file system read/write/seek requests, most of the time without affecting file system operation (ie after
> review the request is passed on to the entity that would have received it had my utility not been installed, however
> some of the requests my driver should handle itself. My problem is that while I have first-hand experience on kernel
> programming I have never done anything on a UNIX og Linux kernel and I only know its structure from a user-level
> perspective. Where can I find documentation on how to code drivers for the Linux kernel and about how the entire
> file system works (by "file system" I don't refer to ext3 or reiserfs or anything like that - I mean the architecture that allows all these things to co-exist). I want my driver to be at a level above things like ext3/reiserfs if possible. Basically I just want to "hijack" the system calls that applications use to access files and then pass them on to the original system call. Is this possible and how do I do it? Any help will be greatly appreciated and the utility I have in mind will benefit the entire community (I will GPL it of course) and I believe it could so some extent make Linux more popular. I am a bit secretive right now because I really want to implement this idea myself. I will give credit to those who responds to this message.
> 
> Thank you in advance!
> -- 
> _______________________________________________
> Find what you are looking for with the Lycos Yellow Pages
> http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

NYET! The evil stops here!
					-- Pitr
User Friendly, 6/22/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-07-06 18:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-05 21:38 Points to fs architecture surfing t
2004-07-05 22:53 ` Chris Wedgwood
2004-07-06 12:56 ` Horst von Brand
2004-07-06 18:34 ` Matthew Dharm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®