资源描述
出现问题:
## Starting application at 0x30008000 ...
Uncompressing Linux.............................................................
解决方案:
setenv bootargs console=ttySAC0,115200 mem=64M ;console明令在哪暂时还没解决???
setenv
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "<NULL>" 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)
解决方法:把
08.05.11、<*> RAM disk support
09.27.07、<*> Compressed ROM file system support (cramfs)
1. 问题一
下载内核到flash中,运行到如下即停止没有下文:
Uncompressing Linux……………………done,booting the kernel
卡在这里不动了
原因分析:可能是内核的启动参数传递时没有填写正确,
也可能是在linux内核中没对flash分区,
还有另一可能原因是在内核编译配置时没将串口驱动勾选。
解决办法:
如果是命令参数问题,则作如下修改:注释掉arch/arm/kernel/setup.c文件中的parse_tag_cmdline()函数中的strlcpy()函数,这样就可以使用默认的CONFIG_CMDLINE了,在.config文件中它被定义为"root=/dev/mtdblock2 ro init=/linuxrc console=ttySAC0,115200"(视具体情况而定),在内核配置文件的Boot options中填入也可。
如果是内核NAND flash分区的问题,则作如下修改:
1. 1 修改文件arch/arm/mach-s3c2410/devs.c,添加如下信息:
#include <linux/mtd/partitions.h>
#include <asm/arch/nand.h>
#include <linux/mtd/nand.h>
static struct mtd_partition partition_info[]=
{
{
name:"bootloader",
size:0x00040000,
offset:0,
},
{
name:"kernel",
size:0x001c0000,
offset:0x00040000,
},
{
name:"rootfs",
size: 0x01e00000,
offset:0x00200000,
},
{
name:"ext-fs1",
size: 0x01000000,
offset:0x02000000,
},
{
name:"ext-fs2",
size: 0x01000000,
offset:0x03000000,
},
};
//以上分区和NAND flash物理分区一样,分区不一样没试过,根据自己板子情况而定
struct s3c2410_nand_set nandset=
{
nr_partitions:5,
partitions:partition_info,
};
struct s3c2410_platform_nand s3c_nand_info=
{
tacls:0,
twrph0:30,
twrph1:0,
sets:&nandset,
nr_sets:1,
};
以上分区和NAND flash物理分区一样,分区不一样没试过,根据自己板子情况而定
struct s3c2410_nand_set nandset=
{
nr_partitions:5,
partitions:partition_info,
};
struct s3c2410_platform_nand s3c_nand_info=
{
tacls:0,
twrph0:30,
twrph1:0,
sets:&nandset,
nr_sets:1,
};
struct platform_device s3c_device_nand={
.name="s3c2410-nand",
.id = -1,
.num_resources = ARRAY_SIZE(s3c_nand_resources),
.resource = s3c_nand_resource, /*黑体为新加内容*/
.dev = {
.platform_data=&s3c_nand_info
}
};
1.2 在arch/arm/mach-s3c2410/mach-smdk2410.c文件中添加&s3c_device_nand,如下所示:
static struct platform_device * smdk2410_device[] _initdata=
{
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_iis,
&s3c_device_nand,
};
配置好以上内容后重新编译内核即可。
如果是串口驱动没有勾选,则一定记住将勾上如下选项:
Character devices
-> Serial Drivers下的项勾上.
2. 出现如下错误:VFS:Cannot open root device "mtdblock/2" or unknown-block(0,0)
Please append a correct "root=" boot option.
Kernel panic not syncing,VFS Unable to mount root fs on unknown-block(0,0)
原因分析:出现这种情况一般有两种情况:没有文件系统或boot options参数不正确,如我的系统文件系统为cramfs格式,存放文件系统的分区为第三个分区,启动参数为:
"noinitrd root=/dev/mtdblock2 ro init=/linuxrc console=ttySAC0,115200 rootfstype=cramfs mem=64M"
其中文件系统使用busybox-1.10.1制作
重新编译即可。
3. 系统启动后出现如下错误:
Kernel panic -not syncing:VFS:Unable to mount root fs on unknown-block(31,2)
或者类似的错误。
原因分析:我在这里耗了大量的时间,这种情况一般是NAND flash分区未能分正确,或者所在的分区上没有文件系统,当启动中出现类似如下信息时表明分区正确了
Scanning device for bad blocks
Creating 5 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00040000 : "boot"
mtd: Giving out device 0 to boot
0x00040000-0x00200000 : "kernel"
mtd: Giving out device 1 to kernel
0x00200000-0x02000000 : "rootfs"
mtd: Giving out device 2 to rootfs
0x02000000-0x03000000 : "ext-fs1"
mtd: Giving out device 3 to ext-fs1
0x03000000-0x04000000 : "ext-fs2"
mtd: Giving out device 4 to ext-fs2
从上面看出我的文件系统放在第三个分区rootfs上,其设备号为2,启动后文件系统能挂上,如下所示
Reading data from NAND FLASH without ECC is not recommended
the error code is:0,name=/dev/root,fs=cramfs,flags=32769
VFS: Mounted root (cramfs filesystem) readonly.
Freeing init memory: 104K
Reading data from NAND FLASH without ECC is not recommended
init started: BusyBox v1.10.1 (2008-04-23 23:20:41 CST)
starting pid 229, tty '': '/etc/init.d/rcS'
Reading data from NAND FLASH without ECC is not recommended
the error code is:0,name=/dev/root,fs=cramfs,flags=32769
VFS: Mounted root (cramfs filesystem) readonly.
Freeing init memory: 104K
Reading data from NAND FLASH without ECC is not recommended
init started: BusyBox v1.10.1 (2008-04-23 23:20:41 CST)
starting pid 229, tty '': '/etc/init.d/rcS'
Please press Enter to activate this console.
4. 系统启动到到如下语句即停止不前,停在那里:
VFS:Mounted root (cramfs filesystem) readonly.
Freeing init memory:104
卡在这里没有下文
原因分析:系统在启用init函数时有这么一句,粗体所示
static int init(void * unused)
{
if(execute_command)
{
run_init_process(execute_command);
}
………………
}
在这句里面出错就会没有下文
解决办法:在配置内核时少选了几句,将如下选择全选上
Floating Point emulation
->At least one emulation must be selected:
NWFPE math emulation
Support extended precision
FastFPE math emulation(EXPERIMENTAL)
5. 关于文件系统问题:在有些资料上提到在配置内核时选上devfs,如果不存在时则手动在文件里加上。但我在内核里面和busybox-1.10.1中都未加devfs支持,文件系统运行正常。在linux-2.6.14.1及以后版本中已去掉devfs。
6. linux-2.6.15.4这个版本也能成功在s3c2410上运行.
内核编译成功后,启动后出现如下提示后就停住了。。。。。。
Freeing init memory: 72K
Warning: unable to open an initial console.
!C+Q7f W ][0这个也是控制台console的问题,linux-2.6.13以后的内核都支持devfs,而之后版本的内核就把devfs这块去掉了,虽然还能在内核源码中找到对应的源码,你也可以把它加进内核,但是也不是太好用。2.6.13 后的版本改为支持udev了,udev这块我也没太弄懂,正在研究。-
--> Kernel Features
--> Preemption Mode
.config 里面的 CONFIG_PREEMPT_NONE 选项决定了kernel在挂在文件系统后可不能进入shell。
-------------------------------------------------------------------------------
--> Floating point emulation
FPE_NWFPE 选项如果未选上
现象:
…………
IPv4 over IPv4 tunneling driver
TCP bic registered
NET: Registered protocol family 1
IP-Config: No network devices available.
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 4196KiB [1 disk] into ram disk... done.
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 96K
kernel 启动到这里就停止了。
-------------------------------------------------------------------------
--> Device Drivers
--> Block devices
CONFIG_BLK_DEV_RAM选项 未选上
CONFIG_BLK_DEV_INITRD选项 未选上
现象:
………………
loop: loaded (max 8 devices)
nbd: registered device at major 43
mice: PS/2 mouse device common for all mice
IPv4 over IPv4 tunneling driver
TCP bic registered
NET: Registered protocol family 1
IP-Config: No network devices available.
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "ram0" 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)
1. 加载kernel后出现如下错误:
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 "mtdblock3" 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)
其中,linux command line is: "noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200"
解决方法,在make menuconfig 后,选中mtd支持,cramfs支持,/dev fs支持。
其中,添加/dev fs支持具体操作如下:
修改fs/Kconfig,支持启动时挂载devfs
$vim fs/ Kconfig
找到menu “Pseudo filesystem”
在其中添加:
config DEVFS_FS
bool “/dev file system support (OBSOLETE)”
default y
config DEVFS_MOUNT
bool “Automatically mount at boot”
default y
depends on DEVFS_FS
之后,boot信息如下:
boot
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x00100000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock/3 init=/linuxrc console=ttySAC0,115200"
MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux................................................................... done, booting the kernel.
Linux version 2.6.15.4 (zjw@zjw.linux) (gcc version 4.1.1) #5 Thu Aug 2 20:47:27 CST 2007
CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)
Machine: SMDK2410
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
S3C2410 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
Kernel command line: noinitrd root=/dev/mtdblock/3 init=/linuxrc console=ttySAC0,115200
irq: clearing subpending status 00000007
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 4096 bytes)
timer tcon=00000000, 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: 32MB = 32MB total
Memory: 30248KB available (1676K code, 376K data, 88K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2410: Initialising architecture
S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics
DMA channel 0 at c2800000, irq 33
DMA channel 1 at c2800040, irq 34
DMA channel 2 at c2800080, irq 35
DMA channel 3 at c28000c0, irq 36
NetWinder Floating Point Emulator V0.97 (extended precision)
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: devfs_debug: 0x0 //可以看出,已经支持devfs
devfs: boot_options: 0x1
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 80x25
fb0: Virtual frame buffer device, using 1024K of video memory
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: Tacls=1, 10ns Twrph0=4 40ns, Twrph1=1 10ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x75 (Samsung NAND 32MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 5 MTD partitions on "NAND 32MiB 3,3V 8-bit":
0x00000000-0x00020000 : "loader"
0x00020000-0x00030000 : "param"
0x00030000-0x001f0000 : "kernel"
0x00200000-0x00600000 : "root"
0x00600000-0x04000000 : "user"
mtd: partition "user" extends beyond the end of device "NAND 32MiB 3,3V 8-bit" -- size truncated to 0x1a00000
mice: PS/2 mouse device common for all mice
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: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
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 "mtdblock/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)
根据网上的一些指导,将linux_cmd_line设置为"noinitrd root=/dev/mtdblock/3 init=/linuxrc console=ttySAC0,115200",问题
依旧。尝试了几乎所有网上的办法,问题没有得到解决。于是尝试换一个内核,下载了2.6.22的内核,按照2.6.15.4一样
配置编译了内核,当然,该版本的移植步骤有点变化,最主要的区别是,2.6.22的内核已经没有了/arch/arm/mach-s3c2410/dev.c文件,
所以,分区信息要在arch/arm/mach-s3c2410/common-smdk.c中修改static struct mtd_partition smdk_default_nand_part[] 。
boot后:
boot
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x001d0000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200"
MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux.................................................................................................. done, booting the kernel.
Linux version 2.6.22 (zjw@zjw.linux) (gcc version 4.1.1) #3 Sun Aug 5 16:00:32 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 200.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: 8128
Kernel command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200
irq: clearing subpending status 00000007
irq: clearing subpending status 00000002
PID hash table entries: 128 (order: 7, 512 bytes)
timer tcon=00000000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
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: 32MB = 32MB total
Memory: 29224KB available (2780K code, 309K data, 132K 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
S3C2410: Initialising architecture
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c2800000, irq 33
DMA channel 1 at c2800040, irq 34
DMA channel 2 at c2800080, irq 35
DMA channel 3 at c28000c0, 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: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2
展开阅读全文