diff --git a/Makefile b/Makefile index 0883f45..7107ab6 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ OBJ_EXT ?= .o OUT_EXT ?= .img QEMU ?= qemu-system-i386 RUN ?= bios_hello_world +RUN_ARGS ?= -soundhw pcspk TMP_EXT ?= .tmp OUTS := $(sort $(foreach IN_EXT,$(NASM_EXT) $(GAS_EXT),$(patsubst %$(IN_EXT),%$(OUT_EXT),$(wildcard *$(IN_EXT))))) @@ -40,7 +41,7 @@ clean: rm -fr '$(DOC_OUT)' *$(OBJ_EXT) *$(OUT_EXT) *$(TMP_EXT) run: $(RUN_FILE) - $(QEMU) -drive 'file=$(RUN_FILE),format=raw' -smp 2 -soundhw pcspk + $(QEMU) -drive 'file=$(RUN_FILE),format=raw' -smp 2 $(RUN_ARGS) debug: $(RUN_FILE) $(QEMU) -hda '$(RUN_FILE)' -S -s & diff --git a/README.adoc b/README.adoc index 612d130..7e29ec3 100644 --- a/README.adoc +++ b/README.adoc @@ -159,7 +159,7 @@ make To overcome the lack of GUI, we can use QEMU's VNC implementation instead of the default SDL, which is visible on the host due to `--net=host`: .... -qemu-system-i386 -hda bios_hello_world.img -vnc :0 +./run bios_hello_world run -vnc :0 .... and then on host: @@ -169,6 +169,10 @@ sudo apt-get install vinagre vinagre localhost:5900 .... +TODO: get sound working from docker: <>: https://stackoverflow.com/questions/41083436/how-to-play-sound-in-a-docker-container + +It should also be possible to run a GUI inside the container, but I haven't tested: https://stackoverflow.com/questions/40658095/how-to-open-ubuntu-gui-inside-a-docker-image/57636624#57636624 + === GDB step debug TODO get it working nicely: diff --git a/run b/run index 7ccc2c0..52d5036 100755 --- a/run +++ b/run @@ -3,5 +3,11 @@ img="${1:-}" if [ -n "$img" ]; then img="RUN=${img%.*}" fi -type="${2:-run}" -make "${type}" $img +shift +if [ $# -ge 1 ]; then + type="$1" + shift +else + type=run +fi +make RUN_ARGS="$*" "${type}" "${img}"