forked from nbs32k/open98
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (36 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ISO_IMAGE = disk.iso
INITRD := vfs.tar.gz
.PHONY: all
all: $(ISO_IMAGE)
.PHONY: run
run: $(ISO_IMAGE)
qemu-system-x86_64 -M q35 -m 2G -cdrom $(ISO_IMAGE)
ntldr:
git clone https://github.com/limine-bootloader/limine.git --branch=v2.0-branch-binary --depth=1
make -C limine
cock:
ntldr/limine-install hdd.vhd --force-mbr
.PHONY: ntoskrnl
ntoskrnl:
$(MAKE) -C ntoskrnl
$(ISO_IMAGE): ntldr ntoskrnl
tar czf $(INITRD) -C vfs/ ./ --format=ustar
rm -rf iso_root
mkdir -p iso_root
cp ntoskrnl/ntoskrnl.elf \
limine.cfg ntldr/limine.sys ntldr/limine-cd.bin ntldr/limine-eltorito-efi.bin iso_root/
xorriso -as mkisofs -b limine-cd.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
--efi-boot limine-eltorito-efi.bin \
-efi-boot-part --efi-boot-image --protective-msdos-label \
iso_root -o $(ISO_IMAGE)
ntldr/limine-install $(ISO_IMAGE)
rm -rf iso_root
$(MAKE) -C ntoskrnl clean
.PHONY: clean
clean:
$(MAKE) -C ntoskrnl clean
.PHONY: distclean
distclean: clean
rm -rf ntldr
$(MAKE) -C ntoskrnl distclean