diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-02 13:49:50 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-02 13:49:50 +0100 |
| commit | e559cf01834340d0a4dfcb45f7bdf081e8994032 (patch) | |
| tree | b7d1aa03111f83c0b7b058dca2786a6bd234a7e3 /Private/HALKit | |
| parent | 05eca8d3061b60eac0a652a4b1e39269a9af79e8 (diff) | |
Kernel: Port toolchain to mingw (PE/COFF)
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit')
| -rw-r--r-- | Private/HALKit/AMD64/DebugManager.asm | 31 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/HalProcessPrimitives.cxx | 2 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/SMPCoreManager.asm | 34 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/StartSequence.asm | 9 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/crti.s | 16 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/crtn.s | 10 |
6 files changed, 18 insertions, 84 deletions
diff --git a/Private/HALKit/AMD64/DebugManager.asm b/Private/HALKit/AMD64/DebugManager.asm deleted file mode 100644 index 5cc0cd10..00000000 --- a/Private/HALKit/AMD64/DebugManager.asm +++ /dev/null @@ -1,31 +0,0 @@ -;; /* -;; * ======================================================== -;; * -;; * HCore -;; * Copyright Mahrouss Logic, all rights reserved. -;; * -;; * ======================================================== -;; */ - -[global rt_debug_fence] -[global __rt_debug_int_3] - -;; //////////////////////////////////////////////////// ;; - -__rt_debug_record_table: - db "DebugMgr/HCore", 0xa, 0xd, 0 -__rt_debug_int_3: - push 0x6677 ;; Debug check error -;; then halt and goes back to L0, thens halts... -L0: - hlt - jmp $ - -rt_debug_fence: - mov [__rt_debug_record_table], rsi - push rsi - jmp [rbx] - pop rsi - ret - -;; //////////////////////////////////////////////////// ;; diff --git a/Private/HALKit/AMD64/HalProcessPrimitives.cxx b/Private/HALKit/AMD64/HalProcessPrimitives.cxx index d24afad6..86f77e35 100644 --- a/Private/HALKit/AMD64/HalProcessPrimitives.cxx +++ b/Private/HALKit/AMD64/HalProcessPrimitives.cxx @@ -9,8 +9,6 @@ #include <KernelKit/ProcessManager.hpp> -#include "NewKit/Defines.hpp" - using namespace HCore; Void Process::AssignStart(UIntPtr &imageStart) noexcept { diff --git a/Private/HALKit/AMD64/SMPCoreManager.asm b/Private/HALKit/AMD64/SMPCoreManager.asm index de7d8356..1a994258 100644 --- a/Private/HALKit/AMD64/SMPCoreManager.asm +++ b/Private/HALKit/AMD64/SMPCoreManager.asm @@ -11,21 +11,23 @@ [global rt_do_context_switch] +section .text + rt_do_context_switch: - mov [rdi+0], rax - mov [rdi+8], rbx - mov [rdi+16], rcx - mov [rdi+24], rdx - mov [rdi+32], rsi - mov [rdi+40], rdi - mov [rdi+48], rbp - mov [rdi+56], rsp - mov [rdi+64], r8 - mov [rdi+72], r9 - mov [rdi+80], r10 - mov [rdi+88], r11 - mov [rdi+96], r12 - mov [rdi+104], r13 - mov [rdi+112], r14 - mov [rdi+120], r15 + mov [r15+0], rax + mov [r15+8], rbx + mov [r15+16], rcx + mov [r15+24], rdx + mov [r15+32], rsi + mov [r15+40], rdi + mov [r15+48], rbp + mov [r15+56], rsp + mov [r15+64], r8 + mov [r15+72], r9 + mov [r15+80], r10 + mov [r15+88], r11 + mov [r15+96], r12 + mov [r15+104], r13 + mov [r15+112], r14 + mov [r15+120], r15 ret diff --git a/Private/HALKit/AMD64/StartSequence.asm b/Private/HALKit/AMD64/StartSequence.asm index 09cb1d65..5ef8ed55 100644 --- a/Private/HALKit/AMD64/StartSequence.asm +++ b/Private/HALKit/AMD64/StartSequence.asm @@ -32,17 +32,8 @@ section .text ;; Just a simple setup, we'd also need to tell some before Main: - mov rsp, __SYSTEM_STACK_END - mov ebp, RuntimeMain jmp RuntimeMain L0: cli hlt jmp $ - -;; @brief this one is jumped on when an unsupported then gets through the boot stage. -;; @note: must be ISA compatible! -MainUnsupported: - cli - hlt - jmp $ diff --git a/Private/HALKit/AMD64/crti.s b/Private/HALKit/AMD64/crti.s deleted file mode 100644 index a85782ea..00000000 --- a/Private/HALKit/AMD64/crti.s +++ /dev/null @@ -1,16 +0,0 @@ -/* x86_64 crti.s */ -.section .init -.global _init -.type _init, @function -_init: - push %rbp - movq %rsp, %rbp - /* gcc will nicely put the contents of crtbegin.o's .init section here. */ - -.section .fini -.global _fini -.type _fini, @function -_fini: - push %rbp - movq %rsp, %rbp - /* gcc will nicely put the contents of crtbegin.o's .fini section here. */ diff --git a/Private/HALKit/AMD64/crtn.s b/Private/HALKit/AMD64/crtn.s deleted file mode 100644 index b446d9f3..00000000 --- a/Private/HALKit/AMD64/crtn.s +++ /dev/null @@ -1,10 +0,0 @@ -/* x86_64 crtn.s */ -.section .init - /* gcc will nicely put the contents of crtend.o's .init section here. */ - popq %rbp - ret - -.section .fini - /* gcc will nicely put the contents of crtend.o's .fini section here. */ - popq %rbp - ret |
