Write out kernel executable in bin/ directory
This commit is contained in:
parent
bb7be171fd
commit
62be50a063
4 changed files with 8 additions and 8 deletions
|
@ -67,7 +67,7 @@ kernel:
|
||||||
$(IMAGE_NAME).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 -v kernel/kernel.elf \
|
cp -v kernel/bin/kernel \
|
||||||
limine.cfg limine/limine-bios.sys limine/limine-bios-cd.bin limine/limine-uefi-cd.bin iso_root/
|
limine.cfg limine/limine-bios.sys limine/limine-bios-cd.bin limine/limine-uefi-cd.bin iso_root/
|
||||||
mkdir -p iso_root/EFI/BOOT
|
mkdir -p iso_root/EFI/BOOT
|
||||||
cp -v limine/BOOTX64.EFI iso_root/EFI/BOOT/
|
cp -v limine/BOOTX64.EFI iso_root/EFI/BOOT/
|
||||||
|
@ -87,7 +87,7 @@ $(IMAGE_NAME).hdd: limine kernel
|
||||||
./limine/limine bios-install $(IMAGE_NAME).hdd
|
./limine/limine bios-install $(IMAGE_NAME).hdd
|
||||||
mformat -i $(IMAGE_NAME).hdd@@1M
|
mformat -i $(IMAGE_NAME).hdd@@1M
|
||||||
mmd -i $(IMAGE_NAME).hdd@@1M ::/EFI ::/EFI/BOOT
|
mmd -i $(IMAGE_NAME).hdd@@1M ::/EFI ::/EFI/BOOT
|
||||||
mcopy -i $(IMAGE_NAME).hdd@@1M kernel/kernel.elf limine.cfg limine/limine-bios.sys ::/
|
mcopy -i $(IMAGE_NAME).hdd@@1M kernel/bin/kernel limine.cfg limine/limine-bios.sys ::/
|
||||||
mcopy -i $(IMAGE_NAME).hdd@@1M limine/BOOTX64.EFI ::/EFI/BOOT
|
mcopy -i $(IMAGE_NAME).hdd@@1M limine/BOOTX64.EFI ::/EFI/BOOT
|
||||||
mcopy -i $(IMAGE_NAME).hdd@@1M limine/BOOTIA32.EFI ::/EFI/BOOT
|
mcopy -i $(IMAGE_NAME).hdd@@1M limine/BOOTIA32.EFI ::/EFI/BOOT
|
||||||
|
|
||||||
|
|
3
kernel/.gitignore
vendored
3
kernel/.gitignore
vendored
|
@ -1,4 +1,3 @@
|
||||||
/src/limine.h
|
/src/limine.h
|
||||||
|
/bin
|
||||||
/obj
|
/obj
|
||||||
*.elf
|
|
||||||
*.o
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ override MAKEFLAGS += -rR
|
||||||
|
|
||||||
# This is the name that our final kernel executable will have.
|
# This is the name that our final kernel executable will have.
|
||||||
# Change as needed.
|
# Change as needed.
|
||||||
override KERNEL := kernel.elf
|
override KERNEL := bin/kernel
|
||||||
|
|
||||||
# Convenience macro to reliably declare user overridable variables.
|
# Convenience macro to reliably declare user overridable variables.
|
||||||
define DEFAULT_VAR =
|
define DEFAULT_VAR =
|
||||||
|
@ -99,6 +99,7 @@ src/limine.h:
|
||||||
|
|
||||||
# Link rules for the final kernel executable.
|
# Link rules for the final kernel executable.
|
||||||
$(KERNEL): GNUmakefile linker.ld $(OBJ)
|
$(KERNEL): GNUmakefile linker.ld $(OBJ)
|
||||||
|
mkdir -p "$$(dirname $@)"
|
||||||
$(LD) $(OBJ) $(LDFLAGS) -o $@
|
$(LD) $(OBJ) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
# Include header dependencies.
|
# Include header dependencies.
|
||||||
|
@ -122,7 +123,7 @@ obj/%.asm.o: src/%.asm GNUmakefile
|
||||||
# Remove object files and the final executable.
|
# Remove object files and the final executable.
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(KERNEL) obj
|
rm -rf bin obj
|
||||||
|
|
||||||
.PHONY: distclean
|
.PHONY: distclean
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
|
|
@ -7,7 +7,7 @@ TIMEOUT=3
|
||||||
PROTOCOL=limine
|
PROTOCOL=limine
|
||||||
|
|
||||||
# Path to the kernel to boot. boot:/// represents the partition on which limine.cfg is located.
|
# Path to the kernel to boot. boot:/// represents the partition on which limine.cfg is located.
|
||||||
KERNEL_PATH=boot:///kernel.elf
|
KERNEL_PATH=boot:///kernel
|
||||||
|
|
||||||
# Same thing, but without KASLR.
|
# Same thing, but without KASLR.
|
||||||
:Limine Barebones (KASLR off)
|
:Limine Barebones (KASLR off)
|
||||||
|
@ -16,4 +16,4 @@ TIMEOUT=3
|
||||||
# Disable KASLR (it is enabled by default for relocatable kernels)
|
# Disable KASLR (it is enabled by default for relocatable kernels)
|
||||||
KASLR=no
|
KASLR=no
|
||||||
|
|
||||||
KERNEL_PATH=boot:///kernel.elf
|
KERNEL_PATH=boot:///kernel
|
||||||
|
|
Loading…
Add table
Reference in a new issue