2023-06-02 18:40:24 +03:00
|
|
|
#!/bin/bash
|
2023-01-10 11:28:23 +02:00
|
|
|
set -e
|
|
|
|
|
2023-01-11 20:18:08 +02:00
|
|
|
BOCHS_CONFIG_FILE=bochsrc
|
|
|
|
COM1_TERMINAL=kitty
|
|
|
|
COM1_DEVICE_FILE=com1-term-device
|
|
|
|
|
|
|
|
$COM1_TERMINAL sh -c "tty > $COM1_DEVICE_FILE && sleep infinity" &
|
|
|
|
COM1_TERM_PID=$(echo $!)
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
COM1_DEVICE=$(cat $COM1_DEVICE_FILE)
|
|
|
|
rm $COM1_DEVICE_FILE
|
|
|
|
|
|
|
|
cat > $BOCHS_CONFIG_FILE << EOF
|
2023-04-02 04:07:27 +03:00
|
|
|
ata0-master: type=disk, path=$DISK_IMAGE_PATH, status=inserted
|
2023-02-04 23:46:11 +02:00
|
|
|
boot: disk
|
2023-01-10 11:28:23 +02:00
|
|
|
clock: sync=realtime, time0=local
|
|
|
|
display_library: x, options="gui_debug"
|
|
|
|
magic_break: enabled=1
|
|
|
|
megs: 128
|
2023-01-11 20:18:08 +02:00
|
|
|
com1: enabled=1, mode=term, dev=$COM1_DEVICE
|
2023-01-10 11:28:23 +02:00
|
|
|
EOF
|
|
|
|
|
2023-01-11 20:18:08 +02:00
|
|
|
bochs -qf $BOCHS_CONFIG_FILE
|
|
|
|
kill $COM1_TERM_PID
|
|
|
|
rm $BOCHS_CONFIG_FILE
|