David thanks for the reply

ok flthdr romfs/bin/sh reads

Magic:            bFLT
Rev:                4
Entry:            0x44
Data start:      0xe720
Data end:        0x111f0
bss end:           0x12750
stack size:      0x1000
Reloc start:        0x111f0
reloc count:        0x42
FLags:                0x2    (Has-PIC-GOT)

therefore the file system is XIP right? next I added in the bFLT debug code and 
commented out the line below in rc script just to see if that helped

 /bin/expand /etc/ramfs.img /dev/ram1

and I got the output below as you can see the kernel gets a little closer 
however it still kills sh. looking at the output romfs is only taking up

80108 bytes
20612 bytes

in total 98kb before the kernel crashes. The kernel reports on startup

Memory: 900KB available (690K code, 80K data, 4K init)                          
                            

the romfs takes 98k then the kernel crashes so there should be 900kb - 98Kb = 
802kb left however the kernel moans saying

Free pages:         172kB (0kB HighMem)

Where is the other 802kb - 172kb = 603kb going ? anyone have any ideas ?   

Freeing init memory: 4K
BINFMT_FLAT: ROM mapping of file (we hope)
BINFMT_FLAT: Allocated data+bss+stack (80108 bytes): 100a0004
p=100bfffc
start_thread(regs=0x10033f68, entry=0x10040044, start_stack=0x100bffb4)
BINFMT_FLAT: ROM mapping of file (we hope)
BINFMT_FLAT: Allocated data+bss+stack (20612 bytes): 100e0004
p=100e7ffc
start_thread(regs=0x10097fb0, entry=0x100d0044, start_stack=0x100e7f9c)
Shell invoked to run file: /etc/rc
Command: hostname NXP-LPC2468
Command: mount -t proc proc /proc
Command: cat /etc/motd
Welcome to
          ____ _  _
         /  __| ||_|
    _   _| |  | | _ ____  _   _  _  _
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|

For further information check:
http://www.uclinux.org/

Command: sh
BINFMT_FLAT: ROM mapping of file (we hope)
oom-killer: gfp_mask=0xd0
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1
cpu 0 cold: low 0, high 2, batch 1
Normal per-cpu: empty
HighMem per-cpu: empty

Free pages:         172kB (0kB HighMem)
Active:2 inactive:8 dirty:0 writeback:0 unstable:0 free:43 slab:140 mapped:0 pag
etables:0
DMA free:172kB min:128kB low:160kB high:192kB active:8kB inactive:32kB present:1
024kB pages_scanned:2 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pag
es_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB present:
0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 1*4kB 3*8kB 3*16kB 1*32kB 1*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB
0*4096kB = 172kB
Normal: empty
HighMem: empty
Out of Memory: Killed process 13 (sh).
BINFMT_FLAT: Allocated data+bss+stack (20603 bytes): 100e8004
sh: page allocation failure. order:0, mode:0x1d2
p=100efffc
start_thread(regs=0x10083fb0, entry=0x100f0044, start_stack=0x100effa4)
Execution Finished, Exiting

David McCullough <[EMAIL PROTECTED]> wrote: 
Jivin steven taffs lays it down ...
> Hi guys
> 
> ok when swapping to uClinux-dist-2005 I forgot to add mtd & mtdblocks to the 
> vendor makefile I have now added these. However I still get the same errors I 
> have been reading a past post and I think the problem is that uClinux does 
> not save space after _ebss for the ram mtd drive on a arm7 device. I think to 
> use uclinux.c I need to change init.c and maybe more files within the mm 
> folder.
> 
> I decided to write my own map file actelm7.map and used "map_rom" to probe 
> the flash device and split it into partitions. I got the following output 
> from the kernel below, as you can see the shell starts up however when it 
> tries to load ramfs.img the kernel looks like it runs out of memory. I have 
> one meg of ram within my system the kernels data takes up about 100k the rest 
> of the kernel is XIP therefore I should have about 900k free. The romfs is 
> also xip so why does the kernel run out of memory ? how much memory do I need 
> to load the romfs  using mtd ?

What is the output of:

 flthdr romfs/bin/sh

This will tell you if app is XIP or not.

Turn on the debug in binfmt_flat.c to make sure you are getting XIP.
Also,  make sure that your mtd/system knows that it is in rom.  On 2.4
systems there used to be a is_in_rom function that you need to make sure
is correct.  On 2.6 you need to ensure that the underlying device can
support direct mappings.  IIRC the BDI_CAP_MAP_DIRECT is needed to
provide this functionality,  althought only ramfs and char devs seem to
implement it.  You need romfs (or MTD under romfs to do this or
something) under 2.6,  expect to spend some time figuring that out :-(.
For reference look in:

 fs/ramfs/inode.c
 fs/char_dev.c

Then work out how to get

 fs/romfs/inode.c

to do it, and post the patch when you do :-) :-)

Cheers,
Davidm


> 
> CPU: Philips-LPC22xx [22000000] (ARMv3)                                       
> Machine: LPC22xx, PHILIPS ELECTRONICS Co., Ltd.                               
>                 
> Built 1 zonelists                 
> Kernel command line: console=ttyS0,115200n8 root=/dev/mtdblock2               
>                                                 
> PID hash table entries: 16 (order: 4, 256 bytes)                              
>                   
> Dentry cache hash table entries: 256 (order: -2, 1024 bytes)                  
>                                           
> Inode-cache hash table entries: 128 (order: -3, 512 bytes)                    
>                                       
> Memory: 1MB = 1MB total                       
> Memory: 900KB available (690K code, 80K data, 4K init)                        
>                               
> Mount-cache hash table entries: 512 (order: 0, 4096 bytes)                    
>                                       
> Linux NoNET1.0 for Linux 2.6                            
> Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled     
>                                                                     
> þttyS0 at MMIO 0x0 (irq = 1) is a 16550A 
> io scheduler noop registered                            
> loop: loaded (max 8 devices)                            
> Probing for flash chips at 0x00000000:                                      
> INTEL: Flash at 0x00000000                          
> Creating 4 MTD partitions on "ACTELM7 FLASH":                                 
>             
> 0x00000000-0x00080000 : "u-boot"                                
> mtd: Giving out device 0 to u-boot                                  
> 0x00080000-0x00180000 : "Kernel"                                
> mtd: Giving out device 1 to Kernel                                  
> 0x00180000-0x001fd000 : "Flash FS"                                  
> mtd: Giving out device 2 to Flash FS                                    
> 0x001fd000-0x01000000 : "Not used"                                  
> mtd: Giving out device 3 to Not used                                    
> *****     
> VFS: test  name =                              
> VFS: fs_name =                      
> VFS: fs_name =                       
> VFS: tried fs_name =  err -22                                   
> VFS: Mounted root (romfs filesystem) readonly.                                
>               
> VFS: tried fs_name =  err 0                                  
> Freeing init memory: 4K                       
> Shell invoked to run file: /etc/rc                                  
> Command: hostname NXP-LPC2468                             
> Command: /bin/expand /etc/ramfs.img /dev/ram1                                 
>             
> oom-killer: gfp_mask=0xd0
> 
> DMA per-cpu:
> cpu 0 hot: low 2, high 6, batch 1
> cpu 0 cold: low 0, high 2, batch 1
> Normal per-cpu: empty
> HighMem per-cpu: empty
> 
> Free pages:         144kB (0kB HighMem)
> Active:0 inactive:27 dirty:0 writeback:0 unstable:0 free:36 slab:137 mapped:0 
> pa
> getables:0
> DMA free:144kB min:128kB low:160kB high:192kB active:0kB inactive:108kB 
> present:
> 1024kB pages_scanned:29 all_unreclaimable? no
> lowmem_reserve[]: 0 0 0
> Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB 
> pag
> es_scanned:0 all_unreclaimable? no
> lowmem_reserve[]: 0 0 0
> HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB 
> present:
> 0kB pages_scanned:0 all_unreclaimable? no
> lowmem_reserve[]: 0 0 0
> DMA: 2*4kB 3*8kB 1*16kB 1*32kB 1*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 
> 0*2048kB
> 0*4096kB = 144kB
> Normal: empty
> HighMem: empty
> Out of Memory: Killed process 12 (sh).    
> 
> rwarner  wrote: Greg Ungerer wrote:
> > Hi Steven,
> > 
> > steven taffs wrote:
> >> still cant get to ROMFS loaded, I downloaded a uClinux-dist-2005 and 
> >> copyed my linux-2.6.x directory into it and now I can compile jffs2 
> >> but that still doesnt help me load the ROMFS
> >>  
> >> I am currently loading the romfs image from flash @ 0x180000 into ram 
> >> at 0x1001c26c (_ebss) using the cp.b uboot command and then executing 
> >> the kernel with go 0x80000.
> >> uclinux.c seems to be working however I get
> >  >
> >> Kernel panic - not syncing: No init found.  Try passing init= option 
> >> to kernel
> > 
> > Booting to this point suggests that your are past mounting
> > the ROMfs.
> > 
> > Do you have a valid "/sbin/init", "/etc/init", "/bin/init" or
> > "/bin/sh" in your ROMfs for the kernel to run?
> > 
> > 
> >> if I dont copy ROMFS from flash to ram before executing the kernel
> >>  
> >> VFS fails to mount a file system, so the kernel must be seeing 
> >> something has anyone get any ideas ? the full kernel output follows
> >>  
> >> RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
> >> loop: loaded (max 8 devices)
> >> uclinux[mtd]: RAM probe address=0x1001c26c size=0x100000
> >> Creating 1 MTD partitions on "RAM":
> >> 0x00000000-0x00100000 : "ROMfs"
> >> mtd: Giving out device 0 to ROMfs
> >> uclinux[mtd]: set ROMfs to be root filesystem
> >> *****
> >> VFS: test  name = 
> >> VFS: fs_name = 
> >> mtdblock_open
> >> ok
> >> mtdblock: read on "ROMfs" at 0x0, size 0x200
> >> mtdblock: read on "ROMfs" at 0x200, size 0x200
> >> VFS: Mounted root (romfs filesystem) readonly.
> >> VFS: tried fs_name =  err 0
> >> Freeing init memory: 4K
> >> mtdblock: read on "ROMfs" at 0x3000, size 0x200
> >> mtdblock: read on "ROMfs" at 0x3200, size 0x200
> >> Warning: unable to open an initial console.
> > 
> > Have you created device nodes in your ROMfs?
> > 
> > 
> >> mtdblock: read on "ROMfs" at 0xc00, size 0x200
> >> mtdblock: read on "ROMfs" at 0xe00, size 0x200
> >> Kernel panic - not syncing: No init found.  Try passing init= option 
> >> to kernel.
> > 
> 
> Having just gone through this.  You be missing the the poriotn of the 
> Vendor Make file.  Example on the AT91 is:
> DEVICES = \
>  tty,c,5,0      console,c,5,1      cua0,c,5,64      cua1,c,5,65  \
>  \
>  mem,c,1,1      kmem,c,1,2         null,c,1,3       ram0,b,1,0 \
>  ram1,b,1,1 \
>  \
> 
>  ttypc,c,3,12   ttypd,c,3,13       ttype,c,3,14     ttypf,c,3,15 \
>  \
>  mtd0,c,90,0        mtd1,c,90,2        mtd2,c,90,4 \
>  \
>  mtdblock0,b,31,0   mtdblock1,b,31,2  mtdblock2,b,31,4 \
>  \
>  zero,c,1,5     random,c,1,8       urandom,c,1,9
> 
> hths - bob
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev@uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev@uclinux.org
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev
> 
> 
>        
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev@uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev@uclinux.org
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev

-- 
David McCullough,  [EMAIL PROTECTED],   Ph:+61 734352815
Secure Computing - SnapGear  http://www.uCdot.org   http://www.snapgear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


       
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to