主题 : 内核移植问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 4137
精华: 0
发帖: 15
金钱: 100 两
威望: 60 点
综合积分: 30 分
注册时间: 2009-02-27
最后登录: 2017-09-13
楼主  发表于: 2009-03-28 16:31

 内核移植问题

2.6.26版本内核   文件系统为:mini2440本身自带的yaffs文件系统。

出现下问题:

Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 782
NOW, Booting Linux......
Uncompressing Linux.......................................................................................................... done, booting the kernel.
Linux version 2.6.26 (root@localhost.localdomain) (gcc version 3.4.1) #1 Thu Mar 19 13:32:12 CST 2009
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 S3C2440A (id 0x32440001)
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 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 in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00000000, tcnt a4ca, tcfg 00000200,00000000, usec 00001e57
Console: colour dummy device 80x30
console [ttySAC0] enabled
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: 61440KB available (3008K code, 302K data, 140K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 192 bytes
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
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
S3C244X: Clock Support, DVS off
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
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.9)
msgmni has been set to 120
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
s3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attach
s3c2410-lcd: probe of s3c2410-lcd failed with error -22
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver $Revision: 1.90 $ 4 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
brd: module loaded
loop: module loaded
dm9000 Ethernet Driver, V1.30
Uniform Multi-Platform E-IDE driver
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
BAST NOR-Flash Driver, (c) 2004 Simtec Electronics
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=1, 9ns Twrph0=4 39ns, Twrph1=1 9ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
s3c2410_nand_update_chip: chip c3dcf8bc: 9
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00020000 : "vivi"
0x00050000-0x00250000 : "kernel"
0x00250000-0x03ffc000 : "root"
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
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
TCP cubic registered
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
List of all partitions:
1f00        128 mtdblock0 (driver?)
1f01       2048 mtdblock1 (driver?)
1f02      63152 mtdblock2 (driver?)
No filesystem could mount root, tried:  ext3 ext2 cramfs msdos vfat romfs fuseblk
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)

系统就死在这。

请问是什么回事???
级别: 新手上路
UID: 3464
精华: 0
发帖: 11
金钱: 120 两
威望: 120 点
综合积分: 22 分
注册时间: 2009-01-12
最后登录: 2009-12-23
1楼  发表于: 2009-03-28 16:53
No filesystem could mount root, tried:  ext3 ext2 cramfs msdos vfat romfs fuseblk

应该是你内核不支持yaffs
级别: 新手上路
UID: 4137
精华: 0
发帖: 15
金钱: 100 两
威望: 60 点
综合积分: 30 分
注册时间: 2009-02-27
最后登录: 2017-09-13
2楼  发表于: 2009-03-29 01:42
已经选择了yaffs,是不是不同版本的问题???
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2009-03-29 09:13
从启动的信息看, 内核中的确没有包含yaffs的支持。你可以打开内核源代码根目录下生成的System.map, 找一下有没有init_yaffs_fs
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 4137
精华: 0
发帖: 15
金钱: 100 两
威望: 60 点
综合积分: 30 分
注册时间: 2009-02-27
最后登录: 2017-09-13
4楼  发表于: 2009-03-30 13:06
没有init_yaffs_fs
但是我已经下载了yaffs2.tar.gz
解压到: fs/目录下,
并修该Kconfig文件(加入yaffs2的配置选项)
在Makefile文件中加入:
obj-$(CONFIG_YAFFS2_FS)  += yaffs2/
配置内核是也选择了yaffs2 file system support
[ 此帖被hengwen在2009-03-30 22:50重新编辑 ]
级别: 新手上路
UID: 4819
精华: 0
发帖: 3
金钱: 30 两
威望: 30 点
综合积分: 6 分
注册时间: 2009-03-30
最后登录: 2009-04-07
5楼  发表于: 2009-03-30 23:00
"No filesystem could mount root, tried:  ext3 ext2 cramfs msdos vfat romfs fuseblk"

从这条信息看,应该是没有加入yaffs支持吧

你确定是将yaffs2 编入内核,而不是编译成模块?
级别: 新手上路
UID: 4137
精华: 0
发帖: 15
金钱: 100 两
威望: 60 点
综合积分: 30 分
注册时间: 2009-02-27
最后登录: 2017-09-13
6楼  发表于: 2009-03-31 10:26
在System.map,是没有init_yaffs_fs,都没有yaffs有关的函数,我怀疑不把它编译到内核。

但我不知除了:
下载了yaffs2.tar.gz
解压到: fs/目录下,
并修该Kconfig文件(加入yaffs2的配置选项)
在Makefile文件中加入:
obj-$(CONFIG_YAFFS2_FS)  += yaffs2/
配置内核是也选择了yaffs2 file system support

还要怎样做才能把它编译到内核???
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
7楼  发表于: 2009-03-31 18:26
有Makefile并不意味着就会被编译到,内核里的Makefile通常是这样写的:

obj-$CONFIG_XXX += yyy.o

想要把yyy.o编译进内核,内核源代码根目录下的.config文件里必须有CONFIG_XXX=y
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 4137
精华: 0
发帖: 15
金钱: 100 两
威望: 60 点
综合积分: 30 分
注册时间: 2009-02-27
最后登录: 2017-09-13
8楼  发表于: 2009-04-01 02:49
多谢各位的帮助! 上问题已解决。
原因是:把yaffs编译成了模块,
解决:只要把yaffs编译进内核接可以了

不过又出现了新问题,如下:

TCP cubic registered
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem).
Freeing init memory: 140K
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.
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
9楼  发表于: 2009-04-01 10:29

 回 8楼(hengwen) 的帖子

那是内核Yaffs OOB/ECC配置和bootloader中不一致造成的
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."