Starting Kernel...后没有信息显示的部分可能原因(专属TI处理器)

本文介绍了在启动Linux内核过程中常见的三个问题:启动内核后控制台无输出、启动参数错误及控制台提示符未出现的原因及解决办法。

Problem #1 - No more output is seen on the console after "Starting Kernel..."

The first problem a user may encounter when booting the kernel, is that no further output after "Starting kernel..." is seen on the console. For example:

## Booting kernel from Legacy Image at 80300000 ...
   Image Name:   Linux-2.6.31
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1750680 Bytes =  1.7 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

The above console output is printed by the u-boot boot-loader when starting linux and the message "Starting kernel..." is last message that u-boot will print before starting the kernel. The above problem is typically caused by mis-configuring the tty interface that the linux kernel uses by default for displaying the console messages. The default tty interface used the linux kernel for OMAP devices is configured in the kernel menuconfig. You can check the tty interface being used for an OMAP device by viewing the kernel .config file and seeing which CONFIG_OMAP_LL_DEBUG_UARTx is selected. For example, the OMAP3 beagle-board uses UART3 for displaying the console messages. Hence, when using the OMAP3 beagle-board the following should be found in the .config file:

# CONFIG_OMAP_LL_DEBUG_UART1 is not set
# CONFIG_OMAP_LL_DEBUG_UART2 is not set
CONFIG_OMAP_LL_DEBUG_UART3=y

The default tty interface used by the linux kernel for OMAP can be configured by starting the linux menuconfig utility (by executing "make menuconfig") and going to "System Type --> TI OMAP Implementations --> Low-level debug console UART".

 

Problem #2 - No more output is seen on the console after "booting the kernel"

Another problem a user may encounter when booting the kernel, is that no further output after "booting the kernel" is seen on the console. For example:

## Booting kernel from Legacy Image at 80300000 ...
   Image Name:   Linux-2.6.31
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1750680 Bytes =  1.7 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.............................................................
................................................. done, booting the kernel.

This problem can be caused by a number of reasons. The most common reasons are listed below.

Cause #1 - The linux console boot parameter is incorrect

If the "console" boot parameter passed by the boot-loader to the kernel is incorrect then the above failure will be observed. This could be as simple as a typographical error. For example, by default the OMAP3 beagle-board displays console messages on the UART3 port and the default configuration of UART3 port is 115200 baud, 8-bit data, no parity and no flow control. Hence, viewing the u-boot boot arguments you should see something like the following:

OMAP3 beagleboard.org # printenv bootargs
bootargs=console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootwait

The console parameter is case-sensitive and so make sure it is written correctly for the board you are using and there are no spaces. For example, "console=ttyS2, 115200n8" would not work.

On Linux kernels version 2.6.36 and newer, use ttyO2 instead of ttyS2 (that's capital-O, not zero).

The best way to avoid such errors is to use a script for your boot parameters. Sample Teraterm_Scripts are available. Similar scripts can be created for Linux Minicom users.

Cause #2 - Mis-match between boot-loader and kernel machine numbers

Linux does not allow you to boot a kernel built for one hardware platform on some other piece of hardware, even if the underlying processor is the same. There is no reason why you would ever want to! When the kernel starts, one of the first things it does is to check that the machine number passed by the boot-loader matches the machine number that the kernel was built for. If the machine numbers do not match the kernel will not boot. This is a good thing!

You can check by re-building your kernel with CONFIG_DEBUG_LL enabled. To enable this start the linux menuconfig utility (by executing "make menuconfig") and go to "Kernel hacking" and select "Kernel low-level debugging functions". For example, if you were to enable this option and attempt to boot an OMAP3 EVM kernel on an OMAP3 beagle-board the following message would be seen.

Error: unrecognized/unsupported machine ID (r1 = 0x0000060a).

Available machine support:

ID (hex)        NAME
000005ff        OMAP3 EVM

Please check your kernel config and/or bootloader.

Cause #3 - A software bug

If the previous causes did not solve your problem, then there is a chance that a software change is breaking the kernel for the device you are building for. To get more information on exactly where the kernel is failing, it is recommended that you enable CONFIG_DEBUG_LL in the linux kernel configuration. This may print out more information after "booting the kernel" is seen and may help determine where the kernel is failing. Even if you are unable to make any further progress from here, providing as much information as you can will help others determine where the problem is.

 

Problem #3 - No console prompt seen after kernel boot

After the kernel has finished booting you may see a console message such as "Please press Enter to activate this console" and when hitting enter a console prompt appear which may be signified by a character such as "#". An example output is shown below.

Sending DHCP requests .<6>eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
., OK
IP-Config: Got DHCP answer from 255.255.255.255, my address is 128.247.107.23
IP-Config: Complete:
     device=eth0, addr=128.247.107.23, mask=255.255.254.0, gw=128.247.106.2,
    host=128.247.107.23, domain=am.dhcp.ti.com, nis-domain=(none),
    bootserver=255.255.255.255, rootserver=128.247.107.35, rootpath=
Looking up port of RPC 100003/2 on 128.247.107.35
Looking up port of RPC 100005/1 on 128.247.107.35
VFS: Mounted root (nfs filesystem).
Freeing init memory: 136K
init started: BusyBox v1.11.1 (2008-10-05 04:40:51 CDT)
starting pid 288, tty : '/etc/init.d/rcS'

   System initialization...

   Hostname       : OMAP3EVM
   Filesystem     : v1.0.0

   Kernel release : Linux 2.6.22.18-omap3
   Kernel version : #12 Mon Oct 6 01:22:49 CDT 2008

Mounting /proc             : [SUCCESS]
Mounting /sys              : [SUCCESS]
Mounting /dev              : [SUCCESS]
Mounting /dev/pts          : [SUCCESS]
Enabling hot-plug          : [SUCCESS]
Populating /dev            : [SUCCESS]
Disabling Power mgmt       : [SUCCESS]
Turn off LCD after 1 hour  : [SUCCESS]
Mounting other filesystems : [SUCCESS]
Starting syslogd           : [SUCCESS]
Starting telnetd           : [SUCCESS]

System initialization complete.

Please press Enter to activate this console.

The console message indicates that a UNIX shell has been started and you may enter commands through what is knowns as the command-line. If you do not see such a message or a prompt appear and you are unable to enter commands via the command-line after the kernel boots, then typically indicates that the start-up scripts in file-system are selecting the wrong tty interface for the console. For example, this article describes how to create a busybox root file-system for an OMAP3 device. If you refer to this section on configuring the file-system you will find that a file called /etc/inittab is created with the following contents.

::sysinit:/etc/init.d/rcS 

# /bin/ash
#
# Start an "askfirst" shell on the serial port
ttyS0::askfirst:-/bin/ash

# Stuff to do when restarting the init process
::restart:/sbin/init

# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a

The above file is executed once the kernel has booted and you can see near the top of the script a "askfirst" shell is launch on ttyS0. If you attempted to use this file-system as-is with a OMAP3 Beagle board that uses ttyS2 for console output then you would not see a console prompt after the kernel boots. This is easily corrected by editing the above file and changing ttyS0 to ttyS2.

<think>好的,用户的问题是关于在编译Linux 4.19-rc3内核后,使用U-Boot引导时卡在“Starting kernel ...”的情况,特别是针对mini2440开发板。我需要一步步分析可能原因和解决方案。 首先,回忆一下这个问题的常见原因。卡在“Starting kernel ...”通常意味着内核启动过程中遇到了严重错误,可能无法正确初始化硬件或跳转到内核入口点。可能原因包括内核配置错误、设备树(DTB)问题、U-Boot参数设置不当、内核镜像格式或加载地址错误,以及串口驱动或早期控制台配置问题。 接下来,需要具体针对mini2440的情况来考虑。mini2440是基于ARM9的处理器,属于较旧的硬件,可能有一些特定的配置需求。例如,内核配置中需要包含对S3C2440处理器的支持,以及相关的驱动如串口驱动、NAND Flash驱动等。同时,设备树是否正确生成和加载也是关键,因为较新的内核版本可能依赖设备树来配置硬件。 然后,检查U-Boot的环境变量,尤其是bootcmd和bootargs。确保bootargs中的控制台参数正确指定了串口设备和波特率,比如console=ttySAC0,115200。另外,内核镜像的加载地址是否正确,是否与U-Boot的加载地址一致,例如是否从0x30008000启动。 内核镜像的格式也是一个需要注意的点。旧版U-Boot可能需要使用uImage格式,而不是zImage,因为uImage包含U-Boot的头部信息。需要确认生成的是否为正确的uImage,并且使用mkimage工具处理过。 此外,串口驱动的兼容性问题可能导致控制台输出无法显示,进而看起来像是内核卡住。需要确保内核配置中启用了正确的串口驱动,比如S3C2440的串口驱动,并且设备树中正确配置了串口节点。 可能的解决步骤包括:检查内核配置,确保处理器和必要驱动启用;验证设备树的正确性;检查U-Boot环境变量;确认内核镜像格式和加载地址;尝试启用早期调试选项,如earlyprintk和earlycon;检查硬件连接,如串口线是否正确。 最后,如果以上步骤无法解决,可能需要查阅社区或类似问题的经验,看看是否有特定的补丁或配置调整适用于mini2440和这个内核版本的组合。可能需要启用更多的调试选项,甚至逐步跟踪内核启动过程,以确定具体的故障点。</think>针对Linux 4.19-rc3内核在mini2440开发板上U-Boot引导卡在"Starting kernel..."的问题,以下是系统性排查指南: --- ### 一、常见原因分析 1. **内核配置问题** - 缺少S3C2440处理器支持 - 未启用关键驱动(如NAND Flash控制器、DM9000网卡) - 控制台串口驱动未正确配置(`CONFIG_SERIAL_S3C24XX=y`) 2. **设备树(DTB)问题** - 未生成或加载正确的设备树二进制文件(如`s3c2440-mini2440.dtb`) - 设备树中串口/内存节点配置错误 3. **U-Boot参数错误** - 内核加载地址不正确(应匹配`CONFIG_S3C2440_PHYS_OFFSET=0x30000000`) - `bootargs`未正确设置控制台参数: ```bash setenv bootargs console=ttySAC0,115200 root=/dev/mtdblock3 rootfstype=jffs2 ``` 4. **镜像格式问题** - U-Boot可能需要`uImage`而非`zImage` - 未使用`mkimage`添加U-Boot头: ```bash mkimage -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008000 -n Linux-4.19.0 -d zImage uImage ``` --- ### 二、关键调试步骤 1. **验证U-Boot环境变量** ```bash # 确认加载地址与内核配置一致 setenv loadaddr 0x30008000 # 确认bootm命令参数 setenv bootcmd 'nand read ${loadaddr} 0x60000 0x300000; bootm ${loadaddr}' ``` 2. **启用早期调试输出** 在内核配置中: ```bash CONFIG_DEBUG_LL=y # 启用低级调试 CONFIG_EARLY_PRINTK=y # 早期控制台输出 CONFIG_DEBUG_UNCACHED=y # 避免缓存问题 ``` 在设备树中添加: ```dts chosen { bootargs = "earlycon=s3c2410,0x50000000 console=ttySAC0,115200"; }; ``` 3. **检查内存映射** - 确认内核`phys_offset`与U-Boot一致 - 验证`CONFIG_PAGE_OFFSET=0xC0000000`(ARM32标准配置) --- ### 三、硬件兼容性注意 1. **NAND Flash分区表** ```bash # 典型mini2440分区布局 setenv mtdparts mtdparts=nand:256k@0(bootloader),128k(params),5m(kernel),-(rootfs) ``` 2. **串口连接验证** - 确认使用开发板上的`ttySAC0`(非ttyS0) - 检查波特率是否匹配(115200 8N1) --- ### 四、测试建议 1. **最小化内核测试** ```bash # 编译仅含基本功能的内核 make menuconfig # 禁用模块化:取消CONFIG_MODULES # 仅保留以下驱动: CONFIG_ARM_MINI2440=y CONFIG_MTD_NAND_S3C2410=y CONFIG_FB_S3C2410=y ``` 2. **使用JTAG调试** 如果仍无法启动,可通过OpenOCD+JTAG: ```bash halt arm7_9 sw_bkpts enable load_image uImage 0x30008000 resume 0x30008000 ``` --- ### 五、已知补丁需求 该内核版本可能需要针对mini2440的补丁: ```bash # 应用S3C24XX DMA修复补丁 git apply 0001-ARM-s3c24xx-fix-dma-subsystem-initialization.patch ``` 建议参考mini2440社区维护的分支: [https://github.com/legacy-embedded/linux/tree/mini2440](https://github.com/legacy-embedded/linux/tree/mini2440) --- 通过以上步骤逐步排查,80%的问题可定位到设备树配置或U-Boot参数错误。若仍无法解决,建议捕获启动时的JTAG调试信息或使用示波器检测CPU复位信号。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值