QEMU上的Linux Vanilla内核并与eth0联网 [英] Linux vanilla kernel on QEMU and networking with eth0

查看:291
本文介绍了QEMU上的Linux Vanilla内核并与eth0联网的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载并编译了香草linux内核(3.7.1) 我将busybox用于ramdisk,然后使用QEMU对其进行了引导. 这是我的QEMU命令行

I have downloaded and compiled vanilla linux kernel (3.7.1) I used busybox for ramdisk then I booted it using QEMU. This is my QEMU command line

qemu-system-i386 -kernel bzImage -initrd ramdisk.img -append "root=/dev/ram rw console=ttyS0 rdinit=/bin/ash" -nographic -net nic -net user

一切顺利. 但是,我无法在带有busybox的香草内核上使用网络.

everything goes well. However, I can't use networking on vanilla kernel with busybox.

'ifup eth0'告诉我

'ifup eth0' tells me

/ # ifup eth0
ip: SIOCGIFFLAGS: No such device

我在互联网上搜索了一下,但是找不到任何线索... 一些建议会很好 预先谢谢你.

I googled the Internet but can' get any clue... some advice would be nice thank you in advance.

推荐答案

很可能没有加载驱动程序(在您的示例中应该是e1000)或设备使用了其他名称.

Most probably there is no driver (in your example is should be e1000) loaded or the device has another name.

在/sys/class/net/中,您应该找到所有可用的网络设备的列表. 如果没有(除了),则不会加载驱动程序.

In /sys/class/net/ you should find a listing of all available net-devices. If there is none (besides lo) the driver is not loaded.

在qemu监视器中,键入"info pci",它将显示您的以太网卡的PCI地址.它应该看起来像这样:

In qemu monitor type "info pci" and it will show you the PCI-address of your ethernet card. It should look like this:

...
Bus  0, device   3, function 0:
  Ethernet controller: PCI device 8086:100e
...

此设备对应于/sys/devices/pci0000:00/0000:00:03.0/. 文件"vendor"和"device"必须包含"0x8086"和"0x100e",这是上面的PCI-id,内核通过该ID来确定要加载的驱动程序.

This device corresponds to /sys/devices/pci0000:00/0000:00:03.0/. The files "vendor" and "device" must contain "0x8086" and "0x100e" which is the PCI-id from above and by which the kernel determines the driver to load.

尝试使用"modprobe e1000"或insmod手动加载它.如果已加载,则必须有一个名为驱动程序"的符号链接.如果不是,则"dmesg"应为您提供原因.

Try to load it manually with "modprobe e1000" or insmod. If loaded there must be a symlink named "driver". If not "dmesg" should give you the reason why not.

这篇关于QEMU上的Linux Vanilla内核并与eth0联网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆