27 lines
457 B
Bash
Executable File
27 lines
457 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# set root directory of project
|
|
cd "$(dirname "$0")/.."
|
|
|
|
# Build the bootloader
|
|
./scripts/create_disk.sh
|
|
|
|
# Default to KVM if available
|
|
KVM_FLAGS=""
|
|
if [ -c /dev/kvm ]; then
|
|
KVM_FLAGS="-enable-kvm -cpu host"
|
|
fi
|
|
|
|
# Run QEMU with appropriate flags
|
|
qemu-system-x86_64 \
|
|
$KVM_FLAGS \
|
|
-m 4G \
|
|
-drive file=disk.img,format=raw \
|
|
-monitor stdio \
|
|
-no-reboot \
|
|
-no-shutdown \
|
|
-smp 4 \
|
|
-serial file:serial.log
|