forked from PinkQween/ViOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·48 lines (41 loc) · 1.04 KB
/
run
File metadata and controls
executable file
·48 lines (41 loc) · 1.04 KB
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
#!/bin/bash
# Default options
AUDIO=true
DEBUG=false
SERIAL=true
# Parse arguments
for arg in "$@"; do
case $arg in
-a|--no-audio)
AUDIO=false
;;
-d|--debug)
DEBUG=true
;;
-s|--no-serial)
SERIAL=false
;;
*)
echo "Unknown option: $arg"
exit 1
;;
esac
done
# Base QEMU command
QEMU_CMD="qemu-system-i386 -m 512M -drive file=bin/os.bin,if=ide,index=0,media=disk,format=raw"
# Serial option
if [ "$SERIAL" = true ]; then
QEMU_CMD="$QEMU_CMD -serial stdio"
fi
# Audio option
if [ "$AUDIO" = true ]; then
# Use working audio configuration with proper format settings
QEMU_CMD="$QEMU_CMD -audiodev coreaudio,id=audio0,out.frequency=44100,out.channels=2,out.format=s16 -machine pcspk-audiodev=audio0"
fi
# Debug option
if [ "$DEBUG" = true ]; then
QEMU_CMD="$QEMU_CMD -s -S"
echo "Run this in another terminal: gdb bin/kernel.elf -ex 'target remote localhost:1234'"
fi
# Run QEMU
eval "$QEMU_CMD"