From 6e162fc36500b19380a346076a3471f5dfd87007 Mon Sep 17 00:00:00 2001 From: xamidev <121681048+xamidev@users.noreply.github.com> Date: Thu, 15 Aug 2024 15:27:53 +0200 Subject: [PATCH] Add toolchain rule --- README.md | 2 +- makefile | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0178207..c9db300 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Then follow [these](https://bbs.archlinux.org/viewtopic.php?id=178479) instructi ### Cross Compiler -A cross-compiler is needed to build the system. More info on why [here](https://wiki.osdev.org/GCC_Cross-Compiler). In order for the build to work, you will need to download the i386-elf toolchain from [here](https://newos.org/toolchains/i386-elf-7.5.0-Linux-x86_64.tar.xz) and extract the root folder into the BlankOS root folder, or build it by youself if you're not lazy like me. +A cross-compiler is needed to build the system. More info on why [here](https://wiki.osdev.org/GCC_Cross-Compiler). To get the proper toolchain, do `make toolchain`, or build it by youself if you're not lazy like me. Then you can build the kernel without problems. Why didn't I use one sooner? Can't tell. Maybe I was too lazy. This is actually problematic because I wasn't able to use some libraries and I had to put in a bunch of weird compilation flags. It's better like this. diff --git a/makefile b/makefile index b619ecb..0a10ded 100644 --- a/makefile +++ b/makefile @@ -31,6 +31,10 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(OBJ_DIR)/%.o: $(SRC_DIR)/%.s $(AS) $(ASFLAGS) $< -o $@ +toolchain: + wget https://newos.org/toolchains/i386-elf-7.5.0-Linux-x86_64.tar.xz + tar xf i386-elf-7.5.0-Linux-x86_64.tar.xz + os.iso: kernel.elf cp kernel.elf iso/boot/kernel.elf genisoimage -R \