From 9730af99922475ca56d7ce51b51081b6a5bdc5f4 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 10 Jun 2023 13:12:18 +0300 Subject: [PATCH] Update OS --- .github/workflows/makefile.yml | 37 +++------------ Fennix Kernel.code-workspace | 6 ++- Fennix Userspace.code-workspace | 10 +++- Kernel | 2 +- Makefile | 4 +- Makefile.conf | 26 +++++----- Userspace | 2 +- tools/Makefile | 84 +++++++++------------------------ 8 files changed, 58 insertions(+), 113 deletions(-) diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index 6f03456f..bdb6970d 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -55,53 +55,29 @@ jobs: - name: Clone All if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools clone_all + run: make --quiet -C tools __clone_all_no_qemu - name: Compile Binutils amd64 if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools do_binutils64 + run: make --quiet -C tools do_binutils_64 - name: Compile Binutils i386 if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools do_binutils32 - - - name: Compile Binutils aarch64 - if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools do_binutilsarm64 + run: make --quiet -C tools do_binutils_32 - name: Compile GCC amd64 if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools do_gcc64 + run: make --quiet -C tools do_gcc_64 - name: Compile GCC i386 if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools do_gcc32 - - - name: Compile GCC aarch64 - if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools do_gccarm64 - - - name: Compile 64-bit Toolchain Binutils - if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools do_toolchain_binutils64 - - - name: Compile 64-bit Toolchain GCC - if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools do_toolchain_gcc64 - - - name: Compile 32-bit Toolchain Binutils - if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools do_toolchain_binutils32 - - - name: Compile 32-bit Toolchain GCC - if: steps.cache-cross.outputs.cache-hit != 'true' - run: make --quiet -C tools do_toolchain_gcc32 + run: make --quiet -C tools do_gcc_32 - name: Clean Up if: steps.cache-cross.outputs.cache-hit != 'true' run: | cd tools - rm -rf binutils-gdb gcc qemu build-binutilsamd64 build-binutilsi386 build-binutilsarm64 build-gccamd64 build-gcci386 build-gccarm64 build-toolchain-binutils64 build-toolchain-gcc64 build-toolchain-binutils32 build-toolchain-gcc32 + rm -rf binutils-gdb gcc build-binutils64 build-gcc64 build-binutils32 build-gcc32 compilegnuefi: name: Build GNU-EFI @@ -305,6 +281,7 @@ jobs: path: Fennix-release.iso compilearm64: + if: ${{ false }} # Disabled until we can get it to work name: Build aarch64 runs-on: ubuntu-latest needs: [buildcompiler, compilegnuefi] diff --git a/Fennix Kernel.code-workspace b/Fennix Kernel.code-workspace index 84f6fd32..bf064afb 100644 --- a/Fennix Kernel.code-workspace +++ b/Fennix Kernel.code-workspace @@ -35,7 +35,10 @@ "cstddef": "cpp", "atomic.hpp": "c", "atomic": "cpp", - "syscalls.h": "c" + "syscalls.h": "c", + "cmath": "cpp", + "typeinfo": "c", + "exception": "cpp" }, "cSpell.words": [ "AABBCC", @@ -244,6 +247,7 @@ "PERFEVTSEL", "PEXIT", "PFLA", + "Phdrs", "pheader", "PHENT", "phentsize", diff --git a/Fennix Userspace.code-workspace b/Fennix Userspace.code-workspace index ec5d750e..cd5e748d 100644 --- a/Fennix Userspace.code-workspace +++ b/Fennix Userspace.code-workspace @@ -28,7 +28,15 @@ "liballoc_1_1.h": "c", "errno.h": "c", "stdlib.h": "c", - "stdarg.h": "c" + "stdarg.h": "c", + "printf.h": "c", + "ctype.h": "c", + "unistd.h": "c", + "stat.h": "c", + "wait.h": "c", + "base.h": "c", + "ld.h": "c", + "syscall.h": "c" }, "cSpell.words": [ "auxv", diff --git a/Kernel b/Kernel index e8162bc3..41db4771 160000 --- a/Kernel +++ b/Kernel @@ -1 +1 @@ -Subproject commit e8162bc3cbd39780b70afdc59a336482d39e81b9 +Subproject commit 41db47717374df5bd340e2eeb55f8dbd416e3f45 diff --git a/Makefile b/Makefile index f6b50627..a2a85c9a 100644 --- a/Makefile +++ b/Makefile @@ -186,10 +186,12 @@ QEMU_SMP_DBG = -smp 4 QEMU_SMP = -smp 4 endif -vscode_debug: build_lynx build_kernel build_userspace build_modules build_image +vscode_debug_only: rm -f serial.log profiler.log memtrk.dmp serial4.dmp network.dmp $(QEMU) -S -gdb tcp::1234 -d int -no-reboot -no-shutdown $(QEMU_UEFI_BIOS) -m 1G $(QEMUFLAGS) $(QEMU_SMP_DBG) +vscode_debug: build_lynx build_kernel build_userspace build_modules build_image vscode_debug_only + qemu: qemu_vdisk rm -f serial.log profiler.log memtrk.dmp serial4.dmp network.dmp $(QEMU) $(QEMU_UEFI_BIOS) -cpu host $(QEMUFLAGS) $(QEMUHWACCELERATION) $(QEMUMEMORY) $(QEMU_SMP) diff --git a/Makefile.conf b/Makefile.conf index 2b779b71..aa2f967e 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -26,12 +26,11 @@ BUILD_MODULES = 1 QUIET_BUILD = 1 +USERSPACE_STATIC_LIBS = 1 + # The path of the cross-compiler. COMPILER_PATH = tools/cross/bin -# The path of the toolchain cross-compiler. -TC_COMPILER_PATH = tools/cross/toolchain/bin - # The path of the Limine bootloader. LIMINE_FOLDER = tools/limine @@ -51,24 +50,21 @@ MLIBC = 0 + + + + + + # Make releated variables -# DO NOT TOUCH! ifeq ($(OSARCH), amd64) -COMPILER_ARCH = amd64-elf- +COMPILER_ARCH = x86_64-fennix- QEMU_ARCH = x86_64 else ifeq ($(OSARCH), i386) -COMPILER_ARCH = i386-elf- +COMPILER_ARCH = i386-fennix- QEMU_ARCH = i386 else ifeq ($(OSARCH), aarch64) -COMPILER_ARCH = aarch64-elf- +COMPILER_ARCH = aarch64-fennix- QEMU_ARCH = aarch64 endif - -ifeq ($(OSARCH), amd64) -TC_COMPILER_ARCH = x86_64-fennix- -else ifeq ($(OSARCH), i386) -TC_COMPILER_ARCH = i386-fennix- -else ifeq ($(OSARCH), aarch64) -TC_COMPILER_ARCH = aarch64-fennix- -endif diff --git a/Userspace b/Userspace index d949a1a4..22e75b95 160000 --- a/Userspace +++ b/Userspace @@ -1 +1 @@ -Subproject commit d949a1a44940e04721ec55ac5b05da6580a6f5cf +Subproject commit 22e75b95402630c6c2bd878281ef09ac055dc120 diff --git a/tools/Makefile b/tools/Makefile index f2d52177..1932c27d 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -4,7 +4,7 @@ export PATH := $(CROSS_DIR):$(PATH) QEMU_VERSION = qemu-7.1.0 -all: do_rep do_ep do_fex do_emd do_limine clone_all do_binutils64 do_binutils32 do_binutilsarm64 do_gcc64 do_gcc32 do_gccarm64 do_toolchain_binutils64 do_toolchain_gcc64 do_toolchain_binutils32 do_toolchain_gcc32 do_qemu +all: do_rep do_ep do_fex do_emd do_limine clone_all do_binutils_64 do_gcc_64 do_binutils_32 do_gcc_32 do_qemu clean: rm -f rep ep fex ExtMemDbg/emd @@ -36,88 +36,46 @@ clone_all: mv ${QEMU_VERSION} qemu mkdir -p cross mkdir -p qemu - mkdir -p build-binutilsamd64 - mkdir -p build-binutilsi386 - mkdir -p build-binutilsarm64 - mkdir -p build-gccamd64 - mkdir -p build-gcci386 - mkdir -p build-gccarm64 - mkdir -p build-toolchain-binutils64 - mkdir -p build-toolchain-gcc64 - mkdir -p build-toolchain-binutils32 - mkdir -p build-toolchain-gcc32 + mkdir -p build-binutils64 + mkdir -p build-gcc64 + mkdir -p build-binutils32 + mkdir -p build-gcc32 __clone_all_no_qemu: git clone https://github.com/Fennix-Project/binutils-gdb.git binutils-gdb git clone https://github.com/Fennix-Project/gcc.git gcc mkdir -p cross - mkdir -p build-binutilsamd64 - mkdir -p build-binutilsi386 - mkdir -p build-binutilsarm64 - mkdir -p build-gccamd64 - mkdir -p build-gcci386 - mkdir -p build-gccarm64 - mkdir -p build-toolchain-binutils64 - mkdir -p build-toolchain-gcc64 - mkdir -p build-toolchain-binutils32 - mkdir -p build-toolchain-gcc32 + mkdir -p build-binutils64 + mkdir -p build-gcc64 + mkdir -p build-binutils32 + mkdir -p build-gcc32 do_qemu: cd qemu && \ bash ./configure --target-list=x86_64-softmmu,i386-softmmu,aarch64-softmmu --prefix="$(CROSS_DIR)" --enable-gtk && \ make -j$(shell nproc) && make install -do_binutils64: - cd build-binutilsamd64 && \ - ../binutils-gdb/configure --target=amd64-elf --prefix="$(CROSS_DIR)" --with-sysroot --enable-shared --disable-werror && \ +do_binutils_64: + cd build-binutils64 && \ + ../binutils-gdb/configure --target=x86_64-fennix --prefix="$(CROSS_DIR)" --with-sysroot --enable-shared --disable-werror && \ make all -j$(shell nproc) && make install -do_binutils32: - cd build-binutilsi386 && \ - ../binutils-gdb/configure --target=i386-elf --prefix="$(CROSS_DIR)" --with-sysroot --disable-werror && \ - make all -j$(shell nproc) && make install - -do_binutilsarm64: - cd build-binutilsarm64 && \ - ../binutils-gdb/configure --target=aarch64-elf --prefix="$(CROSS_DIR)" --with-sysroot --disable-werror && \ - make all -j$(shell nproc) && make install - -do_gcc64: - cd build-gccamd64 && \ - ../gcc/configure --target=amd64-elf --prefix="$(CROSS_DIR)" --enable-languages=c,c++ --without-headers && \ - make all-gcc -j$(shell nproc) && make install-gcc -j$(shell nproc) - -do_gcc32: - cd build-gcci386 && \ - ../gcc/configure --target=i386-elf --prefix="$(CROSS_DIR)" --enable-languages=c,c++ --without-headers && \ - make all-gcc -j$(shell nproc) && make install-gcc -j$(shell nproc) - -do_gccarm64: - cd build-gccarm64 && \ - ../gcc/configure --target=aarch64-elf --prefix="$(CROSS_DIR)" --enable-languages=c,c++ --without-headers && \ - make all-gcc -j$(shell nproc) && make install-gcc -j$(shell nproc) - -do_toolchain_binutils64: - cd build-toolchain-binutils64 && \ - ../binutils-gdb/configure --target=x86_64-fennix --prefix="$(CROSS_DIR)/toolchain" --with-sysroot --enable-shared --disable-werror && \ - make all -j$(shell nproc) && make install - -do_toolchain_gcc64: - cd build-toolchain-gcc64 && \ - ../gcc/configure --target=x86_64-fennix --prefix="$(CROSS_DIR)/toolchain" --enable-languages=c,c++ --enable-shared --without-headers && \ +do_gcc_64: + cd build-gcc64 && \ + ../gcc/configure --target=x86_64-fennix --prefix="$(CROSS_DIR)" --enable-languages=c,c++ --enable-shared --without-headers && \ make all-gcc -j$(shell nproc) && \ make all-target-libgcc -j$(shell nproc) && \ make install-gcc -j$(shell nproc) && \ make install-target-libgcc -j$(shell nproc) -do_toolchain_binutils32: - cd build-toolchain-binutils32 && \ - ../binutils-gdb/configure --target=i386-fennix --prefix="$(CROSS_DIR)/toolchain" --with-sysroot --enable-shared --disable-werror && \ +do_binutils_32: + cd build-binutils32 && \ + ../binutils-gdb/configure --target=i386-fennix --prefix="$(CROSS_DIR)" --with-sysroot --enable-shared --disable-werror && \ make all -j$(shell nproc) && make install -do_toolchain_gcc32: - cd build-toolchain-gcc32 && \ - ../gcc/configure --target=i386-fennix --prefix="$(CROSS_DIR)/toolchain" --enable-languages=c,c++ --enable-shared --without-headers && \ +do_gcc_32: + cd build-gcc32 && \ + ../gcc/configure --target=i386-fennix --prefix="$(CROSS_DIR)" --enable-languages=c,c++ --enable-shared --without-headers && \ make all-gcc -j$(shell nproc) && \ make all-target-libgcc -j$(shell nproc) && \ make install-gcc -j$(shell nproc) && \