+ -
当前位置:首页 → 问答吧 → 求助 Linux2.6.18.3在ARM2410上移植出错

求助 Linux2.6.18.3在ARM2410上移植出错

时间:2007-11-14

来源:互联网

vivi> param set linux_cmd_line "noinitrd root=/dev/mtdblock3 init=/linuxrc conso
le=ttySAC0"
Change linux command line to "noinitrd root=/dev/mtdblock3 init=/linuxrc console
=ttySAC0"
vivi> boot
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x002d0000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySA
C0"
MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux.............................................................
.............. done, booting the kernel.
Linux version 2.6.18.3 ([email protected]) (gcc 版本 4.1.0) #2 Tue No
v 6 10:20:50 CST 2007
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2410
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
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
Built 1 zonelists.  Total pages: 16384
Kernel command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0
irq: clearing pending ext status 00000100
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 512 (order: 9, 2048 bytes)
timer tcon=00000000, tcnt a509, tcfg 00000200,00000000, usec 00001e4c
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: 64MB = 64MB total
Memory: 62464KB available (1908K code, 428K data, 96K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2410: Initialising architecture
kobject_add failed for s3c2410-nand with -EEXIST, don't try to register things w
ith the same name in the same directory.
s3c24xx: failed to add board device s3c2410-nand (-17) @c0203de4
usbcore: registered new driver usbfs
usbcore: registered new driver hub
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 2048 bind 1024)
TCP reno registered
S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Console: switching to colour frame buffer device 80x25
fb0: Virtual frame buffer device, using 1024K of video memory
S3C2410 RTC, (c) 2004 Simtec Electronics
s3c2410-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand s3c2410-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit
)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 8 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00004000 : "Boot Agent"
0x00000000-0x00200000 : "S3C2410 flash partition 1"
0x00400000-0x00800000 : "S3C2410 flash partition 2"
0x00800000-0x00a00000 : "S3C2410 flash partition 3"
0x00a00000-0x00e00000 : "S3C2410 flash partition 4"
0x00e00000-0x01800000 : "S3C2410 flash partition 5"
0x01800000-0x03000000 : "S3C2410 flash partition 6"
0x03000000-0x04000000 : "S3C2410 flash partition 7"
usbmon: debugfs is not available
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.6:USB HID core driver
mice: PS/2 mouse device common for all mice
TCP bic registered
NET: Registered protocol family 1
No filesystem could mount root, tried:  cramfs romfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)      

作者: tanglihui   发布时间: 2007-11-14

根文件系统有烧进去吗?      

作者: flag   发布时间: 2007-11-15

根文件系统烧进去了
我本来设置的Kernel cmd line是下面这个
Kernel command line: noinitrd root=/dev/bon/3 init=/linuxrc console=ttySAC0 cons
ole=tty0
这样也会出错,然后我把它改成了noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0 跟内核的那个kernel boot string设置成一样的然后就出了上面的错,第一次的错误如下
VIVI version 0.1.4 ([email protected]) (gcc version 2.95.2 20000516 (re
lease) [Rebel.com]) #0.1.4 日 11月 4 20:12:48 CST 2007
MMU table base address = 0x33DFC000
Succeed memory mapping.
NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V0M)
Could not found stored vivi parameters. Use default vivi parameters.
Press Return to start the LINUX now, any other key for vivi
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x002d0000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/bon/3 init=/linuxrc console=ttySAC0 c
onsole=tty0"
MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux.............................................................
........... done, booting the kernel.
Linux version 2.6.18.3 ([email protected]) (gcc 鐗堟湰 4.1.0) #1 Sun No
v 4 17:02:18 CST 2007
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2410
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
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
Built 1 zonelists.  Total pages: 16384
Kernel command line: noinitrd root=/dev/bon/3 init=/linuxrc console=ttySAC0 cons
ole=tty0
irq: clearing pending ext status 00000100
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 512 (order: 9, 2048 bytes)
timer tcon=00000000, tcnt a509, tcfg 00000200,00000000, usec 00001e4c
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: 64MB = 64MB total
Memory: 62592KB available (1816K code, 418K data, 92K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2410: Initialising architecture
kobject_add failed for s3c2410-nand with -EEXIST, don't try to register things w
ith the same name in the same directory.
s3c24xx: failed to add board device s3c2410-nand (-17) @c01ebde4
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 2048 bind 1024)
TCP reno registered
S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Console: switching to colour frame buffer device 80x25
fb0: Virtual frame buffer device, using 1024K of video memory
S3C2410 RTC, (c) 2004 Simtec Electronics
s3c2410-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand s3c2410-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit
)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 8 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00004000 : "Boot Agent"
0x00000000-0x00200000 : "S3C2410 flash partition 1"
0x00400000-0x00800000 : "S3C2410 flash partition 2"
0x00800000-0x00a00000 : "S3C2410 flash partition 3"
0x00a00000-0x00e00000 : "S3C2410 flash partition 4"
0x00e00000-0x01800000 : "S3C2410 flash partition 5"
0x01800000-0x03000000 : "S3C2410 flash partition 6"
0x03000000-0x04000000 : "S3C2410 flash partition 7"
mice: PS/2 mouse device common for all mice
TCP bic registered
NET: Registered protocol family 1
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "bon/3" or unknown-block(2,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

//////////////////////////////////////////////////////////////////////////////////
vivi
////////////////////////////////////////////////////////////////////////////////////
vivi> part show
mtdpart info. (5 partitions)
name              offset        size        flag
------------------------------------------------
vivi            : 0x00000000    0x00020000     0  128k
param           : 0x00020000    0x00010000     0   64k
kernel          : 0x00030000    0x002d0000     0    2M+832k
root            : 0x00300000    0x00300000     4    3M
jffs2           : 0x00600000    0x03930000     8   57M+192k
vivi> param show
Number of parameters: 9
name                    :          hex             integer
-------------------------------------------------------------
mach_type               :       000000c1                  193
media_type              :       00000003                    3
boot_mem_base           :       30000000            805306368
baudrate                :       0001c200               115200
xmodem_one_nak          :       00000000                    0
xmodem_initial_timeout  :       000493e0               300000
xmodem_timeout          :       000f4240              1000000
ymodem_initial_timeout  :       0016e360              1500000
boot_delay              :       01000000             16777216
Linux command line: noinitrd root=/dev/bon/3 init=/linuxrc console=ttySAC0 conso
le=tty0
vivi>      

作者: tanglihui   发布时间: 2007-11-15

不知道你那个内核的驱动里是不是mtdblock3哦      

作者: flag   发布时间: 2007-11-15

看你的出错信息 应该是内核没找到根文件系统  

你在vivi中把根文件系统设置成 root=/dev/bon/3 或者 root=/dev/mtdblock3   这可不是乱设置的  这是根据做的根文件系统里的 /dev 下面的设备节点来设置的 (当然也和你内核里的MTD相联系) 看你根文件系统下的mtdblockN(N=0,1,2...) 建了没

看你这个错误 :VFS: Cannot open root device "bon/3" or unknown-block(2,0)
说明 /dev 下面没bon/3   

再看你这个错误:No filesystem could mount root, tried:  cramfs romfs
说明内核到/dev/mtdblock3 找根文件系统了 只不过没找到  所以报错.这错误还给我们一个信息,那就是flash是以块设备的形式(mtdblock)组织的

我们可以用个苯点的法子来解决这个问题: 在vivi下设置启动参数时 其中的 root=/dev/mtdblock3 把3改为 1 2 4 5 6 一个一个来试.

顺便说一句

我们开始的时候最后通过网络挂根文件系统的方式来调板子和程序.

你的MTD分区名字最好能重新命名一下  方便调试 呵呵      

作者: a3563   发布时间: 2007-11-15

root            : 0x00300000    0x00300000     4    3M

0x00000000-0x00200000 : "S3C2410 flash partition 1"
0x00400000-0x00800000 : "S3C2410 flash partition 2"
0x00800000-0x00a00000 : "S3C2410 flash partition 3"
0x00a00000-0x00e00000 : "S3C2410 flash partition 4"
0x00e00000-0x01800000 : "S3C2410 flash partition 5"
0x01800000-0x03000000 : "S3C2410 flash partition 6"
0x03000000-0x04000000 : "S3C2410 flash partition 7"
晕,咋不像是在你那个分区上哦?      

作者: flag   发布时间: 2007-11-16

我也觉得是内核里的Flash分区没有生效,我再重新编译一个内核试试
谢谢版主!!      

作者: tanglihui   发布时间: 2007-11-16

1.
///////////////////////////////////////////////////////////
Creating 8 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00004000 : "Boot Agent"
0x00000000-0x00200000 : "S3C2410 flash partition 1"
0x00400000-0x00800000 : "S3C2410 flash partition 2"
0x00800000-0x00a00000 : "S3C2410 flash partition 3"
0x00a00000-0x00e00000 : "S3C2410 flash partition 4"
0x00e00000-0x01800000 : "S3C2410 flash partition 5"
0x01800000-0x03000000 : "S3C2410 flash partition 6"
0x03000000-0x04000000 : "S3C2410 flash partition 7"
////////////////////////////////////////////////////////
在/arch/arm/match-s3c2410/devs.c中添加的内核分区没有生效。
应该在arch/arm/match-s3c2410/common-smdk.c中修改分区信息

2.
vivi中的linux_cmd_line设置改为
noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0



修改了内核MTD分区后,内核可以启动,根文件系统算是挂载上并且可以进入Shell
但是根文件系统还有些问题
我参考的这篇文章做得
///////////////////////////////////////////////////////////////////////////////////////////////////////
1. busybox的编译

-----------------------------------------------------------------------------
一 修改busybox中的 Makefile文件
找到 ARCH 和 CROSS_COMPILE 修改成如下
ARCH               ?= arm
CROSS_COMPILE      ?= /usr/local/arm/3.3.2/bin/arm-linux-

二 配置

[root@localhost busybox-1.4.2]# make defconfig
[root@localhost busybox-1.4.2]# make xconfig
=============================================
修改配置 主要修改如下
=============================================
Busybox Settings
        Build Options
      
  • Build BusyBox as a static binary   
             //选此项静态编译。

    Miscellaneous Utilities
            []taskset       //选了就会出错

    -------------------------------------------------
    三 编译
    [root@localhost busybox-1.5.1]# make all install
    -----------------------------------------------------------------
    最后会在 busybox-1.5.1/_install/目录生成你要的 bin sbin usr 目录
    ------------------------------------------------------------------

    2. 编写linuxrc 文件
    -----------------------------------------------------------------
    #!/bin/sh
    #echo "mount /etc as ramfs"
    /bin/mount -n -t ramfs ramfs /etc
    /bin/cp -a /mnt/etc/* /etc

    echo "re-create the /etc/mtab entries"
    # re-create the /etc/mtab entries
    /bin/mount -f -t cramfs -o remount,ro /dev/mtdblock/3 /

    #mount some file system
    echo "mount /dev/shm as tmpfs"
    /bin/mount -n -t tmpfs tmpfs /dev/shm


    #挂载/proc为proc文件系统
    echo "mount /proc as proc"
    /bin/mount -n -t proc none /proc

    #挂载/sys为sysfs文件系统
    echo "mount /sys as sysfs"
    /bin/mount -n -t sysfs none /sys

    /bin/mount -f -t ramfs ramfs /etc

    echo "yaffs is mounted"
    /bin/mount -t yaffs /dev/mtdblock/1 /mnt/yaffs
    exec /sbin/init
    ---------------------------------------------------------------------
    3. 权限修改
    chmod chmod 775 linuxrc

    4. 编写 inittab文件

    ---------------------------------------------------------------------
    ::sysinit:/etc/init.d/rc

    ::askfirst:-/bin/sh
    tty2::askfirst:-/bin/sh
    tty3::askfirst:-/bin/sh
    tty4::askfirst:-/bin/sh
    tty0::askfirst:-/bin/sh
       
    ::restart:/sbin/init
            
    ::ctrlaltdel:/sbin/reboot
    ::shutdown:/bin/umount -a -r
    ::shutdown:/sbin/swapoff -a
    ----------------------------------------------------------------------

    5. rc文件
    ----------------------------------------------------------------------
    #!/bin/sh

    /bin/mount -a
    -----------------------------------------------------------------------

    6. fastab 文件
    ----------------------------------------------------------------------
    none      /proc      proc defaults 0 0
    none      /dev/pts devpts mode=0622 0 0
    tmpfs      /dev/shm tmpfs defaults 0 0
    ----------------------------------------------------------------------


    7. 各文件的关系
    ----------------------------------------------------------------------
    7.1 建立一个目标板的空根目录
    我们将在这里构建构建根文件系统,创建基础目录结构. 存放交叉编译后生成的目标应用程序
    (BUSYBOX,TINYLOGIN),存放库文件等。
    [root@localhost rootfs]# mkdir my_rootfs
    [root@localhost rootfs]# pwd
    /home/arm/dev_home/rootfs/my_rootfs
    [root@localhost rootfs]# cd my_rootfs
    [root@localhost my_rootfs]#
    7.2 在my_rootfs中建立Linux目录树
    [root@localhost my_rootfs]#mkdir bin dev etc home lib mnt proc sbin sys tmp root usr
    [root@localhost my_rootfs]#mkdir mnt/etc
    [root@localhost my_rootfs]#mkdir usr/bin usr/lib usr/sbin
    [root@localhost my_rootfs]#touch linuxrc
    [root@localhost my_rootfs]#tree
    |bin
    |dev
    |etc
    |home
    |lib
    |linuxrc
    /* 此文件为启动脚本,是一shell脚本文件。本文后面有专门介绍 */
    |mnt
    | `etc   
    |proc
    |sbin
    |sys
    |tmp
    |root
    `usr
    |bin
    |lib
    `sbin

    8. 把上面编译出来的 busybox文件拷贝到 my_rootfs 文件系统

    ---------------------------------------------------------------
    把 busybox1.5.1/_install/目录下的 bin sbin usr 覆盖 my_rootfs
    文件夹里的空文件夹。
    --------------------------------------------------------------

    9. 把 5 生成的文件(rc)拷贝到 /mnt/etc/init.d/目录(先在/mnt/etc/目录新建格init.d目录)
    把 4,6生成的文件(inittab和 fastab )放到 /mnt/etc/目录
    把 2 生成的文件linuxrc 放到/目录
                这里所提到的 /目录即my_rootfs目录。
    10. 新建/dev设备,在/dev目录(即my_rootfs/dev/).
    mknod console c 5 1

    8. 生成cramfs文件

    ----------------------------------------------------------------
    下载mkfs.cramfs工具,然后用下面命令生成你要的cramfs文件系统
    ./mkfs.cramfs ./my_rootfs       ./root.cramfs

    //////////////////////////////////////////////////////////////////////////////////////////////
    挂载后的结果是
    VFS: Mounted root (cramfs filesystem) readonly.
    Freeing init memory: 92K
    re-create the /etc/mtab entries
    mount /dev/shm as tmpfs
    mount: mounting tmpfs on /dev/shm failed
    mount /proc as proc
    mount /sys as sysfs
    yaffs is mounted
    mount: mounting /dev/mtdblock/1 on /mnt/yaffs failed
    init started: BusyBox v1.6.0 (2007-11-14 12:34:56 CST) multi-call binary
    starting pid 693, tty '': '/etc/init.d/rcS'
    Cannot run '/etc/init.d/rcS': No such file or directory


    请版主指点一下应该修改,或增加那些东西 我的内核是2.6.18.3的。      
  • 作者: tanglihui   发布时间: 2007-11-19

    dev下的设备文件还是没有建全吧      

    作者: flag   发布时间: 2007-11-19

    我 配置 了 devfs,设备 结点应该自动建立      

    作者: tanglihui   发布时间: 2007-11-19

    引用:
    原帖由 tanglihui 于 2007-11-19 11:46 发表
    我 配置 了 devfs,设备 结点应该自动建立
    这可难说      

    作者: flag   发布时间: 2007-11-19

    楼主,你这个问题解决了吗?我也碰到了这样的问题了      

    作者: mxd271966940   发布时间: 2008-02-23

    热门下载

    更多