From 87b587f570654134b098ddd633adb25c46c7340e Mon Sep 17 00:00:00 2001 From: Max Tyson <98maxt98@gmail.com> Date: Sat, 16 Dec 2023 18:19:10 +1300 Subject: [PATCH] Fix Caching --- .github/workflows/max-os.yml | 2 +- Makefile | 8 ++++---- README.md | 2 +- kernel/src/kernel.cpp | 2 +- toolchain/increment_version.sh | 0 toolchain/make_cross_compiler.sh | 9 ++++++--- 6 files changed, 13 insertions(+), 10 deletions(-) mode change 100644 => 100755 toolchain/increment_version.sh diff --git a/.github/workflows/max-os.yml b/.github/workflows/max-os.yml index 4a9ec794..dbce098e 100644 --- a/.github/workflows/max-os.yml +++ b/.github/workflows/max-os.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: toolchain/cross_compiler - key: ${{ runner.os }}-toolchain + key: ${{ runner.os }}-cross_compiler - name: Build toolchain if: steps.cache-toolchain.outputs.cache-hit != 'true' diff --git a/Makefile b/Makefile index 8d99b314..6100532b 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ TARGET=i686-elf -GCC_EXEC ?= $$HOME/opt/cross/bin/$(TARGET)-gcc +GCC_EXEC ?= toolchain/cross_compiler/cross/bin/$(TARGET)-gcc GCC_PARAMS = -ffreestanding -fno-exceptions -fno-rtti -nostdlib -Wall -Wextra -AS_EXEC ?= $$HOME/opt/cross/bin/$(TARGET)-as +AS_EXEC ?= toolchain/cross_compiler/cross/bin/$(TARGET)-as -LD_EXEC ?= $$HOME/opt/cross/bin/$(TARGET)-ld +LD_EXEC ?= toolchain/cross_compiler/cross/bin/$(TARGET)-ld QEMU_PARAMS = -device pcnet,netdev=net0 \ -netdev user,id=net0,hostfwd=tcp::1234-:1234 \ @@ -167,7 +167,7 @@ debug_qemu: build .PHONY: clean clean: rm -rf obj - rm -f maxOS.bin maxOS.sym maxOS.img + rm -f maxOS.bin maxOS.sym cross_compiler: cd toolchain && ./make_cross_compiler.sh diff --git a/README.md b/README.md index 4fa087ef..147aafc5 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Kernel Cleanup - [x] VESA Video Mode - [x] Kernel Boot Rewrite - [x] Rewrite Event Handlers -- [ ] Cross Compiler +- [x] Cross-Compiler - [ ] Better Scripts - [ ] Network Touch Up - Fix Issues with IP, Get it working on QEMU - [ ] DCHP protocol diff --git a/kernel/src/kernel.cpp b/kernel/src/kernel.cpp index aad1acab..26a6793f 100644 --- a/kernel/src/kernel.cpp +++ b/kernel/src/kernel.cpp @@ -186,7 +186,7 @@ extern "C" void kernelMain(const multiboot_info& multibootHeader, uint32_t multi ConsoleStream headerStream(&consoleHeader); // Write the header - int buildCount = 494; + int buildCount = 495; headerStream << " Max OS v0.01 [build " << buildCount << "] " ; // Make a main console area at the top of the screen diff --git a/toolchain/increment_version.sh b/toolchain/increment_version.sh old mode 100644 new mode 100755 diff --git a/toolchain/make_cross_compiler.sh b/toolchain/make_cross_compiler.sh index 4c129a14..d0dce62f 100755 --- a/toolchain/make_cross_compiler.sh +++ b/toolchain/make_cross_compiler.sh @@ -8,8 +8,8 @@ fi mkdir ./cross_compiler cd ./cross_compiler -# Export the paths -export PREFIX="$HOME/opt/cross" +# Prefix should be a bin directory in the current directory +export PREFIX="$PWD/cross" export TARGET=i686-elf export PATH="$PREFIX/bin:$PATH" @@ -17,6 +17,9 @@ export PATH="$PREFIX/bin:$PATH" BINUTILS_VERSION=2.39 GCC_VERSION=12.2.0 +# Print what we are doing +echo "Installing binutils-$BINUTILS_VERSION and gcc-$GCC_VERSION for $TARGET to $PREFIX" + # == Build Binutils == # Download Binutils if not already downloaded @@ -57,4 +60,4 @@ make install-gcc make install-target-libgcc # Test -$HOME/opt/cross/bin/$TARGET-gcc --version \ No newline at end of file +$PREFIX/bin/$TARGET-gcc --version \ No newline at end of file