Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Exec from Memory
@ 2003-02-18 22:08 Maurice Turcotte
  2003-02-18 22:15 ` Greg Lindahl
  2003-02-18 22:22 ` Justin Carlson
  0 siblings, 2 replies; 4+ messages in thread
From: Maurice Turcotte @ 2003-02-18 22:08 UTC (permalink / raw)
  To: linux-mips

Greetings:

I have a hypothetical linux-mips question posed by a colleage.

Suppose there is no file system available, since there is no disk. And
suppose that I had the capability to place an elf file in a known location
in memory. How would I execute it? It seems like exec really wants a file
name. BTW, this needs to run in use space, not kernel.

Any helpful pointers? Is there a FAQ that might address this?

mrt

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

* Re: Exec from Memory
  2003-02-18 22:08 Exec from Memory Maurice Turcotte
@ 2003-02-18 22:15 ` Greg Lindahl
  2003-02-18 22:22 ` Justin Carlson
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Lindahl @ 2003-02-18 22:15 UTC (permalink / raw)
  To: linux-mips

On Tue, Feb 18, 2003 at 05:08:51PM -0500, Maurice Turcotte wrote:

> Suppose there is no file system available, since there is no disk.

You lost me, there. Linux has filesystems like /dev, /proc, and for
your current dilemma, it has some "ramdisk" filesystems which are
careful not to not make a duplicate copy of a file when you mmap it.

So you can execute code right out of that filesystem without much
extra overhead.

If you don't want to keep a copy of the entire program in RAM (some of
it might not be executed at all or only once), then NFS mount a
remotely filesystem and run it from there.

-- greg

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

* Re: Exec from Memory
  2003-02-18 22:08 Exec from Memory Maurice Turcotte
  2003-02-18 22:15 ` Greg Lindahl
@ 2003-02-18 22:22 ` Justin Carlson
  1 sibling, 0 replies; 4+ messages in thread
From: Justin Carlson @ 2003-02-18 22:22 UTC (permalink / raw)
  To: turcotte; +Cc: linux-mips

On Tue, 2003-02-18 at 17:08, Maurice Turcotte wrote:
> Greetings:
> 
> I have a hypothetical linux-mips question posed by a colleage.
> 
> Suppose there is no file system available, since there is no disk. And
> suppose that I had the capability to place an elf file in a known location
> in memory. How would I execute it? It seems like exec really wants a file
> name. BTW, this needs to run in use space, not kernel.
> 

There's no easy way (that know of) around the filesystem abstraction. 
You're going to have to deal with it in some manner.  Really basic
stuff, like the elf loader, depends on vfs abstractions.  While it's
possible to bypass all that, it would be a *lot* of work, and a lot of
nearly-duplicated code.

I can see a couple of options.  Other people might have better
suggestions.  :)

1) Use the embedded root ramdisk functionality in the kernel.  Make your
elf file /sbin/init, and run with it.

2) Hack a quick filesystem that uses a contiguous chunk of memory that
you either hardcode or pass in on the kernel command line.

-Justin

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

* RE: Exec from Memory
@ 2003-02-18 22:26 Mitchell, Earl
  0 siblings, 0 replies; 4+ messages in thread
From: Mitchell, Earl @ 2003-02-18 22:26 UTC (permalink / raw)
  To: turcotte; +Cc: linux-mips

You don't have to have disk to use filesystem.
Lot of people using CompactFlash to hold filesystem.
There is also the NFS option. 

-earlm

> -----Original Message-----
> From: Justin Carlson [mailto:justinca@cs.cmu.edu]
> Sent: Tuesday, February 18, 2003 2:22 PM
> To: turcotte@broadcom.com
> Cc: linux-mips@linux-mips.org
> Subject: Re: Exec from Memory
> 
> On Tue, 2003-02-18 at 17:08, Maurice Turcotte wrote:
> > Greetings:
> >
> > I have a hypothetical linux-mips question posed by a colleage.
> >
> > Suppose there is no file system available, since there is no disk. And
> > suppose that I had the capability to place an elf file in a known
> location
> > in memory. How would I execute it? It seems like exec really wants a
> file
> > name. BTW, this needs to run in use space, not kernel.
> >
> 
> There's no easy way (that know of) around the filesystem abstraction.
> You're going to have to deal with it in some manner.  Really basic
> stuff, like the elf loader, depends on vfs abstractions.  While it's
> possible to bypass all that, it would be a *lot* of work, and a lot of
> nearly-duplicated code.
> 
> I can see a couple of options.  Other people might have better
> suggestions.  :)
> 
> 1) Use the embedded root ramdisk functionality in the kernel.  Make your
> elf file /sbin/init, and run with it.
> 
> 2) Hack a quick filesystem that uses a contiguous chunk of memory that
> you either hardcode or pass in on the kernel command line.
> 
> -Justin
> 

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

end of thread, other threads:[~2003-02-18 22:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-18 22:08 Exec from Memory Maurice Turcotte
2003-02-18 22:15 ` Greg Lindahl
2003-02-18 22:22 ` Justin Carlson
  -- strict thread matches above, loose matches on Subject: below --
2003-02-18 22:26 Mitchell, Earl

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