-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-qemu.sh
executable file
·41 lines (34 loc) · 973 Bytes
/
run-qemu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
OVMF_CODE=resource/OVMF_CODE-pure-efi.fd
OVMF_VARS=resource/OVMF_VARS-pure-efi.fd
BUILD_DIR=mnt
BOOT_DIR=$BUILD_DIR/EFI/BOOT
BOOT_LOADER=$1
KERNEL=$2
echo $OVMF_CODE
echo $OVMF_VARS
echo $BOOT_LOADER
echo $KERNEL
mkdir -p mnt/EFI/BOOT
cp $BOOT_LOADER $BOOT_DIR/BootX64.efi
cp $KERNEL $BUILD_DIR/kernel.elf
echo "\EFI\BOOT\BOOTX64.EFI" > mnt/startup.nsh
qemu-system-x86_64 \
-nodefaults \
-machine q35,accel=kvm:tcg \
-vga std \
-m 128M \
-drive if=pflash,format=raw,file=$OVMF_CODE,readonly=on \
-drive if=pflash,format=raw,file=$OVMF_VARS \
-drive format=raw,file=fat:rw:$BUILD_DIR \
-serial stdio \
-monitor vc:1024x768 \
# qemu-system-x86_64 \
# -nodefaults \
# -machine q35,accel=kvm:tcg \
# -vga std \
# -m 128M \
# -drive if=pflash,format=raw,file=$OVMF_CODE,readonly=on \
# -drive if=pflash,format=raw,file=$OVMF_VARS \
# -drive format=raw,file=fat:rw:$BUILD_DIR \
# -monitor stdio