You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在QEMU中配置EFI Shell支持HTTP请求的问题排查

UEFI HTTP命令在QEMU环境下无法正常工作的问题排查

问题背景

我正在开发一款需通过HTTP执行GET请求的UEFI应用,需先确保环境配置正常以保障HTTP请求可发送。我花费数日尝试让QEMU中启动的EFI Shell内的http命令正常工作,ping命令可正常使用,但执行:

http httpbin.org/get

始终返回:

Unable to open http protocol on `eth0` - Unsupported
Unable to download the file `/get` on `eth0` - Unsupported

当前网络配置

我的startup.nsh脚本用于配置EFI Shell网络接口:

connect
ifconfig -r eth0
ifconfig -s eth0 dhcp
ifconfig -l eth0 

已尝试的QEMU启动配置

我尝试了多种QEMU启动配置:

-netdev user,id=mynet0,hostfwd=tcp::8080-:80 -device e1000,netdev=mynet0 \
-netdev user,id=user.0 -device e1000,netdev=user.0 \
-nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 \

同时尝试配置tap设备但未成功,启动命令如下:

-netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no -device e1000,netdev=mynet0,mac=52:55:00:d1:55:01 \

疑问

  • 我遗漏了哪些步骤?
  • 在让eth0支持HTTP方面可能哪里出错了?
  • tap设备是必需的吗?
  • 能否成功搭建该环境?

更新内容

感谢@MiSimon的建议,我之前未意识到HttpDxe驱动未随OvmfPkg一起编译,已将其INF文件添加到OvmfPkgX64.dsc和OvmfPkgX64.fdf中。不过执行drivers命令时显示重复条目:

0000000A D - -  1  - HttpDxe                             HttpDxe
0000000A ? - -  -  - HttpDxe                             HttpDxe

执行http命令时错误信息变为:

Downloading 'http://httpbin.org/get'
Unable to download the file '/get' on 'eth0' - Unsupported

调试日志显示:

HttpNotify: Event - 0, EventStatus - Unsupported
Error: Could not retrieve the host address from DNS server.

内容的提问来源于stack exchange,提问作者CrossedCarpet

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.31 19:20:53