请教linux启动停在"Uncompressing Linux...done, booting the kernel."的问题

dos5gw 2010-08-17 03:09:57
在2440的板子上移植linux 2.6.32
开机,串口打印出"Uncompressing Linux...done, booting the kernel." 然后就停住了,

已经在init/main.c 的start_kernel()函数开头加上了printascii("start_kernel"), 但是没哟打印出来, 可能这时还没进start_kernel,
请问, 这还有什么可能的原因?

机器码的问题, 我的内核机器码是1999, vivi下查看输入param show,显示如下

Supervivi> param show
Number of parameters: 9
name : hex integer
-------------------------------------------------------------
mach_type : 000007cf 1999
media_type : 00000003 3
boot_mem_base : 30000000 805306368
baudrate : 0001c200 115200
xmodem : 00000001 1
xmodem_one_nak : 00000000 0
xmodem_initial_timeout : 000493e0 300000
xmodem_timeout : 000f4240 1000000
boot_delay : 01000000 16777216
Linux command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0

这样看的话, 机器码能对上, 并且启动参数noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0也没错, 我的kernel就是在mtdblock3这个分区
...全文
6220 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
ddqiu 2010-10-08
  • 打赏
  • 举报
回复
我的是2410的板子,移植linux-2.6.14,也出现了楼主的相同问题,请问怎么解决呢?
dos5gw 2010-08-18
  • 打赏
  • 举报
回复
结贴,
步移http://topic.csdn.net/u/20100818/09/7b1d6b24-c71a-46ea-8c9a-e44e184dd967.html
dos5gw 2010-08-17
  • 打赏
  • 举报
回复
发现
Kernel Features --->
  • Use the ARM EABI to compile the kernel
  • Allow old ABI binaries to run with this kernel
  • (EXPERIMENTA)
    居然没选,,,,,
wwwunix 2010-08-17
  • 打赏
  • 举报
回复
Machine configuration botched (nr 182), unable to continue.
从你的出错信息看来,还是配置的问题。
你到make menuconfig里面,把所有的配置选项都梳理一遍吧。
dos5gw 2010-08-17
  • 打赏
  • 举报
回复
[Quote=引用 16 楼 wwwunix 的回复:]

另外,你再看看kernel中
linux-2.6.32.2/arch/arm/plat-s3c24xx/common-smdk.c中的分区定义是否和vivi中的一致
static struct mtd_partition smdk_default_nand_part[]
[/Quote]

我没有使用mach-s3c2440/mach-smdk2440.c, 而是cp mach-smdk2440.c mach-test2440.c
然后修改了mach-test2440.c内的MACHINE_START宏以及里面所有的带smdk2440的函数名字,
当然我的flash分区时在这个mach-test2440.c中, 没有使用common-smdk.c中的分区,
也能确认vivi的分区定义和mach-test2440.c的分区一致
dos5gw 2010-08-17
  • 打赏
  • 举报
回复
[Quote=引用 15 楼 wwwunix 的回复:]

可以这样做,但这样比较费时间。
从你贴出的分区来看,你的nand分区是做什么的?这个分区的开始地址和大小都有问题。
另外,把root的size改为:
.size=0x03AA0000
再试试
[/Quote]

板子上可能搭载64MB~ 1GB的nand flash,nand分区从offset=0x0开始, 代表整片flash,主要是预留使用, 比如以后可以通过应用程序读取/dev/mtdblock4可以实现备份整片flash的功能
wwwunix 2010-08-17
  • 打赏
  • 举报
回复
另外,你再看看kernel中
linux-2.6.32.2/arch/arm/plat-s3c24xx/common-smdk.c中的分区定义是否和vivi中的一致
static struct mtd_partition smdk_default_nand_part[]
wwwunix 2010-08-17
  • 打赏
  • 举报
回复
可以这样做,但这样比较费时间。
从你贴出的分区来看,你的nand分区是做什么的?这个分区的开始地址和大小都有问题。
另外,把root的size改为:
.size=0x03AA0000
再试试
dos5gw 2010-08-17
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 wwwunix 的回复:]

那你就基于2410的配置做修改,看kernel在哪里停了就修改那个地方就行了。
[/Quote]

请问你的意思是在start_kernel()函数中打印断点调试吗?
wwwunix 2010-08-17
  • 打赏
  • 举报
回复
那你就基于2410的配置做修改,看kernel在哪里停了就修改那个地方就行了。
dos5gw 2010-08-17
  • 打赏
  • 举报
回复
我这样做了一下:
make s3c2410_defconfig
make zImage
载入了一下s3c2440的配置,然后写入nand flash,开机,能看到我写的"enter start_kernel()...", 说明进入tart_kernel()函数了


Copy linux kernel from 0x00060000 to 0x30008000, size = 0x00500000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySA
C0"
MACH_TYPE = 1999
NOW, Booting Linux......
Uncompressing Linux.............................................................
.................................................................. done, booting
the kernel.
enter start_kernel()...<5>Linux version 2.6.32 (root@chen-ubuntu) (gcc version 4
.1.2) #49 Tue Aug 17 15:57:42 CST 2010
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine configuration botched (nr 182), unable to continue.

dos5gw 2010-08-17
  • 打赏
  • 举报
回复
板载64M的nand flash, kernel给了5MB,应该没问题吧?


static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "vivi",
.size = 0x00040000,
.offset = 0,
},
[1] = {
.name = "param",
.offset = 0x00040000,
.size = 0x00020000,
},
[2] = {
.name = "Kernel",
.offset = 0x00060000,
.size = 0x00500000,
},
[3] = {
.name = "root",
.offset = 0x00560000,
.size = 1024 * 1024 * 1024, //
},
[4] = {
.name = "nand",
.offset = 0x00000000,
.size = 1024 * 1024 * 1024, //
}
};
wwwunix 2010-08-17
  • 打赏
  • 举报
回复
能把你的flash的分区地址贴出来吗?分给kernel的空间够吗?
dos5gw 2010-08-17
  • 打赏
  • 举报
回复
确认是zImage
wwwunix 2010-08-17
  • 打赏
  • 举报
回复
对于2.6.32的kernel相关的选项在
Device Drivers--->Character devices--->Serial drivers
下,选择:
Samsung SoC serial support
Support for console on Samsung SoC serial port
Samsung S3C2440/S3C2442 Serial port support
wwwunix 2010-08-17
  • 打赏
  • 举报
回复
Uncompressing Linux........................................................................................................
这个提示没有吗?
你确认一下,看看是不是烧的zImage文件
dos5gw 2010-08-17
  • 打赏
  • 举报
回复
2#提及选项都选上了, 但开机串口只打印出

Copy linux kernel from 0x00060000 to 0x30008000, size = 0x00500000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySA
C0"
MACH_TYPE = 1999
NOW, Booting Linux......
wwwunix 2010-08-17
  • 打赏
  • 举报
回复
应该是一样的。
dos5gw 2010-08-17
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 wwwunix 的回复:]

1、在配置中进入Kernel hacking 打开Kernel debugging和Kernel low-level debugging functions 还有 Kernel low-level debugging messages via S3C UART 保存后再编译 运行
2、在Device Drivers->Character devices->Serial drivers中选择加载……
[/Quote]

我的是2.6.32的内核, 只有Kernel low-level debugging functions , 和Kernel low-level debugging via EmbeddedICE DCC channel, 但没你说的Kernel low-level debugging messages via S3C UART, 这样还能在串口看调试过程中的打印信息吗?
dos5gw 2010-08-17
  • 打赏
  • 举报
回复
汗,,,自己找到原因了, bootloader的参数是root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200

kernel的启动参数是root=/dev/hda1 ro init=/bin/bash console=ttySAC0

估计是不匹配造成的,实验中
加载更多回复(2)

4,468

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧