Change OS filename: os.sh -> os.bat

This commit is contained in:
Georges Dupéron 2018-07-03 17:49:22 +02:00
parent 64971229f3
commit ca7882fd2d
5 changed files with 33 additions and 24 deletions

View File

@ -1,5 +1,5 @@
/os.sh /os.bat
/os.ndisasm.disasm /os.ndisasm.disasm
/os.reasm.asm /os.reasm.asm
/os.reasm /os.reasm
/os.reasm.disasm /os.reasm.disasm

View File

@ -1,47 +1,56 @@
os_filename = os.bat
.PHONY: all .PHONY: all
all: os.sh os.ndisasm.disasm os.reasm.asm os.reasm all: $(os_filename) os.ndisasm.disasm os.reasm.asm os.reasm .gitignore
../deploy-screenshots: ../deploy-screenshots:
mkdir $@ mkdir $@
os.sh: os.asm ../deploy-screenshots Makefile $(os_filename): os.asm ../deploy-screenshots Makefile
nasm -o $@ $< nasm -o $@ $<
chmod a+x $@ chmod a+x $@
os.ndisasm.disasm: os.sh Makefile os.ndisasm.disasm: $(os_filename) Makefile
../utils/compact-ndisasm.sh $< $@ ../utils/compact-ndisasm.sh $< $@
os.reasm.asm: os.ndisasm.disasm Makefile os.reasm.asm: os.ndisasm.disasm Makefile
sed -r -e 's/^[^ ]+ +[^ ]+ +//' $< > $@ sed -r -e 's/^[^ ]+ +[^ ]+ +//' $< > $@
os.reasm: os.reasm.asm os.sh Makefile os.reasm: os.reasm.asm $(os_filename) Makefile
nasm $< -o $@ nasm $< -o $@
@echo "diff $@ os.sh" @echo "diff $@ $(os_filename)"
@diff $@ os.sh \ @diff $@ $(os_filename) \
&& echo "Re-assembled file is identical to os.sh" \ && echo "Re-assembled file is identical to $(os_filename)" \
|| (../utils/compact-ndisasm.sh $@ os.reasm.disasm; \ || (../utils/compact-ndisasm.sh $@ os.reasm.disasm; \
echo "Re-assembled file is different from os.sh. Use meld os.ndisasm.disasm os.reasm.disasm to see differences."; \ echo "Re-assembled file is different from $(os_filename). Use meld os.ndisasm.disasm os.reasm.disasm to see differences."; \
exit 1) exit 1)
.PHONY: clean Makefile .PHONY: clean Makefile
clean: clean:
rm -f os.sh os.ndisasm.disasm os.reasm.asm os.reasm rm -f $(os_filename) os.ndisasm.disasm os.reasm.asm os.reasm
.gitignore: Makefile
echo /$(os_filename) > $@
echo /os.ndisasm.disasm >> $@
echo /os.reasm.asm >> $@
echo /os.reasm >> $@
echo /os.reasm.disasm >> $@
.PHONY: test .PHONY: test
test: test-qemu-system-i386 test-qemu-system-arm test-virtualbox test-bochs Makefile test: test-qemu-system-i386 test-qemu-system-arm test-virtualbox test-bochs Makefile
.PHONY: test-qemu-system-i386 .PHONY: test-qemu-system-i386
test-qemu-system-i386: os.sh ../deploy-screenshots Makefile test-qemu-system-i386: $(os_filename) ../deploy-screenshots Makefile
(cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/qemu-system-i386.sh) (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/qemu-system-i386.sh)
.PHONY: test-qemu-system-arm .PHONY: test-qemu-system-arm
test-qemu-system-arm: os.sh ../deploy-screenshots Makefile test-qemu-system-arm: $(os_filename) ../deploy-screenshots Makefile
(cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/qemu-system-arm.sh) (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/qemu-system-arm.sh)
.PHONY: test-virtualbox .PHONY: test-virtualbox
test-virtualbox: os.sh ../deploy-screenshots Makefile test-virtualbox: $(os_filename) ../deploy-screenshots Makefile
(cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/virtualbox.sh) (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/virtualbox.sh)
.PHONY: test-bochs .PHONY: test-bochs
test-bochs: os.sh ../deploy-screenshots Makefile test-bochs: $(os_filename) ../deploy-screenshots Makefile
(cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/bochs.sh) (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/bochs.sh)

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
set -e set -e
os_file="example-os/os.sh" os_filename="example-os/os.bat"
bochsrc="$(mktemp)" bochsrc="$(mktemp)"
cat > "$bochsrc" <<EOF cat > "$bochsrc" <<EOF
floppya: 1_44=${os_file}, status=inserted floppya: 1_44=${os_filename}, status=inserted
boot: floppy boot: floppy
display_library: sdl display_library: sdl
EOF EOF
@ -23,4 +23,4 @@ kill $pid
rm "${bochsrc}" "${bochscontinue}" rm "${bochsrc}" "${bochscontinue}"
exit $exitcode exit $exitcode

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
set -e set -e
os_file="example-os/os.sh" os_filename="example-os/os.bat"
qemu-system-i386 -drive format=raw,file=${os_file},index=0,if=floppy & qemu-system-i386 -drive format=raw,file=${os_filename},index=0,if=floppy &
pid=$! pid=$!
runsikulix -r test/check-gradient.sikuli && exitcode=$? || exitcode=$? runsikulix -r test/check-gradient.sikuli && exitcode=$? || exitcode=$?
@ -11,4 +11,4 @@ runsikulix -r test/check-gradient.sikuli && exitcode=$? || exitcode=$?
kill $pid kill $pid
exit $exitcode exit $exitcode

View File

@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
set -e set -e
os_file="example-os/os.sh" os_filename="example-os/os.bat"
img_file="$(mktemp --suffix=".img")" img_file="$(mktemp --suffix=".img")"
vbox_dir="$(mktemp -d --suffix="_vbox")" vbox_dir="$(mktemp -d --suffix="_vbox")"
vmname="automatic-os-test-$(date +%s)-$$" vmname="automatic-os-test-$(date +%s)-$$"
ln -sf "$(readlink -f "$os_file")" "$img_file" ln -sf "$(readlink -f "$os_filename")" "$img_file"
VBoxManage createvm --name "$vmname" --register --basefolder "$vbox_dir" VBoxManage createvm --name "$vmname" --register --basefolder "$vbox_dir"
VBoxManage modifyvm "$vmname" --hwvirtex off VBoxManage modifyvm "$vmname" --hwvirtex off
VBoxManage modifyvm "$vmname" --nestedpaging off VBoxManage modifyvm "$vmname" --nestedpaging off
@ -34,4 +34,4 @@ done
rm "$img_file" rm "$img_file"
rm "/tmp/$vbox_dir" -fr rm "/tmp/$vbox_dir" -fr
exit $exitcode exit $exitcode