简体   繁体   English

如何使用QEMU学习ARM Linux kernel开发?

[英]How to use QEMU for learning ARM Linux kernel development?

I want to learn it like developing some device driver etc and use QEMU for this because i have no hardware board for ARM like beagle board.我想像开发一些设备驱动程序等一样学习它并为此使用 QEMU,因为我没有像 beagle 板一样的 ARM 硬件板。 What you guys suggest?你们有什么建议? Can i use Qemu simulator to learn Linux kernel on ARM targets?我可以使用 Qemu 模拟器在 ARM 目标上学习 Linux kernel 吗? or any other option i should try?或我应该尝试的任何其他选择?

It depends on what you want to learn: hardware or software.这取决于您想学习什么:硬件或软件。 If you really want to experiment with the different GPIO output to implement things like servo motor control, LED light blinking and display, a cheap board (eg, Raspberry Pi, about USD25) is much preferred.如果您真的想尝试不同的 GPIO output 来实现伺服电机控制、LED 灯闪烁和显示等功能,那么便宜的板子(例如 Raspberry Pi,大约 25 美元)是首选。

But if you want to learn software in general, qemu is definitely much faster, and it lets you see the internal of what is happening.但是如果你想学习一般的软件,qemu 肯定要快得多,它可以让你看到正在发生的事情的内部。 Experimenting with hardware will require oscilloscope etc. But experiment with software will depends on the error output of what others has implemented in their software.硬件实验需要示波器等。但软件实验将取决于其他人在他们的软件中实现的错误 output。

As for drivers development, first version should be rapidly developed on QEMU.至于驱动开发,第一版应该在QEMU上快速开发。 But testing which naturally involved hardware, should be done on the hardware.但是自然涉及硬件的测试,应该在硬件上进行。

Bottomline is: x86 is so much faster, that cross-crompilation is always done on x86 before it gets booted on the ARM board.底线是:x86 的速度要快得多,以至于在 x86 在 ARM 板上启动之前,始终会在 x86 上完成交叉编译。 Compiling on the board is too time consuming, and sometimes it may involved considerable amount of storage space for development libraries and source codes.在板子上编译太费时间,有时可能会占用相当大的存储空间来存放开发库和源代码。

QEMU + Buildroot is great combination for ARM kernel development QEMU + Buildroot 是 ARM kernel 开发的绝佳组合

Here is my setup that supports (mostly) both x86 and ARM: https://github.com/cirosantilli/linux-kernel-module-cheat这是我的设置,它(主要)支持 x86 和 ARM: https://github.com/cirosantilli/linux-kernel-module-cheat

The kernel, toolchain, userland and QEMU are amazingly portable, that going from x86 to ARM is almost trivial. kernel、工具链、用户空间和 QEMU 具有惊人的便携性,从 x86 到 ARM 几乎是微不足道的。

Actually, you will seldom touch arch specifics, so you might as well start with x86.实际上,您很少会触及拱形细节,因此您不妨从 x86 开始。

I haven't played with ARM devices yet, only x86 , but I bet it will be equally easy (ie not trivial due to lack of tutorials, but doable).我还没有玩过 ARM 设备, 只有 x86 ,但我敢打赌它会同样容易(即由于缺乏教程而并非微不足道,但可行)。

I used Qemu a while back to develop device drivers for an embedded programming class.我使用 Qemu 为嵌入式编程 class 开发设备驱动程序。 It worked quite well.它工作得很好。 At the time we were learning device driver programming and then transitioning to Gumstix boards.当时我们正在学习设备驱动程序编程,然后过渡到 Gumstix 板。 I don't remember exactly what core we were using, but Qemu worked well.我不记得我们使用的是什么核心,但 Qemu 运行良好。

I haven't done any ARM development, so I don't know if it is the best choice for learning ARM.没有做过ARM开发,不知道是不是学习ARM的最佳选择。 But if you are new to drivers, it is probably a good place to start.但是,如果您是司机新手,这可能是一个不错的起点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM