docker: make awesome

This commit is contained in:
Ciro Santilli
2019-08-24 00:00:06 +00:00
parent 06f5a8a683
commit cb6f8cdf1c
3 changed files with 15 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ OBJ_EXT ?= .o
OUT_EXT ?= .img OUT_EXT ?= .img
QEMU ?= qemu-system-i386 QEMU ?= qemu-system-i386
RUN ?= bios_hello_world RUN ?= bios_hello_world
RUN_ARGS ?= -soundhw pcspk
TMP_EXT ?= .tmp TMP_EXT ?= .tmp
OUTS := $(sort $(foreach IN_EXT,$(NASM_EXT) $(GAS_EXT),$(patsubst %$(IN_EXT),%$(OUT_EXT),$(wildcard *$(IN_EXT))))) 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) rm -fr '$(DOC_OUT)' *$(OBJ_EXT) *$(OUT_EXT) *$(TMP_EXT)
run: $(RUN_FILE) 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) debug: $(RUN_FILE)
$(QEMU) -hda '$(RUN_FILE)' -S -s & $(QEMU) -hda '$(RUN_FILE)' -S -s &

View File

@@ -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`: 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: and then on host:
@@ -169,6 +169,10 @@ sudo apt-get install vinagre
vinagre localhost:5900 vinagre localhost:5900
.... ....
TODO: get sound working from docker: <<pc-speaker>>: 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 === GDB step debug
TODO get it working nicely: TODO get it working nicely:

10
run
View File

@@ -3,5 +3,11 @@ img="${1:-}"
if [ -n "$img" ]; then if [ -n "$img" ]; then
img="RUN=${img%.*}" img="RUN=${img%.*}"
fi fi
type="${2:-run}" shift
make "${type}" $img if [ $# -ge 1 ]; then
type="$1"
shift
else
type=run
fi
make RUN_ARGS="$*" "${type}" "${img}"