diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-29 09:05:36 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-29 09:05:36 +0100 |
| commit | b7f2a078b4284c3adc253f40bc54e733d27b6bd6 (patch) | |
| tree | 9eb5c6c0501278bcf1615ba59e7bb25a63bd4f1b /Private/Source | |
| parent | 375fa68692447f6806264fc0339d26b691e2a1bb (diff) | |
HCoreKrnl: Start work on AHCI support. to add HCFS,EPM,GPT support to
the kernel.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/Source')
| -rw-r--r-- | Private/Source/ProcessManager.cxx | 2 | ||||
| -rw-r--r-- | Private/Source/ThreadLocalStorage.cxx | 13 | ||||
| -rw-r--r-- | Private/Source/Utils.cxx | 7 |
3 files changed, 13 insertions, 9 deletions
diff --git a/Private/Source/ProcessManager.cxx b/Private/Source/ProcessManager.cxx index 4a51acc0..c3b07918 100644 --- a/Private/Source/ProcessManager.cxx +++ b/Private/Source/ProcessManager.cxx @@ -36,7 +36,7 @@ const Int32 &rt_get_exit_code() noexcept { return kExitCode; } /***********************************************************************************/ void Process::Crash() { - kcout << this->Name << ": Crashed, ExitCode: -1\n"; + kcout << "ProcessManager: Crashed, ExitCode: -1.\r\n"; MUST_PASS(!ke_bug_check()); this->Exit(-1); diff --git a/Private/Source/ThreadLocalStorage.cxx b/Private/Source/ThreadLocalStorage.cxx index 9a9c8477..60d02efd 100644 --- a/Private/Source/ThreadLocalStorage.cxx +++ b/Private/Source/ThreadLocalStorage.cxx @@ -24,12 +24,13 @@ using namespace HCore; * @param ptr * @return if the cookie is enabled. */ + Boolean hcore_tls_check(VoidPtr ptr) { if (!ptr) return false; const char* _ptr = (const char*)ptr; - kcout << "Krnl\\TLS: Checking for cookie...\n"; + kcout << "HCoreKrnl\\TLS: Checking for cookie...\n"; return _ptr[0] == kCookieMag0 && _ptr[1] == kCookieMag1 && _ptr[2] == kCookieMag2; @@ -40,11 +41,13 @@ Boolean hcore_tls_check(VoidPtr ptr) { * @param ptr * @return */ -Void hcore_tls_check_syscall_impl(ThreadInformationBlock ptr) noexcept { - if (!hcore_tls_check(ptr.Cookie)) { - kcout << "Krnl\\TLS: Verification failure, Crashing...\n"; +EXTERN_C Void hcore_tls_check_syscall_impl(HCore::HAL::StackFramePtr stackPtr) noexcept { + ThreadInformationBlock* tib = (ThreadInformationBlock*)stackPtr->Gs; + + if (!hcore_tls_check(tib->Cookie)) { + kcout << "HCoreKrnl\\TLS: Verification failed, Crashing...\n"; ProcessManager::Shared().Leak().GetCurrent().Leak().Crash(); } - kcout << "Krnl\\TLS: Verification succeeded! Keeping on...\n"; + kcout << "HCoreKrnl\\TLS: Verification succeeded! Keeping on...\n"; } diff --git a/Private/Source/Utils.cxx b/Private/Source/Utils.cxx index 01975192..ecbd56f4 100644 --- a/Private/Source/Utils.cxx +++ b/Private/Source/Utils.cxx @@ -81,7 +81,6 @@ Int rt_move_memory(const voidPtr src, voidPtr dst, Size len) { Int rt_copy_memory(const voidPtr src, voidPtr dst, Size len) { if (len < 1) return -2; - if (!src || !dst) return -1; char *srcChr = reinterpret_cast<char *>(src); char *dstChar = reinterpret_cast<char *>(dst); @@ -89,10 +88,12 @@ Int rt_copy_memory(const voidPtr src, voidPtr dst, Size len) { while (index < len) { dstChar[index] = srcChr[index]; - index++; + ++index; } - return 0; + dstChar[index] = 0; + + return index; } const Char *alloc_string(const Char *text) { |
