diff --git a/.travis.yml b/.travis.yml index de93d90..2b4080f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,6 +49,14 @@ matrix: apt: packages: - bochs-sdl + - env: MODE=gui-sh + sudo: false + - env: MODE=dosbox + sudo: false + addons: + apt: + packages: + - dosbox - env: MODE=self-test # Ensure that the Makefile works, especially with parallel builds. script: (cd example-os && make -j 10) sudo: true diff --git a/README.md b/README.md index 9d6096e..b477ee4 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,11 @@ Below are screenshots of an example operating system. This example merely displa ## Bochs  + +## DOSBox (.bat) + + + +## Unix graphical environment (.sh) + + diff --git a/example-os/Makefile b/example-os/Makefile index a86d869..15516ab 100644 --- a/example-os/Makefile +++ b/example-os/Makefile @@ -1,5 +1,5 @@ os_filename = os.bat -tests = test/qemu-system-i386 test/qemu-system-arm test/virtualbox test/bochs +tests = test/qemu-system-i386 test/qemu-system-arm test/virtualbox test/bochs test/gui-sh test/dosbox .PHONY: all all: $(os_filename) os.ndisasm.disasm os.reasm.asm os.reasm .gitignore test Makefile diff --git a/example-os/os.asm b/example-os/os.asm index 5c045e2..d02c508 100644 --- a/example-os/os.asm +++ b/example-os/os.asm @@ -50,14 +50,19 @@ db 0xaa ;; end of the bootsector, close the sh here-document skipped via : <<'EOF' db `\n` db `EOF\n` -db `echo Hello world from sh!\n` +db `echo Hello world by the OS, from sh!\n` db `while sleep 10; do :; done\n` db `exit\n` +;; for good measure: go into an infinite loop if the exit did not happen. +db `while :; do sleep 1; done\n` ;; end of the SH section, everything until this point is skipped by MS-DOS batch due to the GOTO' db `:msdos\n` db `@cls\n` -db `@echo "hello world" from MS-DOS\n` +db `@echo Hello world by the OS, from MS-DOS!\n` +db `command.com\n` +db `exit\n` +;; for good measure: go into an infinite loop if the exit did not happen. db `:loop\n` db `GOTO loop\n` diff --git a/test/check-dosbox.sikuli/1530637967171.png b/test/check-dosbox.sikuli/1530637967171.png new file mode 100644 index 0000000..4656c62 Binary files /dev/null and b/test/check-dosbox.sikuli/1530637967171.png differ diff --git a/test/check-dosbox.sikuli/check-dosbox.html b/test/check-dosbox.sikuli/check-dosbox.html new file mode 100644 index 0000000..6d5d929 --- /dev/null +++ b/test/check-dosbox.sikuli/check-dosbox.html @@ -0,0 +1,76 @@ + + +
+ + + ++wait(+ + diff --git a/test/check-dosbox.sikuli/check-dosbox.py b/test/check-dosbox.sikuli/check-dosbox.py new file mode 100644 index 0000000..6029d00 --- /dev/null +++ b/test/check-dosbox.sikuli/check-dosbox.py @@ -0,0 +1 @@ +wait("1530637967171.png", 10) diff --git a/test/check-gui-sh.sikuli/1530638293676.png b/test/check-gui-sh.sikuli/1530638293676.png new file mode 100644 index 0000000..86d20e6 Binary files /dev/null and b/test/check-gui-sh.sikuli/1530638293676.png differ diff --git a/test/check-gui-sh.sikuli/check-gui-sh.html b/test/check-gui-sh.sikuli/check-gui-sh.html new file mode 100644 index 0000000..ffebc46 --- /dev/null +++ b/test/check-gui-sh.sikuli/check-gui-sh.html @@ -0,0 +1,76 @@ + + + + + + +, 10) +
+wait(+ + diff --git a/test/check-gui-sh.sikuli/check-gui-sh.py b/test/check-gui-sh.sikuli/check-gui-sh.py new file mode 100644 index 0000000..2687747 --- /dev/null +++ b/test/check-gui-sh.sikuli/check-gui-sh.py @@ -0,0 +1 @@ +wait("1530638293676.png", 10) diff --git a/test/dosbox.sh b/test/dosbox.sh new file mode 100755 index 0000000..9f5571d --- /dev/null +++ b/test/dosbox.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +if test $# -ne 1 || test "$1" = '-h' -o "$1" = '--help'; then + echo "Usage: $0 operating_system_file" +fi +os_filename="$1" + +dosbox ${os_filename} & +pid=$! +runsikulix -r test/check-dosbox.sikuli && exitcode=$? || exitcode=$? + +./utils/take-screenshots.sh "./deploy-screenshots/$(basename "$0" .sh).png" + +kill $pid + +exit $exitcode diff --git a/test/gui-sh.sh b/test/gui-sh.sh new file mode 100755 index 0000000..a928da0 --- /dev/null +++ b/test/gui-sh.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +if test $# -ne 1 || test "$1" = '-h' -o "$1" = '--help'; then + echo "Usage: $0 operating_system_file" +fi +os_filename="$1" + +xterm -e ${os_filename} & +pid=$! +runsikulix -r test/check-gui-sh.sikuli && exitcode=$? || exitcode=$? + +./utils/take-screenshots.sh "./deploy-screenshots/$(basename "$0" .sh).png" + +kill $pid + +exit $exitcode, 10) +