diff --git a/.travis.yml b/.travis.yml index 974336b..2b6ab0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,15 @@ addons: - virtualbox - bochs - sikuli-ide + # Missing dependencies for sikuli-ide + - libantlr3-runtime-java + - libcommons-cli-java + - libjson-simple-java install: - - true # Nothing to do for now. + # The sikuli-ide packaged with ubuntu 16.04 does not seem to work correctly: missing dependencies, some dependencies are too recent, … + - wget https://launchpadlibrarian.net/359997648/sikulixsetup-1.1.2.jar -O ~/sikulix/sikulixsetup-1.1.2.jar + - (cd ~/sikulix && java -jar sikulixsetup-1.1.2.jar options 1 1.1) env: - MODE=qemu-system-i386 @@ -20,4 +26,5 @@ env: - MODE=bochs script: - - ./test/${MODE}.sh \ No newline at end of file + - (cd example-os && make) + - xvfb-run ./test/${MODE}.sh \ No newline at end of file diff --git a/example-os/.gitignore b/example-os/.gitignore new file mode 100644 index 0000000..809de46 --- /dev/null +++ b/example-os/.gitignore @@ -0,0 +1 @@ +/os.sh \ No newline at end of file diff --git a/example-os/Makefile b/example-os/Makefile new file mode 100644 index 0000000..8f72b1c --- /dev/null +++ b/example-os/Makefile @@ -0,0 +1,5 @@ +all: os.sh + +os.sh: os.asm Makefile + nasm -o $@ $< + chmod a+x $@ diff --git a/example-os/os.asm b/example-os/os.asm new file mode 100644 index 0000000..520ed2a --- /dev/null +++ b/example-os/os.asm @@ -0,0 +1,45 @@ +[BITS 16] +[ORG 0x7c00] + +;; Switch to 320x200x256 VGA mode +mov ax, 0x0013 +int 10h + +;; Framebuffer address is 0xa000, store it into the fs register (the segment base, in multiples of 16) +push 0xa000 +pop fs + +;; Set pixel value (0, then increase at each step below) +xor bl, bl + +;; set register di to 0 +xor di,di + +;; Store pixels, display something flashy. +loop: + mov byte [fs:di], bl + inc bl + inc di + cmp bl, 255 + je endline + jmp loop + +endline: + add di, 65 + xor bl, bl + mov ax, di + cmp ax, (320*200) + je end + jmp loop + +;; Infinite loop +end: + jmp end + +;; Fill the remaining bytes with 0 and end with 55 AA +times 512-2-($-$$) db 0 +db 0x55 +db 0xaa + +;; Fill up to 1.44M with 0 +times (1440*1024)-($-$$) db 0 diff --git a/test/check-gradient.sikuli/1529963334209.png b/test/check-gradient.sikuli/1529963334209.png new file mode 100644 index 0000000..a1abbef Binary files /dev/null and b/test/check-gradient.sikuli/1529963334209.png differ diff --git a/test/check-gradient.sikuli/check-gradient.html b/test/check-gradient.sikuli/check-gradient.html new file mode 100644 index 0000000..71604ec --- /dev/null +++ b/test/check-gradient.sikuli/check-gradient.html @@ -0,0 +1,76 @@ + + + + + + +
+

check-gradient.sikuli

(Download this script) +
+
+wait()
+
+ + diff --git a/test/check-gradient.sikuli/check-gradient.py b/test/check-gradient.sikuli/check-gradient.py new file mode 100644 index 0000000..846f531 --- /dev/null +++ b/test/check-gradient.sikuli/check-gradient.py @@ -0,0 +1 @@ +wait("1529963334209.png") diff --git a/test/qemu-system-i386.sh b/test/qemu-system-i386.sh index 2b61ddb..23f94ac 100755 --- a/test/qemu-system-i386.sh +++ b/test/qemu-system-i386.sh @@ -1,4 +1,9 @@ #!/bin/sh set -e -qemu-system-i386 --help \ No newline at end of file +os_file="example-os/os.sh" + +qemu-system-i386 -drive format=raw,file=${os_file},index=0,if=floppy & +pid=$! +~/sikulix/runsikulix -r test/check-gradient.sikuli +kill $pid \ No newline at end of file