关于linuxrc不能执行的问题
linux在2410上面启动时的打印信息<br /><br /> [ - ]CODE:<br />NAND read: device 0 offset 0x100000, size 0x300000<br />3145728 bytes read: OK<br />## Starting application at 0x30008000 ...<br />Uncompressing Linux.............................................................<br />done, booting the kernel.<br />Linux version 2.6.14.1 (jade@ubuntu) (gcc version 3.4.5) #2 Thu Mar 5 14:42:12 C<br />ST 2009<br />CPU: ARM920Tid(wb) revision 0 (ARMv4T)<br />Machine: SMDK2410<br />Warning: bad configuration page, trying to continue<br />Memory policy: ECC disabled, Data cache writeback<br />CPU S3C2410A (id 0x32410002)<br />S3C2410: core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz<br />S3C2410 Clocks, (c) 2004 Simtec Electronics<br />CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on<br />CPU0: D VIVT write-back cache<br />CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets<br />CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets<br />Built 1 zonelists<br />Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,<br />115200<br />irq: clearing subpending status 00000002<br />PID hash table entries: 128 (order: 7, 2048 bytes)<br />timer tcon=00500000, tcnt a509, tcfg 00000200,00000000, usec 00001e4c<br />Console: colour dummy device 80x30<br />Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)<br />Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)<br />Memory: 16MB = 16MB total<br />Memory: 14232KB available (1501K code, 342K data, 84K init)<br />Mount-cache hash table entries: 512<br />CPU: Testing write buffer coherency: ok<br />softlockup thread 0 started up.<br />NET: Registered protocol family 16<br />S3C2410: Initialising architecture<br />S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics<br />DMA channel 0 at c1800000, irq 33<br />DMA channel 1 at c1800040, irq 34<br />DMA channel 2 at c1800080, irq 35<br />DMA channel 3 at c18000c0, irq 36<br />NetWinder Floating Point Emulator V0.97 (double precision)<br />devfs: 2004-01-31 Richard Gooch (<a href="mailto:rgooch@atnf.csiro.au">rgooch@atnf.csiro.au</a>)<br />devfs: boot_options: 0x1<br />Console: switching to colour frame buffer device 80x25<br />fb0: Virtual frame buffer device, using 1024K of video memory<br />S3C2410 RTC, (c) 2004 Simtec Electronics<br />s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410<br />s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410<br />s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410<br />io scheduler noop registered<br />io scheduler anticipatory registered<br />io scheduler deadline registered<br />io scheduler cfq registered<br />RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize<br />S3C24XX NAND Driver, (c) 2004 Simtec Electronics<br />s3c2410-nand: mapped registers at c1980000<br />s3c2410-nand: timing: Tacls 10ns, Twrph0 30ns, Twrph1 10ns<br />NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit<br />)<br />NAND_ECC_NONE selected by board driver. This is not recommended !!<br />Scanning device for bad blocks<br />Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":<br />0x00000000-0x00100000 : "bootloader"<br />0x00100000-0x00400000 : "kernel"<br />0x00400000-0x02c00000 : "root"<br />0x02d00000-0x03c00000 : "user"<br />mice: PS/2 mouse device common for all mice<br />NET: Registered protocol family 2<br />IP route cache hash table entries: 256 (order: -2, 1024 bytes)<br />TCP established hash table entries: 1024 (order: 0, 4096 bytes)<br />TCP bind hash table entries: 1024 (order: 0, 4096 bytes)<br />TCP: Hash tables configured (established 1024 bind 1024)<br />TCP reno registered<br />TCP bic registered<br />NET: Registered protocol family 1<br />Reading data from NAND FLASH without ECC is not recommended<br />VFS: Mounted root (cramfs filesystem) readonly.<br />Mounted devfs on /dev<br />Freeing init memory: 84K<br />Failed to execute /linuxrc. Attempting defaults...<br />Kernel panic - not syncing: No init found. Try passing init= option to kernel.<br /><br />网上分析linuxrc不能运行无非三点原因<br />1 linuxrc不具备可执行属性<br />2 linuxrc的解释shell不在首行<br />3 linuxrc的解释shell不存在<br /><br /> [ - ]CODE:<br />ls linuxrc -al<br />-rwxrwxr-x 1 root root 687 1970-01-01 08:00 linuxrc<br /><br />说明第一条排除<br /><br />root的结构<br /><br /> [ - ]CODE:<br />|-- bin<br />| |-- ash -> busybox<br />| |-- busybox<br />| |-- cat -> busybox<br />| |-- cp -> busybox<br />| |-- echo -> busybox<br />| |-- ls -> busybox<br />| |-- mkdir -> busybox<br />| |-- mount -> busybox<br />| |-- mv -> busybox<br />| |-- pwd -> busybox<br />| |-- rm -> busybox<br />| |-- touch -> busybox<br />| |-- umount -> busybox<br />| `-- vi -> busybox<br />|-- dev<br />|-- etc<br />|-- home<br />|-- lib<br />|-- linuxrc<br />|-- linuxrc~<br />|-- mnt<br />| `-- etc<br />|-- proc<br />|-- root<br />|-- sbin<br />| |-- halt -> ../bin/busybox<br />| |-- init -> ../bin/busybox<br />| |-- poweroff -> ../bin/busybox<br />| |-- reboot -> ../bin/busybox<br />| `-- start-stop-daemon -> ../bin/busybox<br />|-- sys<br />|-- tmp<br />`-- usr<br /> |-- bin<br /> | |-- [ -> ../../bin/busybox<br /> | |-- ][][ -> ../../bin/busybox<br /> | |-- env -> ../../bin/busybox<br /> | |-- mesg -> ../../bin/busybox<br /> | `-- test -> ../../bin/busybox<br /> |-- lib<br /> `-- sbin<br /><br />linuxrc的内容<br /><br />] [ - ]CODE:<br />#!/bin/sh#挂载/etc 为 ramfs, 并从/mnt/etc 下拷贝文件到/etc 目录当中<br />echo "mount /etc as ramfs"<br />/bin/mount -n -t ramfs ramfs /etc<br />/bin/cp -a /mnt/etc/* /etc<br />echo "re-create the /etc/mtab entries"<br /># re-create the /etc/mtab entries<br />/bin/mount -f -t cramfs -o remount,ro /dev/mtdblock/2 /<br />#mount some file system<br />echo "------------mount /dev/shm as tmpfs"<br />/bin/mount -n -t tmpfs tmpfs /dev/shm<br />#挂载/proc 为 proc 文件系统<br />echo "------------mount /proc as proc"<br />/bin/mount -n -t proc none /proc<br />#挂载/sys 为 sysfs 文件系统<br />echo "------------mount /sys as sysfs"<br />/bin/mount -n -t sysfs none /sys<br />exec /sbin/init<br /><br />我把第一行改成了#!/bin/ash也不行,因为在/bin下面没看见sh,只看见ash。<br />请高手解答一下这是什么原因哦。<br />没有装tinylog什么的,是不是嵌入式linux默认的就是root用户啊?我也总会遇到类似的问题。
是不是该看什么书大补一下呢?<br />感觉学习嵌入式Linux,一步一个跟头。该补一补Linux哪方面的知识呢?<br />有什么好书楼下大侠推荐一下啊!<br />明天看
我这要关门。应该是
应该是没有传给系统正确的LINUXRC位置的参数,<br />要不是就是分区加载有问题.re
#/bin/sh<br />你的bin 下面没有sh<br />
页:
[1]