fixed the boot services offset
[efitest2] / Makefile
1 bootx64.efi: efitest.bin hdr.asm
2         nasm -o $@ -f bin hdr.asm
3
4 efitest.bin: efitest.asm
5         nasm -o $@ -f bin $<
6
7 part.img: bootx64.efi
8         dd if=/dev/zero of=$@ bs=1024 count=2080
9         mkfs -t vfat $@
10         mmd -i $@ ::/EFI
11         mmd -i $@ ::/EFI/BOOT
12         mcopy -i $@ $< ::/EFI/BOOT
13
14 disk.img: part.img
15         dd if=/dev/zero of=$@ bs=1024 count=2048
16         echo start=2048 type=ef | sfdisk $@
17         dd if=$< of=$@ bs=512 seek=2048 conv=notrunc
18
19 .PHONY: clean
20 clean:
21         rm -f bootx64.efi efitest.bin
22
23 .PHONY: run
24 run: disk.img
25         qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -hda $<
26
27 .PHONY: debug
28 debug: disk.img
29         qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -S -s -hda $<
30
31
32 disasm: bootx64.efi
33         ndisasm -b 64 -o 0x100000 -e 4096 $< >$@