Skip to contentSkip to conversation

Conserving memory for an embedded application

DISCUSSION Michael D. Crawford 4 participants 4 messages Sep 24, 2002 – Sep 25, 2002

lore
Share & tools
lore
#0 lore raw

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

Signature · 6 lines
Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com/
[email protected]

     Tilting at Windmills for a Better Tomorrow.
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Michael D. Crawford

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

Brad
- --
http://conf.linux.org.au. 22-25Jan2003. Perth, Aust. Tickets booked. -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9kOBRW6pHgIdAuOMRAvEKAKCdutujZNT2tBk8gxkjkVz1ColD0wCdGZr+ 75U01oH+2G4UWiJSk59/CBU=
=SJGg
-----END PGP SIGNATURE-----

#2 lore raw
In reply to Michael D. Crawford
Quoted 8 lines · Michael D. Crawford

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.

Flash is much slower than normal memory so if you want any performance beyond the level of Eniac I suggest to copy it to RAM ...

Quoted 5 lines

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?

That's rather old kernels and also heavily hacked.

Ralf

#3 lore raw
In reply to Michael D. Crawford
Quoted 4 lines · Michael D. Crawford

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.

IMHO this isn't worth the efford. Flash is slow and (per kbyte) more expensive than RAM, so I would'n waste too much time on this if you don't plan to make more than >10000 pieces of your device. If you care for power consumption use another architecture than x86.

Quoted 2 lines

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.

Use jffs2 for the root file system.

Quoted 4 lines

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?

This depends on which drivers you need, how much stuff you need in userspace and how memory hungry your application is. Running a 2.4 kernel with busybox/uclibc in 2 MB RAM is possible.

Robert

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Braunschweiger Str. 79,  31134 Hildesheim, Germany
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
    Phone: +49-5121-28619-0 |  Fax: +49-5121-28619-4