diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index a61a1f7d..8fdbc2d1 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -173,7 +173,6 @@ jobs: with: folder: doxygen-doc - compile_amd64: name: Build amd64 runs-on: ubuntu-latest diff --git a/Kernel/Makefile b/Kernel/Makefile index b1ee9e82..0585d8f3 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -54,7 +54,7 @@ else ifeq ($(OSARCH), i386) CFLAGS += -march=pentium -m32 -mno-red-zone LDFLAGS += -Tarch/i386/linker.ld else ifeq ($(OSARCH), arm) -CFLAGS += -march=armv7-a -mfloat-abi=softfp +CFLAGS += -march=armv7-a -mfloat-abi=softfp -ggdb3 LDFLAGS += -Tarch/arm/linker.ld WARNCFLAG += -w else ifeq ($(OSARCH), aarch64) diff --git a/Kernel/arch/aarch64/linker.ld b/Kernel/arch/aarch64/linker.ld index 23fb294a..d50030f6 100644 --- a/Kernel/arch/aarch64/linker.ld +++ b/Kernel/arch/aarch64/linker.ld @@ -15,6 +15,9 @@ along with Fennix Kernel. If not, see . */ +OUTPUT_FORMAT("elf64-littleaarch64") +OUTPUT_ARCH(aarch64) + ENTRY(_start) SECTIONS diff --git a/Kernel/arch/arm/linker.ld b/Kernel/arch/arm/linker.ld index 23fb294a..da726905 100644 --- a/Kernel/arch/arm/linker.ld +++ b/Kernel/arch/arm/linker.ld @@ -15,6 +15,9 @@ along with Fennix Kernel. If not, see . */ +OUTPUT_FORMAT("elf32-littlearm") +OUTPUT_ARCH(arm) + ENTRY(_start) SECTIONS diff --git a/Kernel/core/cpu.cpp b/Kernel/core/cpu.cpp index 7519857c..831f6d5b 100644 --- a/Kernel/core/cpu.cpp +++ b/Kernel/core/cpu.cpp @@ -163,8 +163,9 @@ namespace CPU asmv("popl %0" : "=r"(Flags)); return Flags & (1 << 9); -#elif defined(__aarch64__) -#warning "aarch64 not implemented" +#else +#warning "not implemented" + UNUSED(Flags); return 0; #endif } diff --git a/Kernel/core/driver/api.cpp b/Kernel/core/driver/api.cpp index 9c95afca..401d9140 100644 --- a/Kernel/core/driver/api.cpp +++ b/Kernel/core/driver/api.cpp @@ -80,6 +80,7 @@ namespace v0 #elif defined(__aarch64__) + UNUSED(cs); stub; return 0; diff --git a/Kernel/core/memory/pmi.cpp b/Kernel/core/memory/pmi.cpp index d4a9ca39..36f60a2c 100644 --- a/Kernel/core/memory/pmi.cpp +++ b/Kernel/core/memory/pmi.cpp @@ -36,7 +36,9 @@ namespace Memory this->PTEIndex = Address & 0x3FF; Address >>= 10; this->PDEIndex = Address & 0x3FF; -#elif defined(__aarch64__) +#else +#warning "not implemented" +UNUSED(Address); #endif if (VirtualAddress > PAGE_SIZE) diff --git a/Kernel/core/memory/vma.cpp b/Kernel/core/memory/vma.cpp index b5f8bf67..d35e14d1 100644 --- a/Kernel/core/memory/vma.cpp +++ b/Kernel/core/memory/vma.cpp @@ -330,6 +330,8 @@ namespace Memory MgrLock.Lock(__FUNCTION__); #else #warning "Not implemented" + UNUSED(AddressToMap); + UNUSED(RealAddress); #endif } diff --git a/Kernel/core/panic/handler.cpp b/Kernel/core/panic/handler.cpp index 3d630394..ecf4a7d3 100644 --- a/Kernel/core/panic/handler.cpp +++ b/Kernel/core/panic/handler.cpp @@ -188,6 +188,8 @@ nsa __noreturn void HandleUnrecoverableException(CPU::ExceptionFrame *Frame) #if defined(__amd64__) || defined(__i386__) ExPrint("\x1b[30;41mUnrecoverable exception %#lx on CPU %d\n", Frame->InterruptNumber, core->ID); +#else + UNUSED(core); #endif #if defined(__amd64__) || defined(__i386__) ExPrint("CR0=%#lx CR2=%#lx CR3=%#lx CR4=%#lx CR8=%#lx\n", diff --git a/Kernel/core/panic/ui.cpp b/Kernel/core/panic/ui.cpp index c9cf6a13..f12c17da 100644 --- a/Kernel/core/panic/ui.cpp +++ b/Kernel/core/panic/ui.cpp @@ -328,7 +328,7 @@ nsa void DisplayMainScreen(CPU::ExceptionFrame *Frame) #elif defined(__i386__) Frame->eip); #elif defined(__arm__) -0); + 0); #elif defined(__aarch64__) 0); #warning "aarch64 not implemented" @@ -779,6 +779,9 @@ nsa void DisplayAssertionFailed(const char *File, int Line, const char *Expressi asmv("movl %%cr3, %0" : "=r"(ef.cr3)); ef.eip = (uint32_t)fun; ef.ebp = ef.esp = (uint32_t)stk; +#else + UNUSED(fun); + UNUSED(stk); #endif DisplayStackScreen(&ef); diff --git a/Kernel/core/panic/user.cpp b/Kernel/core/panic/user.cpp index 1ea35edc..00749e44 100644 --- a/Kernel/core/panic/user.cpp +++ b/Kernel/core/panic/user.cpp @@ -154,6 +154,8 @@ nsa bool UserModeExceptionHandler(CPU::ExceptionFrame *Frame) break; } } +#else + UNUSED(proc); #endif if (sigRet == 0) diff --git a/Kernel/kernel.cpp b/Kernel/kernel.cpp index 373a427f..a64f08b6 100644 --- a/Kernel/kernel.cpp +++ b/Kernel/kernel.cpp @@ -355,8 +355,9 @@ EXTERNC __no_stack_protector NIF void Entry(BootInfo *Info) : "r"(KernelStack) : "memory"); asmv("mov $0, %ebp"); -#elif defined(__aarch64__) +#else #warning "Kernel stack is not set!" + UNUSED(KernelStack); #endif #ifdef DEBUG diff --git a/Kernel/kshell/commands/top.cpp b/Kernel/kshell/commands/top.cpp index 221a4f5b..fb850ac1 100644 --- a/Kernel/kshell/commands/top.cpp +++ b/Kernel/kshell/commands/top.cpp @@ -69,6 +69,8 @@ void cmd_top(const char *) Thrd->ID, Thrd->Name, TaskStateStrings[Thrd->State.load()], Thrd->Info.Priority, TO_KiB(Thrd->GetSize()), Thrd->Info.UserTime + Thrd->Info.KernelTime); +#else + UNUSED(Thrd); #endif } } diff --git a/Kernel/kshell/commands/uptime.cpp b/Kernel/kshell/commands/uptime.cpp index 71b94624..bea39681 100644 --- a/Kernel/kshell/commands/uptime.cpp +++ b/Kernel/kshell/commands/uptime.cpp @@ -48,6 +48,9 @@ void cmd_uptime(const char *) printf("%lld days, %lld hours, %lld minutes, %lld %s\n", Days, Hours, Minutes, Seconds, Seconds == 1 ? "second" : "seconds"); +#else +#warning "not implemented" + UNUSED(Days); #endif } else diff --git a/Kernel/subsystem/linux/syscall.cpp b/Kernel/subsystem/linux/syscall.cpp index 2db72db8..f09640e4 100644 --- a/Kernel/subsystem/linux/syscall.cpp +++ b/Kernel/subsystem/linux/syscall.cpp @@ -1091,6 +1091,9 @@ static int linux_mprotect(SysFrm *, void *addr, size_t len, int prot) pte->UserSupervisor = p_Read; pte->ReadWrite = p_Write; // pte->ExecuteDisable = p_Exec; +#else + UNUSED(p_Read); + UNUSED(p_Write); #endif debug("Changed permissions of page %#lx to %s %s %s %s", @@ -4332,7 +4335,9 @@ uintptr_t HandleLinuxSyscalls(SyscallsFrame *Frame) debug("< [%d:\"%s\"] = %d", Frame->ax, Syscall.Name, sc_ret); return sc_ret; -#elif defined(__aarch64__) +#else + UNUSED(LinuxSyscallsTableAMD64); + UNUSED(LinuxSyscallsTableI386); return -linux_ENOSYS; #endif diff --git a/Kernel/tasking/thread.cpp b/Kernel/tasking/thread.cpp index 4c4e3284..563c4c10 100644 --- a/Kernel/tasking/thread.cpp +++ b/Kernel/tasking/thread.cpp @@ -320,8 +320,9 @@ namespace Tasking this->Registers.rsp = StackPointerReg; #elif defined(__i386__) this->Registers.esp = StackPointerReg; -#elif defined(__aarch64__) -#warning "aarch64 not implemented" +#else +#warning "not implemented" + UNUSED(StackPointerReg); #endif if (argvLen > 0)