Skip to content

Commit

Permalink
Add a Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
toku-sa-n committed Nov 27, 2023
1 parent f12c681 commit a3f5240
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.PHONY: test clean

test: build/os.img
qemu-system-x86_64 \
-drive if=pflash,format=raw,readonly=on,file=OVMF_CODE.fd \
-drive if=pflash,format=raw,readonly=on,file=OVMF_VARS.fd \
-device isa-debug-exit,iobase=0xf4,iosize=0x04 \
-serial stdio \
-display none \
-drive format=raw,file=build/os.img; \
if [ $$? -eq 33 ];\
then\
echo "Test passed";\
else\
echo "Test failed";\
exit 1;\
fi

build/os.img: target/x86_64-unknown-uefi/debug/xhci-test.efi build
dd if=/dev/zero of=build/os.img bs=512 count=93750
mformat -i build/os.img -h 200 -t 500 -s 144::
mmd -i build/os.img ::/efi
mmd -i build/os.img ::/efi/boot
mcopy -i build/os.img target/x86_64-unknown-uefi/debug/xhci-test.efi ::/efi/boot/bootx64.efi

target/x86_64-unknown-uefi/debug/xhci-test.efi: src/main.rs
cargo build

build:
mkdir build

clean:
rm -rf build
cargo clean

0 comments on commit a3f5240

Please sign in to comment.