qemu下运行lk(little kernel)

作者: bnblzq 2017-02-15 11:15:11

lk(https://github.com/littlekernel)是little kernel的简称, 是一个托管在github的开源项目.作用和UBoot类似,作为bootloader进行系统的引导.


QEMU(https://en.wikipedia.org/wiki/QEMU)是一套跑在Linux下的虚拟机.具体参见wiki.


预备条件,ubuntu 需要安装如下的工具


sudo apt-get install zlib1g-dev


sudo apt-get install libglib2.0-0


sudo apt-get install libglib2.0-dev


sudo apt-get install gcc-arm-linux-gnueabi


 


1.安装qemu


本机的作业环境是win10,vmware 12,UBuntu 16.04 desktop.


1.1.安装


sudo apt-get install qumu


1.2.查看版本


lk官方推荐最好是v2.4 及以上的版本


qemu-system-arm --version


1.3.查看支持的板子型号


qemu-system-arm --machine help


 


2.lk部分


2.1.获得源码


git clone https://github.com/littlekernel/lk.git


2.2.运行lk


2.2.1.进入lk根目录,输入


./scripts/do-qemuarm 


这时候提示编译错误:


make/compile.mk:45: recipe for target 'build-qemu-virt-a15-test/external/lib/heap/dlmalloc/dlmalloc.o' failed


make[2]: *** [build-qemu-virt-a15-test/external/lib/heap/dlmalloc/dlmalloc.o] Error 1


看提示应该是想生成dlmalloc.o的时候失败了,dlmalloc应该是和heap有关的部分,从脚本里面看到可以通过带参数(-M)改变原本要链接进去的dlmalloc.


2.2.2.重新输入.


./scripts/do-qemuarm -M


2.2.3.成功!!




welcome to lk/MP




 


本文永久更新地址:http://www.linuxdiyf.com/linux/28429.html

相关资讯