天嵌 ARM开发社区

 找回密码
 注册
查看: 12629|回复: 7

老问题:Warning: unable to open an initial console.

[复制链接]
danshi126 发表于 2011-12-6 21:52:13 | 显示全部楼层 |阅读模式
本帖最后由 danshi126 于 2012-2-4 22:04 编辑

u-boot  :   天嵌_1.2.0
内核版本 :   2.6.22
工    具 :   gcc version 3.4.5
busybox :   busybox-1.7.0
mkyaffs  :   mkyaffs2image :

busybox文件系统下  dev目录下console null 两个字符设备文件已有
                   etc目录下,inittab文件有可执行权限(内容:console::askfrist:-/bin/sh)

目前我只搭建了最小最小文件系统做个测试,起动信息提示不能打开console 控制台:


##### EmbedSky BIOS for SKY2440/TQ2440 #####
Press Space key to Download Mode !
Booting Linux ...
Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00200000 ... Copy Kernel to SDRAM done,NOW, Booting Linux......
Uncompressing Linux................................................................................................... done, booting the kernel.
Linux version 2.6.22 (wangping@wangping) (gcc version 3.4.5) #12 Tue Dec 6 20:47:10 CST 2011
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 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: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
irq: clearing pending ext status 00080000
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00500000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
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: 61616KB available (2816K code, 294K data, 116K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C2440: Clock Support, DVS off
S3C24XX DMA Driver, (c) 2003-2004,2006 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
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
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)
TCP reno registered
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
yaffs Dec  6 2011 20:45:32 Installing.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
s3c2410-lcd s3c2410-lcd: invalid bpp 16
Console: switching to colour frame buffer device 30x40
fb0: s3c2410fb frame buffer device
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: module loaded
dm9000 Ethernet Driver
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 33 at 0x00420000
Bad eraseblock 34 at 0x00440000
Bad eraseblock 35 at 0x00460000
Bad eraseblock 36 at 0x00480000
Bad eraseblock 37 at 0x004a0000
Bad eraseblock 38 at 0x004c0000
Bad eraseblock 39 at 0x004e0000
Bad eraseblock 40 at 0x00500000
Bad eraseblock 41 at 0x00520000
Bad eraseblock 42 at 0x00540000
Bad eraseblock 43 at 0x00560000
Bad eraseblock 44 at 0x00580000
Bad eraseblock 45 at 0x005a0000
Bad eraseblock 46 at 0x005c0000
Bad eraseblock 47 at 0x005e0000
Bad eraseblock 48 at 0x00600000
Bad eraseblock 49 at 0x00620000
Bad eraseblock 50 at 0x00640000
Bad eraseblock 51 at 0x00660000
Bad eraseblock 52 at 0x00680000
Bad eraseblock 53 at 0x006a0000
Bad eraseblock 54 at 0x006c0000
Bad eraseblock 55 at 0x006e0000
Bad eraseblock 56 at 0x00700000
Bad eraseblock 57 at 0x00720000
Bad eraseblock 58 at 0x00740000
Bad eraseblock 59 at 0x00760000
Bad eraseblock 60 at 0x00780000
Bad eraseblock 61 at 0x007a0000
Bad eraseblock 62 at 0x007c0000
Bad eraseblock 63 at 0x007e0000
Bad eraseblock 64 at 0x00800000
Bad eraseblock 65 at 0x00820000
Bad eraseblock 66 at 0x00840000
Bad eraseblock 67 at 0x00860000
Bad eraseblock 68 at 0x00880000
Bad eraseblock 69 at 0x008a0000
Bad eraseblock 70 at 0x008c0000
Bad eraseblock 71 at 0x008e0000
Bad eraseblock 72 at 0x00900000
Bad eraseblock 73 at 0x00920000
Bad eraseblock 74 at 0x00940000
Bad eraseblock 75 at 0x00960000
Bad eraseblock 76 at 0x00980000
Bad eraseblock 77 at 0x009a0000
Bad eraseblock 78 at 0x009c0000
Bad eraseblock 79 at 0x009e0000
Bad eraseblock 80 at 0x00a00000
Bad eraseblock 81 at 0x00a20000
Bad eraseblock 82 at 0x00a40000
Bad eraseblock 83 at 0x00a60000
Bad eraseblock 84 at 0x00a80000
Bad eraseblock 85 at 0x00aa0000
Bad eraseblock 86 at 0x00ac0000
Bad eraseblock 87 at 0x00ae0000
Bad eraseblock 88 at 0x00b00000
Bad eraseblock 89 at 0x00b20000
Bad eraseblock 340 at 0x02a80000
Bad eraseblock 567 at 0x046e0000
Bad eraseblock 753 at 0x05e20000
Bad eraseblock 775 at 0x060e0000
Bad eraseblock 1183 at 0x093e0000
Bad eraseblock 1187 at 0x09460000
Bad eraseblock 1204 at 0x09680000
Bad eraseblock 1295 at 0x0a1e0000
Bad eraseblock 1348 at 0x0a880000
Bad eraseblock 1536 at 0x0c000000
Bad eraseblock 1596 at 0x0c780000
Bad eraseblock 2025 at 0x0fd20000
Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x00000000-0x00800000 : "Kernel"
0x00800000-0x02000000 : "jffs2"
0x02000000-0x10000000 : "yaffs"
usbmon: debugfs is not available
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 390 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
TCP cubic registered
NET: Registered protocol family 1
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: auto selecting yaffs2
block 85 is bad
block 312 is bad
block 498 is bad
block 520 is bad
block 928 is bad
block 932 is bad
block 949 is bad
block 1040 is bad
block 1093 is bad
block 1281 is bad
block 1341 is bad
block 1770 is bad
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem).
Freeing init memory: 116K
Warning: unable to open an initial console.
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.


nand flash 坏块有点多 ...:dizzy:
raominping 发表于 2011-12-8 13:14:33 | 显示全部楼层
部队哦。我也遇到过,你先格式化下你的nand flash。然后检查你的分区,如果用TQ默认的U_BOOT的话,分区也最好按照手册的来哦。。
还有,BUSYbox下的文件都要该下权限的。。。用chmod 777 文件名   
raominping 发表于 2011-12-8 13:15:50 | 显示全部楼层
你的分区有问题啊。。U-boot的空间都没有,直接从0开始就给内核了。。注意看手册哦。。。
在NAND flash 驱动那里哦。。
亚瑟王 发表于 2011-12-12 17:31:31 | 显示全部楼层
亲,你用的什么命令制作的yaffs镜像?
 楼主| danshi126 发表于 2011-12-13 09:41:23 | 显示全部楼层
格式化nand flash了,,但无用,,,估计nand flash快挂了....分区也设置好了


##### EmbedSky BIOS for SKY2440/TQ2440 #####
Press Space key to Download Mode !
Booting Linux ...
Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00200000 ... Copy Kernel to SDRAM done,NOW, Booting Linux......
Uncompressing Linux................................................................................................... done, booting the kernel.
Linux version 2.6.22 (wangping@wangping) (gcc version 3.4.5) #18 Tue Dec 13 09:08:24 CST 2011
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 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: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
irq: clearing pending ext status 00080000
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00500000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
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: 61568KB available (2816K code, 359K data, 120K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C2440: Clock Support, DVS off
S3C24XX DMA Driver, (c) 2003-2004,2006 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
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
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)
TCP reno registered
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
yaffs Dec 13 2011 09:06:44 Installing.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
s3c2410-lcd s3c2410-lcd: invalid bpp 16
Console: switching to colour frame buffer device 30x40
fb0: s3c2410fb frame buffer device
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: module loaded
dm9000 Ethernet Driver
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=2, 20ns Twrph0=3 30ns, Twrph1=2 20ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 34 at 0x00440000
Bad eraseblock 35 at 0x00460000
Bad eraseblock 36 at 0x00480000
Bad eraseblock 37 at 0x004a0000
Bad eraseblock 38 at 0x004c0000
Bad eraseblock 39 at 0x004e0000
Bad eraseblock 40 at 0x00500000
Bad eraseblock 41 at 0x00520000
Bad eraseblock 42 at 0x00540000
Bad eraseblock 43 at 0x00560000
Bad eraseblock 44 at 0x00580000
Bad eraseblock 45 at 0x005a0000
Bad eraseblock 46 at 0x005c0000
Bad eraseblock 47 at 0x005e0000
Bad eraseblock 48 at 0x00600000
Bad eraseblock 49 at 0x00620000
Bad eraseblock 50 at 0x00640000
Bad eraseblock 51 at 0x00660000
Bad eraseblock 52 at 0x00680000
Bad eraseblock 53 at 0x006a0000
Bad eraseblock 54 at 0x006c0000
Bad eraseblock 55 at 0x006e0000
Bad eraseblock 56 at 0x00700000
Bad eraseblock 57 at 0x00720000
Bad eraseblock 58 at 0x00740000
Bad eraseblock 59 at 0x00760000
Bad eraseblock 60 at 0x00780000
Bad eraseblock 61 at 0x007a0000
Bad eraseblock 62 at 0x007c0000
Bad eraseblock 63 at 0x007e0000
Bad eraseblock 64 at 0x00800000
Bad eraseblock 65 at 0x00820000
Bad eraseblock 66 at 0x00840000
Bad eraseblock 67 at 0x00860000
Bad eraseblock 68 at 0x00880000
Bad eraseblock 69 at 0x008a0000
Bad eraseblock 70 at 0x008c0000
Bad eraseblock 71 at 0x008e0000
Bad eraseblock 72 at 0x00900000
Bad eraseblock 73 at 0x00920000
Bad eraseblock 74 at 0x00940000
Bad eraseblock 75 at 0x00960000
Bad eraseblock 76 at 0x00980000
Bad eraseblock 77 at 0x009a0000
Bad eraseblock 78 at 0x009c0000
Bad eraseblock 79 at 0x009e0000
Bad eraseblock 80 at 0x00a00000
Bad eraseblock 81 at 0x00a20000
Bad eraseblock 82 at 0x00a40000
Bad eraseblock 83 at 0x00a60000
Bad eraseblock 84 at 0x00a80000
Bad eraseblock 85 at 0x00aa0000
Bad eraseblock 86 at 0x00ac0000
Bad eraseblock 87 at 0x00ae0000
Bad eraseblock 88 at 0x00b00000
Bad eraseblock 89 at 0x00b20000
Bad eraseblock 90 at 0x00b40000
Bad eraseblock 91 at 0x00b60000
Bad eraseblock 92 at 0x00b80000
Bad eraseblock 93 at 0x00ba0000
Bad eraseblock 94 at 0x00bc0000
Bad eraseblock 95 at 0x00be0000
Bad eraseblock 96 at 0x00c00000
Bad eraseblock 97 at 0x00c20000
Bad eraseblock 98 at 0x00c40000
Bad eraseblock 99 at 0x00c60000
Bad eraseblock 100 at 0x00c80000
Bad eraseblock 101 at 0x00ca0000
Bad eraseblock 102 at 0x00cc0000
Bad eraseblock 103 at 0x00ce0000
Bad eraseblock 104 at 0x00d00000
Bad eraseblock 105 at 0x00d20000
Bad eraseblock 106 at 0x00d40000
Bad eraseblock 107 at 0x00d60000
Bad eraseblock 108 at 0x00d80000
Bad eraseblock 109 at 0x00da0000
Bad eraseblock 110 at 0x00dc0000
Bad eraseblock 111 at 0x00de0000
Bad eraseblock 112 at 0x00e00000
Bad eraseblock 113 at 0x00e20000
Bad eraseblock 114 at 0x00e40000
Bad eraseblock 115 at 0x00e60000
Bad eraseblock 116 at 0x00e80000
Bad eraseblock 117 at 0x00ea0000
Bad eraseblock 118 at 0x00ec0000
Bad eraseblock 119 at 0x00ee0000
Bad eraseblock 120 at 0x00f00000
Bad eraseblock 121 at 0x00f20000
Bad eraseblock 122 at 0x00f40000
Bad eraseblock 124 at 0x00f80000
Bad eraseblock 125 at 0x00fa0000
Bad eraseblock 126 at 0x00fc0000
Bad eraseblock 127 at 0x00fe0000
Bad eraseblock 128 at 0x01000000
Bad eraseblock 129 at 0x01020000
Bad eraseblock 340 at 0x02a80000
Bad eraseblock 567 at 0x046e0000
Bad eraseblock 753 at 0x05e20000
Bad eraseblock 775 at 0x060e0000
Bad eraseblock 1183 at 0x093e0000
Bad eraseblock 1187 at 0x09460000
Bad eraseblock 1204 at 0x09680000
Bad eraseblock 1295 at 0x0a1e0000
Bad eraseblock 1348 at 0x0a880000
Bad eraseblock 1536 at 0x0c000000
Bad eraseblock 1596 at 0x0c780000
Bad eraseblock 2025 at 0x0fd20000
Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x00000000-0x00040000 : "Bootloader"
0x00200000-0x00400000 : "Kernel"
0x00400000-0x0fff8000 : "yaffs2"
mtd: partition "yaffs2" doesn't end on an erase block -- force read-only
usbmon: debugfs is not available
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 390 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
TCP cubic registered
NET: Registered protocol family 1
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: auto selecting yaffs2
block 3 is bad
block 4 is bad
block 5 is bad
block 6 is bad
block 7 is bad
block 8 is bad
block 9 is bad
block 10 is bad
block 11 is bad
block 12 is bad
block 13 is bad
block 14 is bad
block 15 is bad
block 16 is bad
block 17 is bad
block 18 is bad
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) readonly.
Freeing init memory: 120K
Warning: unable to open an initial console.
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel
 楼主| danshi126 发表于 2011-12-13 09:42:57 | 显示全部楼层
工具是  mkyaffs2image   
weidongshan 发表于 2012-2-4 21:17:20 | 显示全部楼层
很简单,如果你读过内核的这段代码:
static int noinline init_post(void)
{
        free_initmem();
        unlock_kernel();
        mark_rodata_ro();
        system_state = SYSTEM_RUNNING;
        numa_default_policy();

        if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
                printk(KERN_WARNING "Warning: unable to open an initial console.\n");


就可以知道是无法打开/dev/console,
所以:
1. 在你的根文件系统里建/dev/console设备节点
2. UBOOT传入的命令行参数:console=ttySAC0 ,我看到你的内核已经有这个参数了
 楼主| danshi126 发表于 2012-2-4 22:03:15 | 显示全部楼层
谢谢韦大哥,,,  这个问题终于解决了,,,   

    原因是因为自己编译的UBOOT的write.yaffs命令没有支持完整,
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-5-1 05:54 , Processed in 1.031250 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表