linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* execute from flash?
@ 2002-02-25 20:17 Steven Blakeslee
  2002-02-25 20:50 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Blakeslee @ 2002-02-25 20:17 UTC (permalink / raw)
  To: 'linuxppc-embedded@lists.linuxppc.org'


Does anyone know how I can run a program in flash from my embedded linux
kernel that is also running in flash?  Below is the code that I tried but it
did not work.  It compiles but does not run correctly.

typedef int (codePtr(char *info));

void main(char *argv)
{
	int addr = 0xfff80000;
	codePtr* startloc = (codePtr *)addr;
	(startloc(argv));
}

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

* Re: execute from flash?
  2002-02-25 20:17 execute from flash? Steven Blakeslee
@ 2002-02-25 20:50 ` Wolfgang Denk
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2002-02-25 20:50 UTC (permalink / raw)
  To: Steven Blakeslee; +Cc: 'linuxppc-embedded@lists.linuxppc.org'


Steven,

in message <D73A25AA6E54D511AD74009027B1110F0F30B0@ORION> you wrote:
>
> Does anyone know how I can run a program in flash from my embedded linux
> kernel that is also running in flash?  Below is the code that I tried but it

I don't think your kernel is running from  flash.  It  is  stored  in
flash,  but  usually  then it gets loaded (and probably uncompressed)
into RAM, and is running from RAM.

YOu can do similar things whith your own code:  you  can  put  it  in
flash,  and load it from flash into RAM to run it. This requires that
you have some way to access  the  flash  memory  -  under  Unix  this
requires  either  a basic device driver (character device), or a more
sophisticated device driver (block device) that allows you to  put  a
filesystem in flash.

> 	int addr = 0xfff80000;

You cannot access arbitrary physical addresses  from  an  application
program.  Linux  uses  virtual memory, and you should get used to the
idea that you cannot access physical memory or devices except through
some special interfaces  provided  by  the  OS  (system  calls  which
usually require some device drivers).

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
I must follow the people.  Am I not their leader? - Benjamin Disraeli

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

* RE: execute from flash?
@ 2002-02-25 22:23 Petersen, David (MED, GEMS-IT)
  0 siblings, 0 replies; 3+ messages in thread
From: Petersen, David (MED, GEMS-IT) @ 2002-02-25 22:23 UTC (permalink / raw)
  To: 'Steven Blakeslee',
	'linuxppc-embedded@lists.linuxppc.org'


	Sure there are modifications for the cramfs filesystem that
utilizes the sticky bit to force those files to be aligned such that
they can be executed in flash. You can then place the cramfs filesystem
in flash and only execute the files that you have specifically tagged (
sticky bit) for execution.
	There are also modifictions to the kernel that allow execution
from flash.

I am using both modifications on a version of HH2.0 linux for our
hardware that is MPC823 based. I got from MVista to implement these
changes. I was hoping that it would show up in the next release of HH.
If want I will put together a tarball with the required file for you. My
current kernel is 2.4.2 but that should not pose to much of a problem.

-----Original Message-----
From: Steven Blakeslee [mailto:BlakesleeS@embeddedplanet.com]
Sent: Monday, February 25, 2002 2:17 PM
To: 'linuxppc-embedded@lists.linuxppc.org'
Subject: execute from flash?



Does anyone know how I can run a program in flash from my embedded linux
kernel that is also running in flash?  Below is the code that I tried
but it
did not work.  It compiles but does not run correctly.

typedef int (codePtr(char *info));

void main(char *argv)
{
	int addr = 0xfff80000;
	codePtr* startloc = (codePtr *)addr;
	(startloc(argv));
}


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2002-02-25 22:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-25 20:17 execute from flash? Steven Blakeslee
2002-02-25 20:50 ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2002-02-25 22:23 Petersen, David (MED, GEMS-IT)

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).