diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-01-19 14:12:27 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-01-19 14:12:27 +0100 |
| commit | 5d712c34f9254351e5c9f6fd4c465b42114661d0 (patch) | |
| tree | cbb3cec7b056f817417227d1e8004520166e1fa3 | |
| parent | 9d6babb9a3b9ffbedc1fa377f47ff6b3f7585056 (diff) | |
Revision I: Extending PowerPC support.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
| -rw-r--r-- | HALKit/PowerPC/CorePowerPCStart.s | 6 | ||||
| -rw-r--r-- | HALKit/PowerPC/Processor.cpp | 4 | ||||
| -rw-r--r-- | KernelKit/OSErr.hpp | 1 | ||||
| -rw-r--r-- | KernelKit/SMPManager.hpp | 8 | ||||
| -rw-r--r-- | Linker/PowerPC.ld | 21 | ||||
| -rw-r--r-- | NewKit/Json.hpp | 2 | ||||
| -rw-r--r-- | Source/DriveManager.cxx | 3 | ||||
| -rw-r--r-- | Source/Json.cxx | 9 | ||||
| -rw-r--r-- | Source/SMPManager.cxx | 8 | ||||
| -rw-r--r-- | makefile | 6 |
10 files changed, 52 insertions, 16 deletions
diff --git a/HALKit/PowerPC/CorePowerPCStart.s b/HALKit/PowerPC/CorePowerPCStart.s new file mode 100644 index 00000000..f0c5ae2b --- /dev/null +++ b/HALKit/PowerPC/CorePowerPCStart.s @@ -0,0 +1,6 @@ +.globl __AssemblerStart +.align 4 +.text + +__AssemblerStart: + b __AssemblerStart
\ No newline at end of file diff --git a/HALKit/PowerPC/Processor.cpp b/HALKit/PowerPC/Processor.cpp index 6bb4ff65..2b26ef24 100644 --- a/HALKit/PowerPC/Processor.cpp +++ b/HALKit/PowerPC/Processor.cpp @@ -31,14 +31,14 @@ namespace HAL // @brief wakes up thread. // wakes up thread from hang. -extern void rt_wakeup_thread(HAL::StackFrame* stack) +void rt_wakeup_thread(HAL::StackFrame* stack) { } // @brief makes thread sleep. // hooks and hangs thread to prevent code from executing. -extern void rt_hang_thread(HAL::StackFrame* stack) +void rt_hang_thread(HAL::StackFrame* stack) { } diff --git a/KernelKit/OSErr.hpp b/KernelKit/OSErr.hpp index 26f91502..0a8efff3 100644 --- a/KernelKit/OSErr.hpp +++ b/KernelKit/OSErr.hpp @@ -26,4 +26,5 @@ namespace hCore inline constexpr OSErr kErrorThreadLocalStorage = 41; inline constexpr OSErr kErrorMath = 42; inline constexpr OSErr kErrorNoNetwork = 43; + inline constexpr OSErr kErrorHeapOutOfMemory = 44; }
\ No newline at end of file diff --git a/KernelKit/SMPManager.hpp b/KernelKit/SMPManager.hpp index 4ebc944a..a757ca9c 100644 --- a/KernelKit/SMPManager.hpp +++ b/KernelKit/SMPManager.hpp @@ -108,6 +108,14 @@ namespace hCore ThreadID m_CurrentThread; }; + + // @brief wakes up thread. + // wakes up thread from hang. + void rt_wakeup_thread(HAL::StackFrame* stack); + + // @brief makes thread sleep. + // hooks and hangs thread to prevent code from executing. + void rt_hang_thread(HAL::StackFrame* stack); } // namespace hCore #endif // !_INC_SMP_MANAGER_HPP diff --git a/Linker/PowerPC.ld b/Linker/PowerPC.ld new file mode 100644 index 00000000..18b6527e --- /dev/null +++ b/Linker/PowerPC.ld @@ -0,0 +1,21 @@ +ENTRY(_start) + +SECTIONS +{ + . = 0x02000000; + .text BLOCK(4K) : ALIGN(4K) + { + *(.text) + } + . = 0x02100000; + .data BLOCK(4K) : ALIGN(4K) + { + + *(.rodata) + *(.data) + } + .bss BLOCK(4K) (NOLOAD) : ALIGN(4K) + { + *(.bss) + } +}
\ No newline at end of file diff --git a/NewKit/Json.hpp b/NewKit/Json.hpp index 9b937550..a8b9c142 100644 --- a/NewKit/Json.hpp +++ b/NewKit/Json.hpp @@ -32,9 +32,11 @@ namespace hCore HCORE_COPY_DEFAULT(JsonType); + private: StringView fKey; StringView fValue; + public: StringView& AsKey() { return fKey; } StringView& AsValue() { return fValue; } diff --git a/Source/DriveManager.cxx b/Source/DriveManager.cxx index 23e08707..9e80c14e 100644 --- a/Source/DriveManager.cxx +++ b/Source/DriveManager.cxx @@ -7,9 +7,6 @@ * ======================================================== */ -#include <FSKit/NewFS.hxx> -#include <NewKit/Utils.hpp> - #include <KernelKit/DebugOutput.hpp> #include <KernelKit/DriveManager.hpp> diff --git a/Source/Json.cxx b/Source/Json.cxx index dd106a4e..fe086271 100644 --- a/Source/Json.cxx +++ b/Source/Json.cxx @@ -1,3 +1,12 @@ +/* +* ======================================================== +* +* hCore +* Copyright Mahrouss Logic, all rights reserved. +* +* ======================================================== +*/ + #include <NewKit/Json.hpp> using namespace hCore; diff --git a/Source/SMPManager.cxx b/Source/SMPManager.cxx index d2adf0cb..a12cf513 100644 --- a/Source/SMPManager.cxx +++ b/Source/SMPManager.cxx @@ -16,14 +16,6 @@ namespace hCore { - // @brief wakes up thread. - // wakes up thread from hang. - extern void rt_wakeup_thread(HAL::StackFrame* stack); - - // @brief makes thread sleep. - // hooks and hangs thread to prevent code from executing. - extern void rt_hang_thread(HAL::StackFrame* stack); - // A ProcessorCore class takes care of it's owned hardware thread. // It has a stack for it's core. @@ -8,10 +8,10 @@ ASMFLAGS = -f elf64 KERNEL = hKernel.elf # The kernel entrypoint -ENTRY = __KernelMain +ENTRY = --script=Linker/PowerPC.ld # Where the text segment is. -TEXT = 0x400000 +TEXT = 0xc0000000 # we want a flat binary FMT = elf64 @@ -24,7 +24,7 @@ kernel-build: .PHONY: kernel-link kernel-link: - $(LD) -e $(ENTRY) -Ttext $(TEXT) --oformat $(FMT) Obj/*.o -o $(KERNEL) + $(LD) -e $(ENTRY) Obj/*.o -o $(KERNEL) .PHONY: all all: kernel-build kernel-link |
