Fix qcow2, and add pci_passthru to MakeFile

Signed-off-by: Jiajie Chen <noc@jiegec.ac.cn>
master
Jiajie Chen 6 years ago
parent 715faca0df
commit 285df82b80
No known key found for this signature in database
GPG Key ID: 69738291461CC474

@ -42,6 +42,7 @@ $ cd rCore/user
$ make sfsimg arch={riscv32,riscv64,x86_64,aarch64} # requires x86_64-linux-musl-gcc or musl-gcc $ make sfsimg arch={riscv32,riscv64,x86_64,aarch64} # requires x86_64-linux-musl-gcc or musl-gcc
$ cd ../kernel $ cd ../kernel
$ make run arch={riscv32,riscv64,x86_64,aarch64} mode=release $ make run arch={riscv32,riscv64,x86_64,aarch64} mode=release
$ make run arch=x86_64 mode=release pci_passthru=0000:00:00.1 # for ixgbe real nic, find its pci (bus, dev, func) first
``` ```
## History ## History

@ -21,6 +21,7 @@
# | u540 Only available on riscv64, run on HiFive U540, use Sv39 # | u540 Only available on riscv64, run on HiFive U540, use Sv39
# | raspi3 Only available on aarch64, run on Raspberry Pi 3 Model B/B+ # | raspi3 Only available on aarch64, run on Raspberry Pi 3 Model B/B+
# m_mode Only available on riscv32, build for M-Mode, without MMU # m_mode Only available on riscv32, build for M-Mode, without MMU
# pci_passthru Only available on x86_64, passthrough the specified PCI device
arch ?= riscv64 arch ?= riscv64
board ?= none board ?= none
@ -29,6 +30,7 @@ LOG ?= debug
graphic ?= off graphic ?= off
smp ?= 4 smp ?= 4
m_mode ?= m_mode ?=
pci_passthru ?=
target := $(arch) target := $(arch)
build_path := target/$(target)/$(mode) build_path := target/$(target)/$(mode)
@ -68,11 +70,18 @@ qemu_net_opts := \
ifeq ($(arch), x86_64) ifeq ($(arch), x86_64)
qemu_opts += \ qemu_opts += \
-drive format=raw,file=$(bootimage) \ -drive format=raw,file=$(bootimage) \
-drive format=raw,file=$(SFSIMG),media=disk,cache=writeback \ -drive format=qcow2,file=$(SFSIMG),media=disk,cache=writeback \
-serial mon:stdio \ -serial mon:stdio \
-device isa-debug-exit -device isa-debug-exit
ifeq ($(pci_passthru), )
qemu_net_opts += \ qemu_net_opts += \
-device e1000e,netdev=net0 -device e1000e,netdev=net0
else
qemu_opts += \
-machine ubuntu,accel=kvm
qemu_net_opts += \
-device vfio-pci,host=$(pci_passthru)
endif
else ifeq ($(arch), riscv32) else ifeq ($(arch), riscv32)
qemu_opts += \ qemu_opts += \

Loading…
Cancel
Save