Hi,
I have been trying to configure my eval
board to boot up using the ramdisk through an initrd.
I have included the initrd and ramdisk
support in the kernel configuration.
Under-attached is my .config file for
your reference.
.
.
.
.
#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not
set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not
set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not
set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not
set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_AMDSTD_RETRY=0
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
.
.
.
#
# NAND Flash Device Drivers
#
# CONFIG_MTD_NAND is not set
#
# Plug and Play support
#
#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
CONFIG_BLK_DEV_NBD=y
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_CDROM_PKTCDVD is not set
.
.
.
.
.
.
#
# File systems
#
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT3_FS is not set
# CONFIG_JBD is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
#
# XFS support
#
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
CONFIG_ROMFS_FS=y
# CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
CONFIG_AUTOFS4_FS=y
#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set
#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=y
# CONFIG_MSDOS_FS is not set
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_NTFS_FS is not set
#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_SYSFS=y
CONFIG_DEVFS_FS=y
# CONFIG_DEVFS_MOUNT is not set
# CONFIG_DEVFS_DEBUG is not set
# CONFIG_DEVPTS_FS_XATTR is not set
# CONFIG_TMPFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y
#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_JFFS_FS is not set
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
# CONFIG_JFFS2_FS_NAND is not set
# CONFIG_JFFS2_FS_NOR_ECC is not set
# CONFIG_JFFS2_COMPRESSION_OPTIONS is
not set
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_RTIME=y
# CONFIG_JFFS2_RUBIN is not set
CONFIG_CRAMFS=y
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
#
# Network File Systems
#
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_DIRECTIO is not set
# CONFIG_NFSD is not set
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_SUNRPC=y
# CONFIG_RPCSEC_GSS_KRB5 is not set
# CONFIG_RPCSEC_GSS_SPKM3 is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
.
.
.
.
.
.
However, during bootup it seems that
the kernel is unable to locate the correct magic number for the ext2fs
format initrd and refuses to bootup. The printk statements which I included
shows that the kernel seems to extract the magic number from the wrong
location in the function, identify_ramdisk_image of do_mounts_rd.c which
is suppose to be 'ef53' for the case of an ext2fs image. The bootargs which
i used are :
bootargs=console=ttyS1 root=/dev/ram0
The under-attached are the messages
from the console upon bootup.
U-Boot# bootm 10000 300000
## Booting image at 00010000 ...
Image Name: Linux-2.6.11-Cooper
Image Type: ARM
Linux Kernel Image (uncompressed)
Data Size: 1189964
Bytes = 1.1 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ...
OK
OK
## Loading Ramdisk Image at 00300000
...
Image Name: Ext2fs
Ramdisk Image
Image Type: ARM
Linux RAMDisk Image (gzip compressed)
Data Size: 415164
Bytes = 405.4 kB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ...
OK
## Transferring control to Linux (at
address 00008000) ...
Starting kernel ...
Uncompressing Linux..............................................................................
done, bootin
g the kernel.
Linux version 2.6.11-Cooper (root@debianworld)
(gcc version 3.4.4 20050314 (prerelease) (Debian 3.4.3-13)) #8
Mon Jul 25 15:31:15 SGT 2005
CPU: ARM926EJ-Sid(wb) [41069264] revision
4 (ARMv5TEJ)
CPU0: D VIVT write-back cache
CPU0: I cache: 8192 bytes, associativity
4, 32 byte lines, 64 sets
CPU0: D cache: 4096 bytes, associativity
4, 32 byte lines, 32 sets
Machine: NS9360
Memory policy: ECC disabled, Data cache
writeback
NS9360 Rev. 0, running at 176 MHz
Built 1 zonelists
Kernel command line: console=ttyS1 root=/dev/ram0
PID hash table entries: 128 (order:
7, 2048 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 4096
(order: 2, 16384 bytes)
Inode-cache hash table entries: 2048
(order: 1, 8192 bytes)
Memory: 16MB = 16MB total
Memory: 13240KB available (2001K code,
415K data, 100K init)
Mount-cache hash table entries: 512
(order: 0, 4096 bytes)
CPU: Testing write buffer coherency:
ok
checking if image is initramfs...it
isn't (bad gzip magic numbers); looks like an initrd
Freeing initrd memory: 405K
NET: Registered protocol family 16
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
i2c_ns: I2C ns9750 driver $Revision:
1.1 $ initializing
NetWinder Floating Point Emulator V0.97
(double precision)
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x0
JFFS2 version 2.2. (C) 2001-2003 Red
Hat, Inc.
ns9360fb: Using LCD display STN LCD
Console: switching to colour frame buffer
device 40x30
fb0: ns9360fb frame buffer device
NS9750 Watchdog initialized
Serial: NS9750 driver $Revision: 1.2
$
ttyS1 at MMIO 0xf9200040 (irq = 36)
is a NS9750
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks
of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
nbd: registered device at major 43
Setting GPIOs for NS9360 ethernet
Ethernet: NS9750 driver $Revision: 1.1
$
ns9360_map Using NOR Flash device: 4096
kB @ 0x50000000
NOR Flash memory mapped to virtual c1880000
AM29LV160DB: Found 2 x16 devices at
0x0 in 32-bit bank
Amd/Fujitsu Extended Query Table
at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program
due to code brokenness.
ns9360_map: using static partition definition
Creating 3 MTD partitions on "AM29LV160DB":
0x00000000-0x00040000 : "U-boot"
0x00040000-0x00180000 : "kernel"
0x00180000-0x00400000 : "initrd"
ns9360-ohci ns9360-ohci0: new USB bus
registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb 1-1: new full speed USB device using
ns9360-ohci and address 2
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.0:USB
HID core driver
mice: PS/2 mouse device common for all
mice
i2c /dev entries driver
NET: Registered protocol family 2
IP: routing cache hash table of 512
buckets, 4Kbytes
TCP established hash table entries:
1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order:
0, 4096 bytes)
TCP: Hash tables configured (established
1024 bind 1024)
NET: Registered protocol family 1
NET: Registered protocol family 17
RAMDISK: ext2sb->s_magic=e79b
RAMDISK: ext2sb->s_inodes_count=e121f003
RAMDISK: ext2sb->s_blocks_count=e5903014
RAMDISK: ext2sb->s_r_blocks_count=e2433001
RAMDISK: ext2sb->s_free_blocks_count=e5803014
RAMDISK: cpu_to_le16(EXT2_SUPER_MAGIC)=ef53
RAMDISK: start_block=0
RAMDISK: Couldn't find valid RAM disk
image starting at 0.
Kernel panic - not syncing: VFS: Unable
to mount root fs on unknown-block(1,0)
Is there anything which I have missed
out or done wrong?
Regards