summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-11 10:01:11 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-11 10:01:11 +0200
commit4bc2a20e699812c397e0d9e3901d91196d8681f0 (patch)
tree0a00c7d47236cacf21413f58341bec6c0ec97455 /Kernel/HALKit
parent25c6f11de8d859d2aab49848cfc2c2d9a7f33153 (diff)
[newoskrnl.dll] Fixes and improvements, mostly on New FS and User Security support.
[encryptfs.dll] Add new DLL for filesystem encryption. [sci.dll] Add protocols for IDL parsing. Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/HALKit')
-rw-r--r--Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cxx30
-rw-r--r--Kernel/HALKit/AMD64/HalKernelMain.cxx13
2 files changed, 16 insertions, 27 deletions
diff --git a/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cxx b/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cxx
index bf463ae9..e4bf13e1 100644
--- a/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cxx
+++ b/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cxx
@@ -12,55 +12,35 @@
/// @param rsp
EXTERN_C void idt_handle_gpf(Kernel::UIntPtr rsp)
{
- Kernel::kcout
- << "newoskrnl: General Protection Fault, caused by "
- << Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().GetProcessName();
-
- Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().Crash();
+ Kernel::ke_stop(RUNTIME_CHECK_BAD_BEHAVIOR);
}
/// @brief Handle page fault.
/// @param rsp
EXTERN_C void idt_handle_pf(Kernel::UIntPtr rsp)
{
- Kernel::kcout
- << "newoskrnl: Segmentation Fault, caused by "
- << Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().GetProcessName();
-
- Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().Crash();
+ Kernel::ke_stop(RUNTIME_CHECK_BAD_BEHAVIOR);
}
/// @brief Handle math fault.
/// @param rsp
EXTERN_C void idt_handle_math(Kernel::UIntPtr rsp)
{
- Kernel::kcout
- << "newoskrnl: Math error, caused by "
- << Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().GetProcessName();
-
- Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().Crash();
+ Kernel::ke_stop(RUNTIME_CHECK_BAD_BEHAVIOR);
}
/// @brief Handle any generic fault.
/// @param rsp
EXTERN_C void idt_handle_generic(Kernel::UIntPtr rsp)
{
- Kernel::kcout
- << "newoskrnl: Execution error, caused by "
- << Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().GetProcessName();
-
- Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().Crash();
+ Kernel::ke_stop(RUNTIME_CHECK_BAD_BEHAVIOR);
}
/// @brief Handle #UD fault.
/// @param rsp
EXTERN_C void idt_handle_ud(Kernel::UIntPtr rsp)
{
- Kernel::kcout
- << "newoskrnl: Invalid interrupt, caused by "
- << Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().GetProcessName();
-
- Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().Crash();
+ Kernel::ke_stop(RUNTIME_CHECK_BAD_BEHAVIOR);
}
/// @brief Enter syscall from assembly.
diff --git a/Kernel/HALKit/AMD64/HalKernelMain.cxx b/Kernel/HALKit/AMD64/HalKernelMain.cxx
index 01153c0e..9eabe9d7 100644
--- a/Kernel/HALKit/AMD64/HalKernelMain.cxx
+++ b/Kernel/HALKit/AMD64/HalKernelMain.cxx
@@ -209,13 +209,17 @@ Kernel::Void hal_real_init(Kernel::Void) noexcept
kSyscalls[cLastExitInterrupt].Leak().Leak()->fHooked = true;
kSyscalls[cShutdownInterrupt].Leak().Leak()->fHooked = true;
kSyscalls[cRebootInterrupt].Leak().Leak()->fHooked = true;
-
- Kernel::kcout << "newoskrnl: Creating Filesystem and Super User...\r";
auto fs = new Kernel::NewFilesystemManager();
Kernel::NewFilesystemManager::Mount(fs);
+ MUST_PASS(fs->GetParser());
+
+ delete fs->GetParser()->CreateCatalog("\\Users\\", 0, kNewFSCatalogKindDir);
+
+ Kernel::kcout << "newoskrnl: Creating filesystem and " << kSuperUser << "..." << Kernel::endl;
+
cRoot = new Kernel::User(Kernel::RingKind::kRingSuperUser, kSuperUser);
#ifdef __DEBUG__
@@ -223,8 +227,13 @@ Kernel::Void hal_real_init(Kernel::Void) noexcept
#else
const auto cPassword = "password";
#endif
+
+ Kernel::UserManager::The()->fRootUser = cRoot;
+
+ Kernel::kcout << "newoskrnl: Root is " << kSuperUser << "." << Kernel::endl;
cRoot->TrySave(cPassword);
+
Kernel::UserManager::The()->TryLogIn(cRoot, cPassword);
Kernel::ke_stop(RUNTIME_CHECK_FAILED);