Update
This commit is contained in:
parent
01c7f7175e
commit
4bb3bcc92f
1 changed files with 24 additions and 22 deletions
46
GNUmakefile
46
GNUmakefile
|
@ -1,27 +1,29 @@
|
||||||
# Nuke built-in rules and variables.
|
# Nuke built-in rules and variables.
|
||||||
override MAKEFLAGS += -rR
|
override MAKEFLAGS += -rR
|
||||||
|
|
||||||
|
override IMAGE_NAME := barebones
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: barebones.iso
|
all: $(IMAGE_NAME).iso
|
||||||
|
|
||||||
.PHONY: all-hdd
|
.PHONY: all-hdd
|
||||||
all-hdd: barebones.hdd
|
all-hdd: $(IMAGE_NAME).hdd
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run: barebones.iso
|
run: $(IMAGE_NAME).iso
|
||||||
qemu-system-x86_64 -M q35 -m 2G -cdrom barebones.iso -boot d
|
qemu-system-x86_64 -M q35 -m 2G -cdrom $(IMAGE_NAME).iso -boot d
|
||||||
|
|
||||||
.PHONY: run-uefi
|
.PHONY: run-uefi
|
||||||
run-uefi: ovmf-x64 barebones.iso
|
run-uefi: ovmf-x64 $(IMAGE_NAME).iso
|
||||||
qemu-system-x86_64 -M q35 -m 2G -bios ovmf-x64/OVMF.fd -cdrom barebones.iso -boot d
|
qemu-system-x86_64 -M q35 -m 2G -bios ovmf-x64/OVMF.fd -cdrom $(IMAGE_NAME).iso -boot d
|
||||||
|
|
||||||
.PHONY: run-hdd
|
.PHONY: run-hdd
|
||||||
run-hdd: barebones.hdd
|
run-hdd: $(IMAGE_NAME).hdd
|
||||||
qemu-system-x86_64 -M q35 -m 2G -hda barebones.hdd
|
qemu-system-x86_64 -M q35 -m 2G -hda $(IMAGE_NAME).hdd
|
||||||
|
|
||||||
.PHONY: run-hdd-uefi
|
.PHONY: run-hdd-uefi
|
||||||
run-hdd-uefi: ovmf-x64 barebones.hdd
|
run-hdd-uefi: ovmf-x64 $(IMAGE_NAME).hdd
|
||||||
qemu-system-x86_64 -M q35 -m 2G -bios ovmf-x64/OVMF.fd -hda barebones.hdd
|
qemu-system-x86_64 -M q35 -m 2G -bios ovmf-x64/OVMF.fd -hda $(IMAGE_NAME).hdd
|
||||||
|
|
||||||
ovmf-x64:
|
ovmf-x64:
|
||||||
mkdir -p ovmf-x64
|
mkdir -p ovmf-x64
|
||||||
|
@ -35,7 +37,7 @@ limine:
|
||||||
kernel:
|
kernel:
|
||||||
$(MAKE) -C kernel
|
$(MAKE) -C kernel
|
||||||
|
|
||||||
barebones.iso: limine kernel
|
$(IMAGE_NAME).iso: limine kernel
|
||||||
rm -rf iso_root
|
rm -rf iso_root
|
||||||
mkdir -p iso_root
|
mkdir -p iso_root
|
||||||
cp kernel/kernel.elf \
|
cp kernel/kernel.elf \
|
||||||
|
@ -44,18 +46,18 @@ barebones.iso: limine kernel
|
||||||
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||||
--efi-boot limine-cd-efi.bin \
|
--efi-boot limine-cd-efi.bin \
|
||||||
-efi-boot-part --efi-boot-image --protective-msdos-label \
|
-efi-boot-part --efi-boot-image --protective-msdos-label \
|
||||||
iso_root -o barebones.iso
|
iso_root -o $(IMAGE_NAME).iso
|
||||||
limine/limine-deploy barebones.iso
|
limine/limine-deploy $(IMAGE_NAME).iso
|
||||||
rm -rf iso_root
|
rm -rf iso_root
|
||||||
|
|
||||||
barebones.hdd: limine kernel
|
$(IMAGE_NAME).hdd: limine kernel
|
||||||
rm -f barebones.hdd
|
rm -f $(IMAGE_NAME).hdd
|
||||||
dd if=/dev/zero bs=1M count=0 seek=64 of=barebones.hdd
|
dd if=/dev/zero bs=1M count=0 seek=64 of=$(IMAGE_NAME).hdd
|
||||||
parted -s barebones.hdd mklabel gpt
|
parted -s $(IMAGE_NAME).hdd mklabel gpt
|
||||||
parted -s barebones.hdd mkpart ESP fat32 2048s 100%
|
parted -s $(IMAGE_NAME).hdd mkpart ESP fat32 2048s 100%
|
||||||
parted -s barebones.hdd set 1 esp on
|
parted -s $(IMAGE_NAME).hdd set 1 esp on
|
||||||
limine/limine-deploy barebones.hdd
|
limine/limine-deploy $(IMAGE_NAME).hdd
|
||||||
sudo losetup -Pf --show barebones.hdd >loopback_dev
|
sudo losetup -Pf --show $(IMAGE_NAME).hdd >loopback_dev
|
||||||
sudo mkfs.fat -F 32 `cat loopback_dev`p1
|
sudo mkfs.fat -F 32 `cat loopback_dev`p1
|
||||||
mkdir -p img_mount
|
mkdir -p img_mount
|
||||||
sudo mount `cat loopback_dev`p1 img_mount
|
sudo mount `cat loopback_dev`p1 img_mount
|
||||||
|
@ -69,7 +71,7 @@ barebones.hdd: limine kernel
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf iso_root barebones.iso barebones.hdd
|
rm -rf iso_root $(IMAGE_NAME).iso $(IMAGE_NAME).hdd
|
||||||
$(MAKE) -C kernel clean
|
$(MAKE) -C kernel clean
|
||||||
|
|
||||||
.PHONY: distclean
|
.PHONY: distclean
|
||||||
|
|
Loading…
Reference in a new issue