go 0x30008000之后遇到的问题

本文档解决了U-Boot启动Linux内核时遇到的多种问题,包括因启动参数不一致导致的“booting the kernel”卡顿、无法加载根文件系统及控制台初始化失败等问题。提供了详细的解决步骤。

go 0x30008000之后遇到的问题

停在"booting the kernel"不动了!
-------------------------------------------
问题:
Uboot> go 0x30008000 (启动内核)
Uncompressing Linux................................................................ done, booting the kernel.
显示到这里就不动了

问题原因:
    u-boot的启动参数bootargs=console=ttySAC0和内核的启动参数initrd=0x30800000,0x800000 mem=64M root=/dev/ram0 init=/linuxrc console=ttyS0,115200不一致!!!
    
解决方法:
    (1)
    # vi u-boot-1.1.6/include/configs/smdk2410.h
    #define CONFIG_BOOTARGS     "console=ttySAC0"

    或者启动u-boot后设置启动变量
    [ ~zxl@DTK ] set bootargs console=ttySAC0
    [ ~zxl@DTK ] saveenv

    (2)    
    内核配置的问题(make menuconfig)
    命令行的console参数错了,应该为console=ttySAC0,不是console=ttyS0。
    initrd=0x30800000,0x800000 mem=64M root=/dev/ram0 init=/linuxrc console=ttyS0,115200
    ====>
    initrd=0x30800000,0x800000 mem=64M root=/dev/ram0 init=/linuxrc console=ttySAC0,115200



没有加载根文件系统
-------------------------------------------
问题:
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

问题原因:
(1) u-boot中的CONFIG_BOOTARGS宏定义(include/configs/smdk2410.h)与kernel的配置文件中的CONFIG_CMDLINE(.config)宏定义不匹配。
    其实这个错误原因和上面问题的错误原因是一样的:都是因为u-boot的CONFIG_BOOTARGS参数和kernel的CONFIG_CMDLINE参数不一致造成了。
    统一的解决方法: 在u-boot中不设置CONFIG_BOOTARGS,在kernel中也不设置CONFIG_CMDLINE。将他们的设置统一放在u-boot启动后,设置bootargs.

[ ~zxl@DTK ] setenv bootargs "console=ttySAC0 initrd=0x30800000,0x800000 root=/dev/ram init=/linuxrc"

注:
initrd=0x30800000,0x800000
    说明ramdisk位置在0x30800000,大小是8M。注意:(a)通过网络下载ramdisk是需要下载到开发板上SDRAM的0x30800000处。(b)Default RAM disk size.需要设置为:8192kbytes
root=/dev/ram
    指明根文件系统在/dev/ram上
console=/dev/ttySAC0,115200
    说明初始化控制台时,使用设备/dev/ttySAC0,波特率为115200


(2) 下载到开发板上的ramdisk.gz有问题或者没有加载ramdisk.gz。需要重新制作ramdisk。



Warning: unable to open an initial console.
-------------------------------------------
在ramdisk中建立console和null即可
# mount -o loop ramdisk /mnt
# mkdir /mnt/dev 
# cd /mnt/dev
# mknod -m 660 console c 5 1
# mknod -m 660 null c 1 3



Starting pid 750, console /dev/console: '/etc/init.d/rcS'
Bummer, could not run '/etc/init.d/rcS': No such file or directory
Bummer, could not run '/etc/init.d/rcS': No such file or directory
-------------------------------------------
ramdisk的制作不完善!
# mount -o loop ramdisk /mnt/
# mkdir /mnt/etc/
# cp -r busybox-1.1.2/examples/bootfloppy/etc/init.d/ /mnt/etc/
goroutine 3644 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:26 +0x5e github.com/langgenius/dify-plugin-daemon/internal/types/exception.InternalServerError({0x299d440, 0xc0010da710}) /app/internal/types/exception/factory.go:27 +0x27 github.com/langgenius/dify-plugin-daemon/internal/server.(*App).redirectPluginInvokeByPluginIdentifier(0xc000125e90, 0xc000564400, {0xc000ca0840?, 0xf884f6?}, {0x299d440, 0xc0010da6c0}) /app/internal/server/middleware.go:120 +0xef github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).RedirectPluginInvoke.func2(0xc000564400) /app/internal/server/middleware.go:94 +0x95 github.com/gin-gonic/gin.(*Context).Next(0xc000564400) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).FetchPluginInstallation.func1(0xc000564400) /app/internal/server/middleware.go:66 +0x2d2 github.com/gin-gonic/gin.(*Context).Next(0xc000564400) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginGroup.CheckingKey.func1(0xc000564400) /app/internal/server/middleware.go:24 +0x95 github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0xc000564400) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 +0x6f github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.LoggerWithConfig.func1(0xc000564400) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 +0xe5 github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0006cfa00, 0xc000564400) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 +0x892 github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc0006cfa00, {0x29cc6d0, 0xc0001ca620}, 0xc00026c640) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 +0x1b2 net/http.serverHandler.ServeHTTP({0x29bedc8?}, {0x29cc6d0?, 0xc0001ca620?}, 0x6?) /usr/local/go/src/net/http/server.go:3210 +0x8e net/http.(*conn).serve(0xc000e86900, {0x29d0fb0, 0xc00080aea0}) /usr/local/go/src/net/http/server.go:2092 +0x5d0 created by net/http.(*Server).Serve in goroutine 47 /usr/local/go/src/net/http/server.go:3360 +0x485
07-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值