linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Conserving memory for an embedded application
@ 2002-09-25  6:25 Greg Ungerer
  2002-09-30  0:38 ` Pavel Machek
  0 siblings, 1 reply; 6+ messages in thread
From: Greg Ungerer @ 2002-09-25  6:25 UTC (permalink / raw)
  To: linux-kernel

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Wed, 25 Sep 2002 14:53, Michael D. Crawford wrote:
>> One question I have is whether it is possible to burn an uncompressed image
>> of the kernel into flash, and then boot the kernel in-place, so that it is
>> not copied to RAM when it runs.  Of course the kernel would need RAM for
>> its data structures and user programs, but it would seem to me I should be
>> able to run the kernel without making a RAM copy.
> The uclinux guys have eXecute In Place  - google search for uclinux and XIP 
> will produce a stack of hits - here's one:
> http://www.snapgear.com/tb20010618.html

Yep, we have this for uClinux. Currently we are only doing
this on MMU-less processors though, I haven't heard of anyone
doing kernel (or apps) XIP from flash on VM processors.

Kernel running direct from flash is reasonably easy to do
in uClinux, and pretty much all supported architectures can do it.
(The supported archiectures includes embedded Motorola m68k
(68306, 68328, 68332, 68360), Motorola ColdFire (5206, 5206e,
5249, 5272, 5307, 5407), MMUless ARM cores (Atmel/AT91,
NetSilicon/NET+ARM, Samsung/4510, Conexant/P52, etc),
SPARC LEON, NEC v850, OPENcores OR1000, NIOS core, i960,
and in the works SH2, and MIPS 4k.

We can do apps too, although on most architecture with no
VM this requires some compiler support for PIC code (either
using a GOT or only relative addressing). Currently this
is only done for the m68k, ColdFire and ARM platforms. This
would not be a problem for VM processors.

Most uClinux platforms only have flash, so this setup is
used extensively. And most people use read-only root filesystems
on flash to make them as small as possible. Someting like
the ROMfs type or CRAMfs are good options here.

I know others have mentioned performance here. But for most
people in this space it is the unit $ that is most important.
For simple uClinux systems using a 2.0.39 kernel you can run
in 2MiB of RAM if you don't want many apps (and you have
configured your kernel appropriaetely). That would be with 1MiB
of flash for kernel and small filesystem. Although you can trade
off RAM and flash here to get your best mix. I build demo
uClinux systems for the older Motorola ColdFire eval boards that
have 1MiB of RAM. And in that I run a 2.0.39 kernel and a shell,
with about 100k left over :-)  [And that is all in RAM, kernel +
filesystem + apps]

Many of the modern embedded 32bit CPU's have cache, and the slower
flash access speeds are well hidden anyway. Usually only a small
performance penalty. I have a demo board that I can configure
for either 32 or 16 bit memory, and the difference on most
benchmarks with that is about 10%.

Regards
Greg



------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Wizard        EMAIL:  gerg@snapgear.com
SnapGear Pty Ltd                               PHONE:    +61 7 3435 2888
825 Stanley St,                                  FAX:    +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia              WEB:   www.SnapGear.com


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Conserving memory for an embedded application
@ 2002-09-25  4:53 Michael D. Crawford
  2002-09-24 21:59 ` Brad Hards
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michael D. Crawford @ 2002-09-25  4:53 UTC (permalink / raw)
  To: linux-kernel

I am helping my client design an embedded hardware device that we may run Linux 
on.  An important concern is to minimize the amount of ROM and flash ram that 
the device has, both to save manufacturing cost and to minimize power consumption.

One question I have is whether it is possible to burn an uncompressed image of 
the kernel into flash, and then boot the kernel in-place, so that it is not 
copied to RAM when it runs.  Of course the kernel would need RAM for its data 
structures and user programs, but it would seem to me I should be able to run 
the kernel without making a RAM copy.

It would be OK if I had to mess with the bootloader to do this.

It would also be helpful if a filesystem image containing a user program could 
be burned into flash, and then the program run directly out of flash.  Some 
amount of RAM would be saved if the executing code were run from the flash ROM 
rather than being copied into RAM as would normally be the case when executing a 
demand-paged executable.

This last is probably not as important as running the kernel out of flash as I 
don't think the user program would be very large.

Also, what is the minimum amount of physical ram that you think I can get any 
version of the kernel later than 2.0 or so to run in?  I heard somewhere that 
someone can boot an x86 system with as little as 2MB of RAM.  Is that the case?

Thank you,

Mike
-- 
Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com/
crawford@goingware.com

      Tilting at Windmills for a Better Tomorrow.


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

end of thread, other threads:[~2002-10-01 22:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-25  6:25 Conserving memory for an embedded application Greg Ungerer
2002-09-30  0:38 ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2002-09-25  4:53 Michael D. Crawford
2002-09-24 21:59 ` Brad Hards
2002-09-25  0:52 ` Ralf Baechle
2002-09-25  5:18 ` Robert Schwebel

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