* Running Linux with 2Mo of Ram.
@ 2003-06-12 15:53 Christophe.LINDHEIMER
2003-06-12 16:16 ` Mark Hatle
0 siblings, 1 reply; 8+ messages in thread
From: Christophe.LINDHEIMER @ 2003-06-12 15:53 UTC (permalink / raw)
To: linuxppc-embedded
Hi.
I am trying to run linux on a custom board ( Mpc8xx )
There is only 2Mo of RAM.
I use romfs to save RAM.
I use U-boot to start the kernel.
The kernel starts correctly.
the kernel is launched with init=/bin/sh
The kernel stops to tell me to press enter to activate the console ( to
launch the sh ) and then crash because it is running out of memory.
The question is to know if it is really impossible to make Linux work on
this target or is I have missed something that could explain that there is
no more memory available.
Thanks
Regards
Chris
--------------------------------
U-Boot 0.3.0 (Jun 4 2003 - 16:21:25)
CPU: XPC860xxZPnnC1 at 38.400 MHz: 4 kB I-Cache 4 kB D-Cache
DRAM: 2 MB
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
=> setenv bootargs root=/dev/mtdblock/1 ro init=/bin/sh
=> bootm 0x90000
## Booting image at 00090000 ...
Image Name: Crisssou Kernel Image
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 263950 Bytes = 257.8 kB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Linux version 2.4.4 (blinde@Linux) (gcc version 2.95.4 20010319
(prerelease/franzo/20011204)) #96 jeu jun 12 15:35:15 CEST 2003
On node 0 totalpages: 512
zone(0): 512 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock/1 ro init=/bin/sh
Decrementer Frequency: 2375000
Calibrating delay loop... 37.78 BogoMIPS
Memory: 1212k available (512k kernel code, 236k data, 32k init, 0k highmem)
Dentry-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 1024 (order: 0, 4096 bytes)
Inode-cache hash table entries: 512 (order: 0, 4096 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Starting kswapd v1.8
CPM UART driver version 0.03
ttyS0 on SMC1 at 0x0280, BRG1
block: queued sectors max/low 709kB/236kB, 64 slots per queue
devfs: v0.102 (20000622) Richard Gooch (rgooch@atnf.csiro.au)
devfs: devfs_debug: 0x0
devfs: boot_options: 0x0
pr4gv3 flash device: 400000 at 4000000
Amd/Fujitsu Extended Query Table v1.0 at 0x0040
number of JEDEC chips: 1
0: offset=0x0,size=0x8000,blocks=1
1: offset=0x8000,size=0x4000,blocks=2
2: offset=0x10000,size=0x10000,blocks=1
3: offset=0x20000,size=0x20000,blocks=31
Creating 2 MTD partitions on "Physically mapped flash":
0x00000000-0x00100000 : "ppcboot"
0x00100000-0x00400000 : "fs"
physmap flash device: 400000 at 4000000
Amd/Fujitsu Extended Query Table v1.0 at 0x0040
number of JEDEC chips: 1
0: offset=0x0,size=0x8000,blocks=1
1: offset=0x8000,size=0x4000,blocks=2
2: offset=0x10000,size=0x10000,blocks=1
3: offset=0x20000,size=0x20000,blocks=31
VFS: Mounted root (romfs filesystem) readonly.
Mounted devfs on /dev
Bummer, could not run '/etc/init.d/rcS': No such file or directory
device '/dev/tty4' does not exist.
device '/dev/tty3' does not exist.
device '/dev/tty2' does not exist.
Please press Enter to activate this console.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
device '/dev/tty2' does not exist.
Out of Memory: Killed process 1 (sh).
__alloc_pages: 0-order allocation failed.
VM: killing process sh
Kernel panic: Attempted to kill init!
Rebooting in 180 seconds..
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Running Linux with 2Mo of Ram.
2003-06-12 15:53 Running Linux with 2Mo of Ram Christophe.LINDHEIMER
@ 2003-06-12 16:16 ` Mark Hatle
2003-06-12 19:14 ` Wolfgang Grandegger
2003-06-12 21:53 ` Wolfgang Denk
0 siblings, 2 replies; 8+ messages in thread
From: Mark Hatle @ 2003-06-12 16:16 UTC (permalink / raw)
To: Christophe.LINDHEIMER; +Cc: linuxppc-embedded
Christophe.LINDHEIMER@fr.thalesgroup.com wrote:
> Hi.
>
> I am trying to run linux on a custom board ( Mpc8xx )
> There is only 2Mo of RAM.
> I use romfs to save RAM.
>
> I use U-boot to start the kernel.
>
> The kernel starts correctly.
> the kernel is launched with init=/bin/sh
>
> The kernel stops to tell me to press enter to activate the console ( to
> launch the sh ) and then crash because it is running out of memory.
>
> The question is to know if it is really impossible to make Linux work on
> this target or is I have missed something that could explain that there is
> no more memory available.
You will need some type of "execute in place", i.e. run the kernel and/or
userspace applications out of ROM in order to work with 2MB of RAM.
This type of thing is generally very board, processor and application specific.
So I don't believe there is existing (open source) code to do it.
--Mark
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Running Linux with 2Mo of Ram.
@ 2003-06-12 17:22 erik.teose
2003-06-12 18:02 ` Todd Poynor
2003-06-12 18:26 ` Dan Malek
0 siblings, 2 replies; 8+ messages in thread
From: erik.teose @ 2003-06-12 17:22 UTC (permalink / raw)
To: fray, Christophe.LINDHEIMER; +Cc: linuxppc-embedded
>You will need some type of "execute in place", i.e. run the
>kernel and/or
>userspace applications out of ROM in order to work with 2MB of RAM.
>
>This type of thing is generally very board, processor and
>application specific.
> So I don't believe there is existing (open source) code to do it.
>
>--Mark
MontaVista's "Consumer Electronics Edition" does xip (execute in place) from
rom. From what I understand, MV has been fairly good about folding their
updates back into the open source world (e.g. real time enhancements to the
kernel). Has this changed?
Erik
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Running Linux with 2Mo of Ram.
2003-06-12 17:22 erik.teose
@ 2003-06-12 18:02 ` Todd Poynor
2003-06-12 18:26 ` Dan Malek
1 sibling, 0 replies; 8+ messages in thread
From: Todd Poynor @ 2003-06-12 18:02 UTC (permalink / raw)
To: erik.teose; +Cc: fray, Christophe.LINDHEIMER, linuxppc-embedded
erik.teose@exgate.tek.com wrote:
> MontaVista's "Consumer Electronics Edition" does xip (execute in place) from
> rom. From what I understand, MV has been fairly good about folding their
> updates back into the open source world (e.g. real time enhancements to the
> kernel). Has this changed?
No. MontaVista has currently implemented XIP only on ARM (which is the
only arch supported in Consumer Electronics Edition at present), and we
contributed that code back to the ARM community. We are currently
working on other architectures and will contribute the code back to the
community as we go.
--
Todd
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Running Linux with 2Mo of Ram.
2003-06-12 17:22 erik.teose
2003-06-12 18:02 ` Todd Poynor
@ 2003-06-12 18:26 ` Dan Malek
1 sibling, 0 replies; 8+ messages in thread
From: Dan Malek @ 2003-06-12 18:26 UTC (permalink / raw)
To: erik.teose; +Cc: fray, Christophe.LINDHEIMER, linuxppc-embedded
erik.teose@exgate.tek.com wrote:
> MontaVista's "Consumer Electronics Edition" does xip (execute in place) from
> rom.
I wrote the original version of that several years ago for an mpc8xx
consumer product. I've been sitting on the patches ever since trying
to find a way to neatly make it part of at least the PowerPC tree.
Recent changes have made it easier to add the patch to the source
tree, but as Mark said it is very processor, board and application
specific. The patches would only work for the original product and
although the code would be easy to modify upon inspection for another
target, it isn't something that lends itself to configuration options.
The code should be modified to work with a more common off-the-shelf
board, and people could use that as an example.
However, xip is not a solution to simply not having enough memory
for the application. If you do a systems analysis, xip doesn't really
save that much memory, and depending upon the hardware design could
hinder the performance. In the particular application that started
this, we gained some performance by using large page mapping for the
code space, not so much for using less real memory for code. It
also provided a slightly faster boot up indication to the user that
the system had started operating. The large page mapping is the part
of the patch that I have integrated into the public sources.
Keep in mind that Linux is a dynamic operating system, and by itself
it does very little. The memory management Linux performs is based
completely on what the applications are asking it to do. Kernel hacks
and tricks are fun to do, but aren't going to provide a stable solution
to ill-behaved applications. The way applications are built and the
configuration of the necessary files to support them will have a much
more significant effect than xip on the utilization of system resources.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Running Linux with 2Mo of Ram.
2003-06-12 16:16 ` Mark Hatle
@ 2003-06-12 19:14 ` Wolfgang Grandegger
2003-06-12 21:53 ` Wolfgang Denk
1 sibling, 0 replies; 8+ messages in thread
From: Wolfgang Grandegger @ 2003-06-12 19:14 UTC (permalink / raw)
To: Mark Hatle; +Cc: Christophe.LINDHEIMER, linuxppc-embedded
On 06/12/2003 06:16 PM Mark Hatle wrote:
> Christophe.LINDHEIMER@fr.thalesgroup.com wrote:
>> Hi.
>>
>> I am trying to run linux on a custom board ( Mpc8xx )
>> There is only 2Mo of RAM.
>> I use romfs to save RAM.
>>
>> I use U-boot to start the kernel.
>>
>> The kernel starts correctly.
>> the kernel is launched with init=/bin/sh
>>
>> The kernel stops to tell me to press enter to activate the console ( to
>> launch the sh ) and then crash because it is running out of memory.
>>
>> The question is to know if it is really impossible to make Linux work on
>> this target or is I have missed something that could explain that there is
>> no more memory available.
>
> You will need some type of "execute in place", i.e. run the kernel and/or
> userspace applications out of ROM in order to work with 2MB of RAM.
>
> This type of thing is generally very board, processor and application specific.
> So I don't believe there is existing (open source) code to do it.
Some time ago I got XIP working for MPC 8xx with our DENX Linux 2.4.4
kernel by collecting and integrating the various pieces already around.
Below are some results about the amount of memory you can save. Note
that this is for our standard, normally RAMdisk based run time
environment SELF (see ftp://ftp.denx.de/pub/LinuxPPC/usr/src/SELF/). If
you have little RAM and plenty of Flash memory XIP might be an option.
Hope it's useful.
Wolfgang.
Normal kernel + linear cramfs (patched):
pImage: 538062
cramfs: 1081344
total: used: free: shared: buffers: cached:
Mem: 14921728 3866624 11055104 2781184 0 2240512
XIP kernel + linear cramfs:
pImage: 1395952
cramfs: 1081344
total: used: free: shared: buffers: cached:
Mem: 16175104 3940352 12234752 2822144 0 2240512
XIP kernel + XIP cramfs (chmod +t: busybox, initd, libc)
pImage: 1395952
cramfs: 1871872
total: used: free: shared: buffers: cached:
Mem: 16175104 2367488 13807616 610304 0 671744
The net saving is > 1.1MB + 1.5M = 2.6 MB.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Running Linux with 2Mo of Ram.
2003-06-12 16:16 ` Mark Hatle
2003-06-12 19:14 ` Wolfgang Grandegger
@ 2003-06-12 21:53 ` Wolfgang Denk
1 sibling, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2003-06-12 21:53 UTC (permalink / raw)
To: Mark Hatle; +Cc: Christophe.LINDHEIMER, linuxppc-embedded
In message <3EE8A746.7010901@mvista.com> you wrote:
>
> You will need some type of "execute in place", i.e. run the kernel and/or
> userspace applications out of ROM in order to work with 2MB of RAM.
>
> This type of thing is generally very board, processor and application specific.
> So I don't believe there is existing (open source) code to do it.
It's easy to add, at least for a 8xx system booting with U-Boot
(which supports XIP).
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
Brain fried - Core dumped
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Running Linux with 2Mo of Ram.
@ 2003-06-13 8:29 Christophe.LINDHEIMER
0 siblings, 0 replies; 8+ messages in thread
From: Christophe.LINDHEIMER @ 2003-06-13 8:29 UTC (permalink / raw)
To: linuxppc-embedded
Hi.
Thank you for all your answers.
Seems that I need to spend some time trying to understand xip :-)
more questions might come soon !!
Regards
Chris.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2003-06-13 8:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-12 15:53 Running Linux with 2Mo of Ram Christophe.LINDHEIMER
2003-06-12 16:16 ` Mark Hatle
2003-06-12 19:14 ` Wolfgang Grandegger
2003-06-12 21:53 ` Wolfgang Denk
-- strict thread matches above, loose matches on Subject: below --
2003-06-12 17:22 erik.teose
2003-06-12 18:02 ` Todd Poynor
2003-06-12 18:26 ` Dan Malek
2003-06-13 8:29 Christophe.LINDHEIMER
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).