forked from ghaerr/elks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqemu.sh
executable file
·87 lines (72 loc) · 3.04 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Helper to run ELKS in QEMU
# Auto-select QEMU system emulator variant
[ -x /usr/bin/qemu-system-i386 ] && QEMU="qemu-system-i386"
[ -x /usr/bin/qemu-system-x86_64 ] && QEMU="qemu-system-x86_64"
[ -x /usr/local/bin/qemu-system-i386 ] && QEMU="qemu-system-i386"
[ -x /usr/local/bin/qemu-system-x86_64 ] && QEMU="qemu-system-x86_64"
[ -z $QEMU ] && { echo 'QEMU system emulator not found!'; exit 1; }
echo "Using QEMU: $QEMU"
# Select disk image to use
# MINIX or FAT .config build
#IMAGE="-fda image/fd2880.bin"
IMAGE="-fda image/fd1440.bin"
#IMAGE="-fda image/fd720.bin"
#IMAGE="-fda image/fd360.bin"
#IMAGE="-hda image/hd.bin"
#IMAGE="-boot order=a -fda image/fd1440.bin -drive file=image/hd32-minix.bin,format=raw,if=ide"
# FAT package manager build
#IMAGE="-fda image/fd360-fat.bin"
#IMAGE="-fda image/fd720-fat.bin"
#IMAGE="-fda image/fd1440-fat.bin"
#IMAGE="-fda image/fd2880-fat.bin"
#IMAGE="-hda image/hd32-fat.bin"
#IMAGE="-hda image/hd32-fat.bin -fda image/fd1440-minix.bin"
# MINIX package manager build
#IMAGE="-fda image/fd360-minix.bin"
#IMAGE="-fda image/fd720-minix.bin"
#IMAGE="-fda image/fd1440-minix.bin"
#IMAGE="-fda image/fd2880-minix.bin"
#IMAGE="-hda image/hd32-minix.bin"
# Second disk for mount after boot
#DISK2="-fdb image/fd360-fat.bin"
#DISK2="-fdb image/fd720-fat.bin"
#DISK2="-fdb image/fd1440-fat.bin"
#DISK2="-fdb image/fd2880-fat.bin"
#DISK2="-fdb image/fd360-minix.bin"
#DISK2="-fdb image/fd720-minix.bin"
#DISK2="-fdb image/fd1440-minix.bin"
#DISK2="-fdb image/fd2880-minix.bin"
[ -z "$IMAGE" ] && { echo 'Disk image not found!'; exit 1; }
echo "Using disk image: $IMAGE"
# Select your keyboard mapping here:
# KEYBOARD="-k en-us"
# KEYBOARD="-k fr"
KEYBOARD=
# Select pty serial port or serial mouse driver
#SERIAL="-chardev pty,id=chardev1 -device isa-serial,chardev=chardev1,id=serial1"
#SERIAL="-chardev msmouse,id=chardev1 -device isa-serial,chardev=chardev1,id=serial1"
# Uncomment this to route ELKS /dev/ttyS0 to host terminal
#CONSOLE="-serial stdio"
# Hides qemu window also
#CONSOLE="-serial stdio -nographic"
# Host forwarding for networking
# No forwarding: only outgoing from ELKS to host
# HOSTFWD="-net user"
# Incoming telnet forwarding: example: connect to ELKS with telnet localhost 2323
# HOSTFWD="-net user,hostfwd=tcp:127.0.0.1:2323-10.0.2.15:23"
# Incoming http forwarding: example: connect to ELKS httpd with 'http://localhost:8080'
# HOSTFWD="-net user,hostfwd=tcp:127.0.0.1:8080-10.0.2.15:80"
# Simultaneous telnet and http forwarding
FWD="hostfwd=tcp:127.0.0.1:8080-10.0.2.15:80,hostfwd=tcp:127.0.0.1:2323-10.0.2.15:23"
# new style
#NET="-net nic,model=ne2k_isa -net user,$FWD"
# old style, with configurable interrupt line
NET="-netdev user,id=mynet,$FWD -device ne2k_isa,irq=12,netdev=mynet"
# Enable network dump here:
# NETDUMP="-net dump"
# Determine display type ("Darwin" = OSX)
[ `uname` != 'Darwin' ] && QDISPLAY="-display sdl"
# Configure QEMU as pure ISA system
exec $QEMU $CONSOLE -nodefaults -name ELKS -machine isapc -cpu 486,tsc -m 1M \
$KEYBOARD $QDISPLAY -vga std -rtc base=utc $SERIAL \
$NET $NETDUMP $IMAGE $DISK2 $@