Skip to content

Instantly share code, notes, and snippets.

@ljmccarthy
Last active August 14, 2019 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmccarthy/b238e108456eeecc6f53537bcee5da30 to your computer and use it in GitHub Desktop.
Save ljmccarthy/b238e108456eeecc6f53537bcee5da30 to your computer and use it in GitHub Desktop.
#!/bin/sh
HDA=disk.img
run_qemu() {
qemu-system-i386 \
-cpu pentium \
-m size=64M \
-vga cirrus \
-soundhw sb16,adlib \
-netdev user,id=network0 \
-device rtl8139,netdev=network0 \
-drive "file=$HDA,format=raw,if=ide" \
"$@"
}
case $1 in
init)
qemu-img create -f raw "$HDA" 100M
;;
install)
# Change floppy with command:
# (qemu) change floppy0 disk.img
run_qemu -drive "file=$2,format=raw,if=floppy" -boot "order=a" -monitor stdio
;;
run)
run_qemu
;;
monitor)
run_qemu -monitor stdio
;;
*)
echo "usage: $0 [init | install FDIMG | run | monitor]"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment