在模拟器上运行一个64bit linux kernel(aarch64)
来源:互联网 发布:霍启山 章子怡 知乎 编辑:程序博客网 时间:2024/04/30 00:51
为什么要在模拟器上运行一个linux kernel?
主要是为了方便调试内核和应用程序,编译内核源码,测试。aarch64,是调试64位内核和应用程序的。
1、下载编译器 64bit arm toochain
sudo apt-get install gcc-aarch64-linux-gnu
sudo apt-get install g++-aarch64-linux-gnu
2、下载qemu模拟器
git clone git://git.qemu.org/qemu.git qemu.git
cd qemu.git
./configure --target-list=aarch64-softmmu
make
3、下载文件系统
git clone git://git.buildroot.net/buildroot buildroot.git
cd buildroot.git
make menuconfig
下面是menuconfig的配置:
There are lots of configuration options to choose from but the following are what I use:
* Target Options -> Target Architecture(AArch64)
* Toolchain -> Toolchain type (External toolchain)
* Toolchain -> Toolchain (Linaro AArch64 14.02)
* System configuration -> Run a getty (login prompt) after boot (BR2_TARGET_GENERIC_GETTY)
* System configuration -> getty options -> TTY Port (ttyAMA0) (BR2_TARGET_GENERIC_GETTY_PORT)
* Target Packages -> Show packages that are also provided by busybox (BR2_PACKAGE_BUSYBOX_SHOW_OTHERS)
* Filesystem images -> cpio the root filesystem (for use as an initial RAM filesystem) (BR2_TARGET_ROOTFS_CPIO)
make
4、下载内核
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux.git
cd linux.git
ARCH=arm64 make defconfig
ARCH=arm64 make menuconfig
ARCH=arm64 make CONFIG_CROSS_COMPILE="aarch64-linux-gnu-"
5、测试 (cd qemu.git)
./aarch64-softmmu/qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic -smp 1 -m 512 -kernel ../linux-3.10.71/arch/arm64/boot/Image -initrd ../buildroot.git/output/images/rootfs.cpio --append "console=ttyAMA0"
6、mount本地文件系统
./aarch64-softmmu/qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic -smp 1 -m 512 -kernel ../linux-3.10.71/arch/arm64/boot/Image -initrd ../buildroot.git/output/images/rootfs.cpio --append "console=ttyAMA0" -fsdev local,id=r,path=/home/alex/lsrc/qemu/rootfs/trusty-core,security_model=none -device virtio-9p-device,fsdev=r,mount_tag=r
Welcome to Buildroot
buildroot login: root
# mount -t 9p -o trans=virtio r /mnt
# ls -l /mnt/
total 84
drwxr-xr-x 2 default default 4096 Apr 2 2014 bin
drwxr-xr-x 2 default default 4096 Feb 27 2014 boot
drwxr-xr-x 3 default default 4096 Apr 2 2014 dev
drwxr-xr-x 64 default default 4096 Apr 3 2014 etc
drwxr-xr-x 2 default default 4096 Feb 27 2014 home
..
buildroot login: root
# mount -t 9p -o trans=virtio r /mnt
# ls -l /mnt/
total 84
drwxr-xr-x 2 default default 4096 Apr 2 2014 bin
drwxr-xr-x 2 default default 4096 Feb 27 2014 boot
drwxr-xr-x 3 default default 4096 Apr 2 2014 dev
drwxr-xr-x 64 default default 4096 Apr 3 2014 etc
drwxr-xr-x 2 default default 4096 Feb 27 2014 home
..
7、不需要自己编译,直接使用已有的内核加文件系统
wget http://people.linaro.org/~alex.bennee/images/aarch64-linux-3.15rc2-buildroot.img
./aarch64-softmmu/qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic -smp 1 -m 2048 -kernel aarch64-linux-3.15rc2-buildroot.img --append "console=ttyAMA0"
0 0
- 在模拟器上运行一个64bit linux kernel(aarch64)
- 在Linux下运行Qemu模拟AArch64硬件调试内核
- 在Web上运行Linux—js/linux模拟器
- 在Web上运行Linux—js/linux模拟器
- 使用QEMU模拟器运行Linux kernel
- 在Ubuntu上下载、编译、运行Android内核Linux Kernel
- Darling模拟器:在Linux上运行OS X应用
- 使用自己编译的在Android上运行的内核(Linux Kernel)
- 使用自己编译的在Android上运行的内核(Linux Kernel)
- 在64-bit机器上运行32-bit的应用程序,需要安装ia32-libs库
- 在64-bit debian wheezy上运行32-bit程序真正需要做什么
- 如何在模拟器上运行apk文件
- googlemap在模拟器上运行问题
- 在xcode模拟器上运行3Dtouch
- 如何在电脑上运行模拟器
- 搭建Embedded Linux kernel环境--在QEMU上运行ARM linux系统
- 搭建Embedded Linux kernel环境--在QEMU上运行ARM linux系统
- Monkey 是运行在模拟器或设备上的一个工具,用来伪随机
- Using NDK-STACK to Debug Cocos2dx Android Project
- 为什么要学习java
- 新手报到
- 基于SPRING构建J2EE框架
- iOS开发UI篇—UIScrollView控件实现图片轮播
- 在模拟器上运行一个64bit linux kernel(aarch64)
- Android OpenGL ES 2.0绘图:绘制纹理
- 我儿沈Feng以此特记我的博客之始
- Oracle中对两个数据表交集的查询(intersect和in)
- 文章标题
- 串口显示乱码的原因总结
- onInterceptTouchEvent()的机制
- 解决ListView中有Button类而失去点击事件的问题
- 3G拨号获取不到IP--No network protocols running