linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* shared memory
@ 2007-12-16 19:51 Rafael Sisto
  2007-12-16 19:57 ` Luciano Rocha
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael Sisto @ 2007-12-16 19:51 UTC (permalink / raw)
  To: Linux 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 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

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

* Re: shared memory
  2007-12-16 19:51 shared memory Rafael Sisto
@ 2007-12-16 19:57 ` Luciano Rocha
  2007-12-16 20:01   ` Rafael Sisto
  0 siblings, 1 reply; 7+ messages in thread
From: Luciano Rocha @ 2007-12-16 19:57 UTC (permalink / raw)
  To: Rafael Sisto; +Cc: Linux kernel

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

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 <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>

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

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

* Re: shared memory
  2007-12-16 19:57 ` Luciano Rocha
@ 2007-12-16 20:01   ` Rafael Sisto
  2007-12-16 22:30     ` Luciano Rocha
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael Sisto @ 2007-12-16 20:01 UTC (permalink / raw)
  To: Luciano Rocha, Rafael Sisto, Linux kernel

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 <luciano@eurotux.com> 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 <luciano@eurotux.com>
> Eurotux Informática, S.A. <http://www.eurotux.com/>
>

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

* Re: shared memory
  2007-12-16 20:01   ` Rafael Sisto
@ 2007-12-16 22:30     ` Luciano Rocha
  2007-12-16 23:52       ` Rafael Sisto
  0 siblings, 1 reply; 7+ messages in thread
From: Luciano Rocha @ 2007-12-16 22:30 UTC (permalink / raw)
  To: Rafael Sisto; +Cc: Linux kernel

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

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 <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>

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

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

* Re: shared memory
  2007-12-16 22:30     ` Luciano Rocha
@ 2007-12-16 23:52       ` Rafael Sisto
  0 siblings, 0 replies; 7+ messages in thread
From: Rafael Sisto @ 2007-12-16 23:52 UTC (permalink / raw)
  To: Luciano Rocha, Rafael Sisto, Linux kernel

thanks a lot!!


On Dec 16, 2007 7:30 PM, Luciano Rocha <luciano@eurotux.com> 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 <luciano@eurotux.com>
> Eurotux Informática, S.A. <http://www.eurotux.com/>
>

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

* Shared memory
@ 2005-03-10 20:39 Bloch, Jack
  0 siblings, 0 replies; 7+ messages in thread
From: Bloch, Jack @ 2005-03-10 20:39 UTC (permalink / raw)
  To: linux-kernel

Under a 2.4 Kernel, a maximum of 2GB shared memory was allowed to be
attached to by each process. Is this still the same under a 2.6 Kernel? Is
this configurable? Please CC me on any responses.


Thank's in advance


Jack

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

* shared memory
@ 2001-11-20  3:57 Lee Chin
  0 siblings, 0 replies; 7+ messages in thread
From: Lee Chin @ 2001-11-20  3:57 UTC (permalink / raw)
  To: linux-kernel

Hi,
How do you allocate shared memory in the 2.4 kernel
now?  I added the line to fstab.. but how do I create
the /dev directory?

Thanks
Lee

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

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

end of thread, other threads:[~2007-12-16 23:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-16 19:51 shared memory Rafael Sisto
2007-12-16 19:57 ` Luciano Rocha
2007-12-16 20:01   ` Rafael Sisto
2007-12-16 22:30     ` Luciano Rocha
2007-12-16 23:52       ` Rafael Sisto
  -- strict thread matches above, loose matches on Subject: below --
2005-03-10 20:39 Shared memory Bloch, Jack
2001-11-20  3:57 shared memory Lee Chin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).