-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·37 lines (31 loc) · 951 Bytes
/
run.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
#!/bin/bash
# Set QEMU_BUILD_DIR to the build directory
QEMU_BUILD_DIR=/home/pranith/workspace/code/qemu/relbuild/
ARCH=arm64
NCPUS=1
MTTCG=off
if [ "$1" = "x86" ]; then
ARCH=x86
QEMU=$QEMU_BUILD_DIR/x86_64-softmmu/qemu-system-x86_64
KERNEL_IMG=kernel/linux/arch/x86/boot/bzImage
CPU=qemu64
MACHINE=pc
elif [ "$1" = "arm64" ]; then
ARCH=arm64
QEMU=$QEMU_BUILD_DIR/aarch64-softmmu/qemu-system-aarch64
KERNEL_IMG=kernel/linux/arch/arm64/boot/Image
CPU=max
MACHINE=virt,gic-version=3
fi
function buildComponents {
cd initrd && ./getbusybox.sh $ARCH && cd ..
cd kernel && ./getkernel.sh $ARCH && cd ..
}
if [ "$2" = "build" ]; then
buildComponents
fi
echo === RUNNING QEMU ===
$QEMU -kernel $KERNEL_IMG \
-m 2048 -M $MACHINE -cpu $CPU \
-append "console=tty0 console=ttyAMA0 console=ttyS0 ignore_loglevel initcall_debug=1 init=/init/" \
-nographic -smp $NCPUS # --enable-kvm