shared memory - Kernel

This is a discussion on shared memory - Kernel ; Hi, Im working on a project working on linux kernel 2.6.17 I have to share memory on user level... I have to build something like a server process that "exports" a portion of his virtual memory, and other client process ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: shared memory

  1. shared memory

    Hi, Im working on a project working on linux kernel 2.6.17
    I have to share memory on user level... I have to build something like
    a server process that "exports" a portion of his virtual memory, and
    other client process may ask the kernel for that memory and use it (as
    its own).
    I managed to build a structure on the kernel. The server process calls
    a system-call and tells the kernel which pointer and size to share. Im
    saving that data (virtual memory pointer and size) and the pid in the
    structure.

    After that, the client process calls another system call to get the
    shared memory. My idea is to create a new vma_struct in the client
    process pointing to the server shared memory.. The problem is I can't
    see how to make a vma_struct to point directly to the server's
    memory...

    Can anybody help me with this issue? Any comment or suggestion would
    be gratefuly accepted!

    greetings from Uruguay!
    Rafael Sisto
    --
    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/

  2. Re: shared memory

    Thank you for the quick answer, but It's a college project, and I must
    share user level memory. I also must build my own system calls...
    But I can look what is already done and make something similar. Do you
    think shmget would do? Does it share user level memory?

    greetings!
    Rafael Sisto

    On Dec 16, 2007 4:57 PM, Luciano Rocha wrote:
    > On Sun, Dec 16, 2007 at 04:51:39PM -0300, Rafael Sisto wrote:
    > > Hi, Im working on a project working on linux kernel 2.6.17
    > > I have to share memory on user level... I have to build something like
    > > a server process that "exports" a portion of his virtual memory, and
    > > other client process may ask the kernel for that memory and use it (as
    > > its own).
    > > I managed to build a structure on the kernel.

    >
    > Why? Aren't SysV IPC or Posix IPC enough?
    >
    > See "man shm_open", for the new Posix version, and "man shmget" for the
    > old SysV IPC version.
    >
    > --
    > Luciano Rocha
    > Eurotux Informática, S.A.
    >

    --
    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/

  3. Re: shared memory

    On Sun, Dec 16, 2007 at 05:01:17PM -0300, Rafael Sisto wrote:
    > Thank you for the quick answer, but It's a college project, and I must
    > share user level memory. I also must build my own system calls...
    > But I can look what is already done and make something similar. Do you
    > think shmget would do? Does it share user level memory?


    Yes. They both do, but the Posix one is based on a ramfs or tmpfs on
    /dev/shm and shared mmaps. I think analyzing the SysV version will be
    better for your needs.

    shmget: create the memory region
    shmat: attach the memory region to this process.

    --
    Luciano Rocha
    Eurotux Informática, S.A.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.7 (GNU/Linux)

    iD8DBQFHZab1inSul6a7oB8RAho4AJ41lNoJ7o/0CPaEZSVLsGevjmfUUACeNgtu
    H6yGlyFrHM75erbFFMtCFQc=
    =I1eL
    -----END PGP SIGNATURE-----


  4. Re: shared memory

    thanks a lot!!


    On Dec 16, 2007 7:30 PM, Luciano Rocha wrote:
    > On Sun, Dec 16, 2007 at 05:01:17PM -0300, Rafael Sisto wrote:
    > > Thank you for the quick answer, but It's a college project, and I must
    > > share user level memory. I also must build my own system calls...
    > > But I can look what is already done and make something similar. Do you
    > > think shmget would do? Does it share user level memory?

    >
    > Yes. They both do, but the Posix one is based on a ramfs or tmpfs on
    > /dev/shm and shared mmaps. I think analyzing the SysV version will be
    > better for your needs.
    >
    > shmget: create the memory region
    > shmat: attach the memory region to this process.
    >
    > --
    >
    > Luciano Rocha
    > Eurotux Informática, S.A.
    >

    --
    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/

+ Reply to Thread