Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Question Monitoring Disk Access With FileName & data


    I want to monitor the disk access, for that I am directly modifying read_write.c that contains calls vfs_read and vfs_write that manages disk access on virtual layer.

    but to do some operation on that data ,
    (right now i just want to append to a file that vfs_write was called with '.....' these parameters),

    So, we can have one Daemon process (or for this time just some user space process) that will do all operations in user space.. and read_write.c will directly transfer disk access detils to it..

    i'm still working on IPC to handle messaging from kernel space to user space.

    I'm getting disk access details in read_write.c...
    how do i get the information in user space, say in a FIFO...??

    when i tried to write info to a fifo, i'm getting "-14" error to "write" (tried both write system call and write in file descriptor)

    thank you,

  2. #2
    Linux User fernape's Avatar
    Join Date
    Dec 2005
    I always love the pseudo-filesystems (procfs, debugfs, sysfs)

    I would use one of these and then I would write a user-land application.

    Best Regards

  3. #3

    Unhappy Thats Aint workin :(

    Actually i'm getting lot of problems..

    kernel crashed wen i tried bigger stuff like file write from read_write.c

    can someone tell me what should i do to just get that information to some programm in my user mode?

  4. $spacer_open
  5. #4
    Linux User fernape's Avatar
    Join Date
    Dec 2005
    IMHO, the easiest way to put data in user-space is with procfs or similar as I told you.

    In addition, I would use kprobes to make some interesting and clean hooks, instead of modifying the kernel source itself.

    Best Regards

  6. #5

    Question How About This?


    i've decided some plans after analysis.. please someone help me to figure out if they would provide me with optimal way of doin 'em...

    basically till now, all i want is to transfer data from kernel itself to user...
    might require module in future as well...

    so now, using shared Memory i'll transfer data from kernel to module with
    PHP Code:
    char buffer[100];
    and in Module --
    PHP Code:
    extern char buffer
    so i got data in module....


    then to transfer data from Module to user.. How about using SOCKETS
    or should i look for any other IPC method like named pipes etc???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts