Added example os for i386, quick test with Sikuli

This commit is contained in:
Georges Dupéron 2018-06-25 23:50:24 +02:00
parent 5b3c3bbe48
commit 741a36ea67
8 changed files with 143 additions and 3 deletions

View File

@ -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
- (cd example-os && make)
- xvfb-run ./test/${MODE}.sh

1
example-os/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/os.sh

5
example-os/Makefile Normal file
View File

@ -0,0 +1,5 @@
all: os.sh
os.sh: os.asm Makefile
nasm -o $@ $<
chmod a+x $@

45
example-os/os.asm Normal file
View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -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>

View File

@ -0,0 +1 @@
wait("1529963334209.png")

View File

@ -1,4 +1,9 @@
#!/bin/sh
set -e
qemu-system-i386 --help
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