qemu--使用u-boot加载内核

前面的文章中我们使用qemu启动uboot,现在我们测试在uboot下引导内核的过程。测试环境主机系统:ubuntu 18.04 LTS交叉编译工具链:arm-linux-gnueabi-uboot版本:u-boot-2017.05-rc2Kernel版本:4.4.76制作sd卡前面 kernel提示找不到,因此就停留在uboot命令行模式。qemu支持模拟sd卡,因此,我们可以制作一个sd卡,然...
摘要由CSDN通过智能技术生成

前面的文章中我们使用qemu启动uboot,现在我们测试在uboot下引导内核的过程。

测试环境

主机系统:ubuntu 18.04 LTS

交叉编译工具链:arm-linux-gnueabi-

uboot版本:u-boot-2017.05-rc2

Kernel版本:4.4.76

制作sd卡

前面 kernel提示找不到,因此就停留在uboot命令行模式。qemu支持模拟sd卡,因此,我们可以制作一个sd卡,然后将kernel、dtb文件放到sd卡,在uboot中将sd卡中的文件load到DDR,并从DDR去启动,以下命令可以用于制作vfat文件系统的sd卡,大小为512M。

使用dd命令创建文件
root@ubuntu:/home/ubuntu/Desktop# dd if=/dev/zero of=./sd_card bs=1M count=512
512+0 records in
512+0 records out
536870912 bytes (537 MB, 512 MiB) copied, 1.056 s, 508 MB/s

root@ubuntu:/home/ubuntu/Desktop# ls -l sd_card 
-rw-r--r-- 1 root root 536870912 Oct 27 23:44 sd_card
root@ubuntu:/home/ubuntu/Desktop#
创建化分区
root@ubuntu:/home/ubuntu/Desktop# fdisk ./sd_card 

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x40cdef88.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (1-4, default 1): 
First sector (2048-1048575, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-1048575, default 1048575): 

Created a new partition 1 of type 'Linux' and of size 511 MiB.

Command (m for help): p
Disk ./sd_card: 512 MiB, 536870912 bytes, 1048576 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值