linux-kernel - Linux 内核 - 错误 : Failed to allocate 0x6b3c bytes below 0x1000000

标签 linux-kernel embedded-linux u-boot powerpc device-tree

我将我的 rootfs (CONFIG_INITRAMFS_SOURCE) 包含到我的内核中,所以内核现在有 17Mb 的大小:

$ ls -la uImage
-rw-r--r-- 1 kkr kkr 17669274 Dec  1 18:59 uImage
$ d2h 17669274
0x10D9C9A

由于它是压缩的,所以它会占用未压缩的 39Mb:

$ dd if=uImage of=uImage-x.gz bs=64 skip=1
$ file uImage-x.gz
uImage-x.gz: gzip compressed data, max compression, from Unix
$ gunzip uImage-x.gz
$ ls -la uImage-x 
-rw-r--r-- 1 kkr kkr 39852288 Dec  1 19:18 uImage-x
$ d2h 39852288
0x2601900

为什么我不能用这个命令通过 uBoot 启动我的内核?

=> setenv bootargs console=$consoledev,$baudrate $othbootargs

=> tftp 0x3000000 $bootfile
Speed: 100, half duplex
Using eTSEC1 device
TFTP from server 192.168.32.3; our IP address is 192.168.32.32
Filename 'uImage-powerpc'.
Load address: 0x3000000
Loading: #####################################################
done
Bytes transferred = 17669274 (10d9c9a hex)

=> tftp  0x2700000 $fdtfile;
Speed: 100, half duplex
Using eTSEC1 device
TFTP from server 192.168.32.3; our IP address is 192.168.32.32
Filename 'sat_92107.100.00C_p2020.dtb'.
Load address: 0x2700000
Loading: ##
done
Bytes transferred = 15164 (3b3c hex)

=> bootm 0x3000000 - 0x2700000
## Booting kernel from Legacy Image at 03000000 ...
   Image Name:   Linux-4.0.0-AOA00.01-00662-g07ae
   Created:      2015-12-01  17:59:21 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    17669210 Bytes = 16.9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02700000
   Booting using the fdt blob at 0x02700000
   Uncompressing Kernel Image ... OK
ERROR: Failed to allocate 0x6b3c bytes below 0x1000000.
device tree - allocation error

由于内核本身需要 0x10d9c9a 字节(压缩)或 0x2601900 字节(未压缩),所以没有机会将设备树放在 0x1000000 下面.该值 (16Mb) 是否可配置?否则我提取的内核是否小于 16Mb?

最佳答案

是的,通过将环境变量 bootm_lowbootm_size 设置为十六进制值,可以在 U-Boot 中配置此值。在您的例子中,它分别是 0x00x20000000

请参阅 U-Boot 源代码树中大 README 文件的“环境变量”部分。

关于linux-kernel - Linux 内核 - 错误 : Failed to allocate 0x6b3c bytes below 0x1000000,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34027642/

相关文章:

c - 如何将包含指针的结构从用户空间复制到内核

c++ - 子进程的主要功能

linux - Yocto 和 Freescale saber 的 HDMI 支持

linux - U-boot 的 "source"命令的镜像格式错误

bootloader - U-Boot 中的 `tftp` 命令 : Binary image or U-Boot image?

linux - 在fuse 2.9中用什么替代fuse.ko作为内核模块

linux-kernel - 从 S3C6410 板启动时无法在未知 block (0,0) 上挂载根 fs

linux - 适合初学者的嵌入式 Linux

linux - 如何在不同的驱动程序之间共享设备树节点中的信息

c - Linux 内核模块编程 - 无法使用 CONFIG_CC_STACKPROTECTOR_REGULAR : -fstack-protector not supported by compiler