revitalized

This commit is contained in:
mtgmonkey 2025-05-13 00:10:37 -04:00
parent 2190a5c04d
commit a46f795b5a
12 changed files with 52 additions and 86 deletions

View file

@ -1,24 +1,34 @@
all:
mkdir temp
nasm -f elf64 src/multiboot_header.asm -o temp/multiboot_header.asm.o
nasm -f elf64 src/long_mode_init.asm -o temp/long_mode_init.asm.o
nasm -f elf64 src/boot.asm -o temp/boot.asm.o
cargo update --verbose
all: setup asm rust link image clean
setup:
mkdir temp
asm:
nasm -f elf64 src/asm/multiboot_header.asm -o temp/multiboot_header.asm.o
nasm -f elf64 src/asm/long_mode_init.asm -o temp/long_mode_init.asm.o
nasm -f elf64 src/asm/boot.asm -o temp/boot.asm.o
rust:
cargo build
ld -n -o temp/kernel.bin --gc-sections -T linker.ld temp/multiboot_header.asm.o temp/long_mode_init.asm.o temp/boot.asm.o target/x86_64-rustboot/debug/librustboot.a
link:
ld -n -o temp/kernel.bin --gc-sections -T link-cfg/linker.ld temp/multiboot_header.asm.o temp/long_mode_init.asm.o temp/boot.asm.o target/x86_64-rustboot/debug/librustboot.a
image:
mkdir isofiles
mkdir isofiles/boot
mkdir isofiles/boot/grub
cp temp/kernel.bin isofiles/boot/kernel.bin
cp src/grub.cfg isofiles/boot/grub/grub.cfg
rm -rf temp
cp link-cfg/grub.cfg isofiles/boot/grub/grub.cfg
grub-mkrescue -o build/os.iso isofiles 2> /dev/null
rm -rf isofiles
clean:
rm -rf temp
rm -rf isofiles
rm -rf target
scrub: clean
cargo clean
cargo update --verbose
run:
qemu-system-x86_64 -cdrom build/os.iso