简体   繁体   English

使用qemu的基本Linux内核开发和测试环境

[英]Basic linux kernel development and testing environment using qemu

I want to learn about the linux kernel and this is why I wanted a simple but powerful enough way test kernel changes that I do. 我想了解Linux内核,这就是为什么我想要一种简单但功能强大的方法来测试我所做的内核更改。

I used the info on this page https://mgalgs.github.io/2015/05/16/how-to-build-a-custom-linux-kernel-for-qemu-2015-edition.html to start. 我使用了此页面上的信息https://mgalgs.github.io/2015/05/16/how-to-build-a-custom-linux-kernel-for-qemu-2015-edition.html来启动。

So now I can start a qemu session with the kernel I choose and also have busybox utilities. 因此,现在我可以使用选择的内核启动qemu会话,并且还具有busybox实用程序。

The part I cannot understand is how do I transfer a kernel module .ko on this virtual machine as to load it in my modified kernel ? 我无法理解的部分是如何在此虚拟机上传输内核模块.ko以将其加载到修改后的内核中? I tried also transfering ac program by incorporating it in the initramfs but when I try to run the program I receive the following error message: "/bin/sh: ./proc1: not found" . 我还尝试通过将其合并到initramfs中来传输ac程序,但是当我尝试运行该程序时,收到以下错误消息:“ / bin / sh:./proc1:not found”。 Should I use a virtual hdd image ? 我应该使用虚拟硬盘映像吗? If so how do I create and use one ? 如果是这样,我该如何创建和使用一个? How do I transfer files from host os to the virtual hdd ? 如何将文件从主机操作系统传输到虚拟硬盘?

Thnaks in advance. 提前想一下。

The created virtual hdd was not discovered because I didn't use mdev -s in the init file. 未找到创建的虚拟硬盘,因为我没有在初始化文件中使用mdev -s After that I could mount the sda in qemu session. 之后,我可以在qemu会话中安装sda。

The c program that could not be ran I solved by compiling it with the -static flag. 我无法运行的C程序通过使用-static标志进行编译来解决。

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

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