add Makefile info about creating disk.img for real pc with x86_64 cpu

master
chyyuu 6 years ago
parent 75ba0859cf
commit 6f5faf422d

@ -23,6 +23,7 @@
# smp = 1 | 2 | ... SMP core number # smp = 1 | 2 | ... SMP core number
# graphic = on | off enable/disable qemu graphical output # graphic = on | off enable/disable qemu graphical output
# board = none Running on QEMU # board = none Running on QEMU
# | pc Only available on x86_64, run on real pc
# | 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+
# pci_passthru = 0000:00:00.1 Only available on x86_64, passthrough the specified PCI device # pci_passthru = 0000:00:00.1 Only available on x86_64, passthrough the specified PCI device
@ -56,8 +57,17 @@ ifeq ($(arch), $(filter $(arch), aarch64 mipsel))
#link user img, so use original image #link user img, so use original image
export SFSIMG = $(user_dir)/build/$(arch).img export SFSIMG = $(user_dir)/build/$(arch).img
else else
ifeq ($(arch), x86_64)
# board is pc or qemu?
ifeq ($(board), pc)
#link user img, so use original image
export SFSIMG = $(user_dir)/build/$(arch).img
features += link_user
else
export SFSIMG = $(user_dir)/build/$(arch).qcow2 export SFSIMG = $(user_dir)/build/$(arch).qcow2
endif endif # pc or qemu
endif # x86_64
endif # aarch64 mipsel
ifeq ($(arch), aarch64) ifeq ($(arch), aarch64)
board := raspi3 board := raspi3
@ -88,10 +98,14 @@ 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)
ifeq ($(board), none)
qemu_opts += \
-drive format=qcow2,file=$(SFSIMG),media=disk,cache=writeback,id=sfsimg,if=none \ -drive format=qcow2,file=$(SFSIMG),media=disk,cache=writeback,id=sfsimg,if=none \
-device ahci,id=ahci0 \ -device ahci,id=ahci0 \
-device ide-drive,drive=sfsimg,bus=ahci0.0 \ -device ide-drive,drive=sfsimg,bus=ahci0.0
endif
qemu_opts += \
-serial mon:stdio \ -serial mon:stdio \
-m 4G \ -m 4G \
-device isa-debug-exit -device isa-debug-exit
@ -180,17 +194,18 @@ features += sv39
riscv_pk_args += --enable-sv39 riscv_pk_args += --enable-sv39
endif endif
ifneq ($(arch), x86_64)
ifneq ($(board), none) ifneq ($(board), none)
features += board_$(board) features += board_$(board)
endif endif
endif
build_args := --target targets/$(target).json --features "$(features)" build_args := --target targets/$(target).json --features "$(features)"
ifeq ($(mode), release) ifeq ($(mode), release)
build_args += --release build_args += --release
endif endif
### prefix ### ### prefix ###
ifeq ($(arch), x86_64) ifeq ($(arch), x86_64)
ifeq ($(uname), Darwin) ifeq ($(uname), Darwin)

Loading…
Cancel
Save