Cannot Execute from MMC

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

evilclone
Posts: 7
Joined: Tue Apr 26, 2005 5:10 pm

Cannot Execute from MMC

Mon Jun 06, 2005 5:35 am

Hi,

I am attempting to execute a binary directly from a MultiMediaCard, using the latest 2.6.12-rc4 kernel patched with the RM9200 patches from http://maxim.org.za/AT91RM9200/2.6/

(vanilla 2.6.11 kernel, with patch-2.6.12-rc4 and 2.6.12-rc4-at91.patch)

I am using a 64MB MMC card that has been reformatted to contain an ext2 file system on a single partition, using a Belkin USB/MMC card adapter on my desktop Linux box. The file system is empty.

I have an AT91RM9200_EK kit, and am booting Linux as per the instructions given at http://www.at91.com/ (Getting Started with Atmel Linux). The root image is ramdisk_minimal.

The MMC card is freshly formatted, and the file system found on /dev/mmc/blk0/part1. I mount this file system, copy /bin/busybox across to it, and execute "/mnt/busybox ash". This successfully starts a new ash shell.

I then unmount the MMC file system, followed by a remount and attempt to start a new shell as before. The first two attempts to run /mnt/busybox ash fail, resulting in a segmentation fault. On the third and subsequent attempts it works.

This process can be repeated ad nausum, it requires three attempts to run the busybox executable from the MMC.

Any help appreciated. :-)

Regards,
Andrew Lewis

Code: Select all

Uncompressing Linux......................................................... done, booting the kernel.
Linux version 2.6.12-rc4-AT9RM9200EK (root@dagon) (gcc version 3.4.3) #1 Mon Jun 6 11:08:05 WST 2005  
CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)                                                   
CPU0: D VIVT write-back cache                    
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Machine: ATMEL AT91RM9200                                          
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists                                
Kernel command line: root=/dev/ram rw initrd=0x21100000,6000000 ramdisk_size=15360 console=ttyS0,115200 mem=32M
AT91: 128 gpio irqs in 4 banks                                                                                 
PID hash table entries: 256 (order: 8, 4096 bytes)
Console: colour dummy device 80x30                
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) 
Memory: 32MB = 32MB total                                   
Memory: 24716KB available (1404K code, 284K data, 80K init)
Mount-cache hash table entries: 512                        
CPU: Testing write buffer coherency: ok
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 5859K                                                   
NET: Registered protocol family 16
SCSI subsystem initialized        
NetWinder Floating Point Emulator V0.97 (extended precision)
audit: initializing netlink socket (disabled)               
audit(20.109:0): initialized                 
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: devfs_debug: 0x0                               
devfs: boot_options: 0x1
AT91 SPI driver loaded  
ttyS0 at MMIO 0xfefff200 (irq = 1) is a AT91_SERIAL
ttyS1 at MMIO 0xfefc4000 (irq = 7) is a AT91_SERIAL
io scheduler noop registered                       
io scheduler anticipatory registered
RAMDISK driver initialized: 16 RAM disks of 15360K size 1024 blocksize
eth0: Link now 100-FullDuplex                                         
eth0: AT91 ethernet at 0xfefbc000 int=24 100-FullDuplex (12:34:56:78:99:aa)
eth0: Davicom 9196 PHY (Copper)                                            
mice: PS/2 mouse device common for all mice
AT91RM9200 MCI initialized                 
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)        
TCP: Hash tables configured (established 2048 bind 2048)
NET: Registered protocol family 1                       
NET: Registered protocol family 17
mmcblk0: mmc0:0001 D0601 62720KiB 
 /dev/mmc/blk0: p1               
RAMDISK: Compressed image found at block 0
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).                                 
Mounted devfs on /dev               
Freeing init memory: 80K
init started:  BusyBox v0.60.5 (2004.09.01-13:48+0000) multi-call binary
Setting hostname ...
Setting Frame Buffer
Setting Stuff for gpm
ldconfig: No such file or directory
Sysinit done

Welcome to AT91RM9200EK Linux
AT91RM9200EK ramdisk (glibc-2.2.3)

Copyright (C) 2004 M. Amine SAYA (ATMEL)
Released under GNU GPL

AT91RM9200EK login: root
login[655]: root login  on `ttyS0'



BusyBox v0.60.5 (2004.09.08-17:38+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

[root @ AT91RM9200EK]# mount -t proc none /proc
[root @ AT91RM9200EK]# mount -t ext2 /dev/mmc/blk0/part1 /mnt     
[root @ AT91RM9200EK]# cp /bin/busybox /mnt
[root @ AT91RM9200EK]# /mnt/busybox ash


BusyBox v0.60.5 (2004.09.08-17:38+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

[root @ AT91RM9200EK]# exit
[root @ AT91RM9200EK]# umount /mnt
[root @ AT91RM9200EK]# mount -t ext2 /dev/mmc/blk0/part1 /mnt
[root @ AT91RM9200EK]# /mnt/busybox ash
Segmentation fault
[root @ AT91RM9200EK]# /mnt/busybox ash
Segmentation fault
[root @ AT91RM9200EK]# /mnt/busybox ash


BusyBox v0.60.5 (2004.09.08-17:38+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

[root @ AT91RM9200EK]# exit
[root @ AT91RM9200EK]# umount /mnt
[root @ AT91RM9200EK]# mount -t ext2 /dev/mmc/blk0/part1 /mnt
[root @ AT91RM9200EK]# /mnt/busybox ash
Segmentation fault
[root @ AT91RM9200EK]# /mnt/busybox ash
Segmentation fault
[root @ AT91RM9200EK]# /mnt/busybox ash


BusyBox v0.60.5 (2004.09.08-17:38+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

[root @ AT91RM9200EK]# 
evilclone
Posts: 7
Joined: Tue Apr 26, 2005 5:10 pm

Fix

Sun Jun 12, 2005 11:02 am

A patch to fix this problem is attached.
patrick.s
Posts: 12
Joined: Tue Mar 01, 2005 2:59 pm

Wed May 10, 2006 4:00 am

are there any typo error, you use kernel 2.6.11, while you use patch 2.6.12?


Also, the repy said there is attachment, but not found in anywhere.

Return to “LINUX”

Who is online

Users browsing this forum: Google [Bot] and 2 guests