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