-
Notifications
You must be signed in to change notification settings - Fork 1
/
boot.sh
executable file
·45 lines (37 loc) · 1.01 KB
/
boot.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
42
43
44
45
#!/bin/bash
MACH=ls3a7a
QVER=loongson-v1.0
# Based on v3.10
KVER=loongnix-release-1903
RVER=2016.05
# Minimal memory for boot is 256M, but with graphic, 1024M is required
MEM=1024M
# Kernel and dtb
DTB=kernel/$KVER/loongson3_ls7a.dtb
KERNEL=kernel/$KVER/vmlinuz
# Rootfs
INITRD=root/$RVER/rootfs.cpio.gz
# Qemu environments
XENVS=INITRD_OFFSET=0x04000000
# Usb input devices
USB="-device usb-mouse -device usb-kbd -show-cursor"
# maxcpus=1 must be passed to not hang at booting
# Booting CPU#1...
# [ 0.150000] CPU#1, func_pc=ffffffff80da1c7c, sp=980000000c0f3eb0, gp=980000000c0f0000
# [ 0.256000] random: fast init done
# Graphic boot or not, 1 for graphic, 0 for serial
G=0
if [ $G -eq 1 ]; then
CONSOLE=tty0
GOPT=
else
GOPT=-nographic
CONSOLE=ttyS0
fi
env $XENVS ./qemu/$QVER/bin/qemu-system-mips64el -M $MACH -m $MEM -smp 1 -no-reboot $GOPT \
-kernel $KERNEL \
-initrd $INITRD \
-dtb $DTB \
$USB \
-append "route=172.17.0.5 root=/dev/ram0 console=$CONSOLE maxcpus=1"
#-net nic,model=synopgmac -net tap