commit 741a36ea674981c82092bbf3b670f66ce4d360f7
parent 5b3c3bbe48fe2f95f0098f7d36cc1e96857f3f4c
Author: Georges Dupéron <georges.duperon@gmail.com>
Date: Mon, 25 Jun 2018 23:50:24 +0200
Added example os for i386, quick test with Sikuli
Diffstat:
8 files changed, 146 insertions(+), 5 deletions(-)
diff --git 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
@@ -0,0 +1 @@
+/os.sh
+\ No newline at end of file
diff --git a/example-os/Makefile 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
@@ -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
Binary files differ.
diff --git a/test/check-gradient.sikuli/check-gradient.html b/test/check-gradient.sikuli/check-gradient.html
@@ -0,0 +1,76 @@
+
+<html>
+ <head>
+ <style type="text/css">
+ .sikuli-code {
+ font-size: 20px;
+ font-family: "Osaka-mono", Monospace;
+ line-height: 1.5em;
+ display:table-cell;
+ white-space: pre-wrap; /* css-3 */
+ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
+ width: 99%; /* remove horizontal scroll-bar when viewing in IE7 */
+ }
+ .sikuli-code img {
+ vertical-align: middle;
+ margin: 2px;
+ border: 1px solid #ccc;
+ padding: 2px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-box-shadow: 1px 1px 1px gray;
+ -webkit-box-shadow: 1px 1px 2px gray;
+ }
+ .kw {
+ color: blue;
+ }
+ .skw {
+ color: rgb(63, 127, 127);
+ }
+
+ .str {
+ color: rgb(128, 0, 0);
+ }
+
+ .dig {
+ color: rgb(128, 64, 0);
+ }
+
+ .cmt {
+ color: rgb(200, 0, 200);
+ }
+
+ h2 {
+ display: inline;
+ font-weight: normal;
+ }
+
+ .info {
+ border-bottom: 1px solid #ddd;
+ padding-bottom: 5px;
+ margin-bottom: 20px;
+ display: none;
+ }
+
+ a {
+ color: #9D2900;
+ }
+
+ body {
+ font-family: "Trebuchet MS", Arial, Sans-Serif;
+ }
+
+ </style>
+ </head>
+<body>
+<div class="info">
+<h2>check-gradient.sikuli</h2> <a href="check-gradient.zip">(Download this script)</a>
+</div>
+<pre class="sikuli-code">
+<span class="skw">wait</span>(<img src="1529963334209.png" />)
+</pre>
+</body>
+</html>
diff --git a/test/check-gradient.sikuli/check-gradient.py 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
@@ -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