diff options
| author | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-07 23:29:56 +0200 |
|---|---|---|
| committer | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-07 23:29:56 +0200 |
| commit | 884ea5c2d43b6c8d4c2bb4fc33c11dc2313eeca2 (patch) | |
| tree | 43ee445f2c778224e9d7ce20e699761412d35070 | |
| parent | 9406bf169c89c541ce50caeb9bce1e31913d3c70 (diff) | |
[dev/ZKA/HalProcessor.cxx] Better mm_map_page function.
Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
| -rw-r--r-- | dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx | 1 | ||||
| -rw-r--r-- | dev/ZKA/HALKit/AMD64/HalProcessor.cxx | 9 | ||||
| -rw-r--r-- | dev/ZKA/HALKit/AMD64/HalSchedulerCore.cxx | 2 | ||||
| -rw-r--r-- | dev/ZKA/Sources/ExeMain.cxx | 6 | ||||
| -rw-r--r-- | dev/ZKA/Sources/PEFCodeMgr.cxx | 7 |
5 files changed, 8 insertions, 17 deletions
diff --git a/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx b/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx index c5f39eaa..56a5f3a6 100644 --- a/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx +++ b/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx @@ -131,6 +131,7 @@ namespace Kernel kcout << "BMPMgr: Freed pointer!\r"; kcout << "Magic Number: " << hex_number(ptr_bit_set[0]) << endl; + kcout << "Size of pointer (B): " << number(ptr_bit_set[1]) << endl; kcout << "Size of pointer (KIB): " << number(KIB(ptr_bit_set[1])) << endl; kcout << "Size of pointer (MIB): " << number(MIB(ptr_bit_set[1])) << endl; kcout << "Size of pointer (GIB): " << number(GIB(ptr_bit_set[1])) << endl; diff --git a/dev/ZKA/HALKit/AMD64/HalProcessor.cxx b/dev/ZKA/HALKit/AMD64/HalProcessor.cxx index b80e7618..fa634406 100644 --- a/dev/ZKA/HALKit/AMD64/HalProcessor.cxx +++ b/dev/ZKA/HALKit/AMD64/HalProcessor.cxx @@ -30,9 +30,10 @@ namespace Kernel::HAL // Now PD volatile UInt64* pd_entry = (volatile UInt64*)(((UInt64)pml4_base) + pd_idx * sizeof(UIntPtr)); - kcout << (*pd_entry & 0x01 ? "PageDir present." : "PageDir not present") << endl; + kcout << (*pd_entry & 0x01 ? "Dir Present." : "Dir Not present.") << endl; - if ((*pd_entry & 0x01) == 0) + // Don't bother allocate directory. + if (!(*pd_entry & 0x01)) { ke_stop(RUNTIME_CHECK_PAGE); } @@ -42,8 +43,8 @@ namespace Kernel::HAL // And then PTE volatile UIntPtr* page_addr = (volatile UIntPtr*)(((UInt64)pt_base) + (pte_idx * sizeof(UIntPtr))); - kcout << (*page_addr & 0x01 ? "Page present." : "Page not present") << endl; - kcout << (*page_addr & 0x04 ? "User bit present." : "User bit not present") << endl; + kcout << (*page_addr & 0x01 ? "Page Present." : "Page Not Present.") << endl; + kcout << (*page_addr & 0x04 ? "User." : "Not User.") << endl; if (phys_addr == nullptr) { diff --git a/dev/ZKA/HALKit/AMD64/HalSchedulerCore.cxx b/dev/ZKA/HALKit/AMD64/HalSchedulerCore.cxx index 89982cbc..3cd07955 100644 --- a/dev/ZKA/HALKit/AMD64/HalSchedulerCore.cxx +++ b/dev/ZKA/HALKit/AMD64/HalSchedulerCore.cxx @@ -14,8 +14,6 @@ Void UserProcess::SetImageStart(VoidPtr imageStart) noexcept if (imageStart == nullptr) this->Crash(); - HAL::mm_map_page(imageStart, 0, HAL::eFlagsUser); - this->Image = imageStart; } diff --git a/dev/ZKA/Sources/ExeMain.cxx b/dev/ZKA/Sources/ExeMain.cxx index 5535e4dd..53865db7 100644 --- a/dev/ZKA/Sources/ExeMain.cxx +++ b/dev/ZKA/Sources/ExeMain.cxx @@ -159,11 +159,7 @@ EXTERN_C Kernel::Void ke_dll_entrypoint(Kernel::Void) Kernel::UserProcessHelper::StartScheduling(); - Kernel::UInt8* hang_proc = (Kernel::UInt8*)Kernel::mm_new_ke_heap(sizeof(Kernel::UInt8) * 512, Yes, Yes); - Kernel::rt_set_memory((Kernel::VoidPtr)HangCPU, 0x90, 512); - - - Kernel::sched_execute_thread((Kernel::MainKind)hang_proc, "HANG TEST"); + Kernel::sched_execute_thread((Kernel::MainKind)HangCPU, "HANG TEST"); while (Yes) { diff --git a/dev/ZKA/Sources/PEFCodeMgr.cxx b/dev/ZKA/Sources/PEFCodeMgr.cxx index b6f7e3da..c635dd69 100644 --- a/dev/ZKA/Sources/PEFCodeMgr.cxx +++ b/dev/ZKA/Sources/PEFCodeMgr.cxx @@ -165,14 +165,9 @@ namespace Kernel Char* blobRet = new Char[container_header->Size]; - if (container_header->Kind != kPefCode) - HAL::mm_map_page(blobRet, 0, HAL::eFlagsRw | HAL::eFlagsUser); - else - HAL::mm_map_page(blobRet, 0, HAL::eFlagsUser); - rt_copy_memory((VoidPtr)((Char*)blob + sizeof(PEFCommandHeader)), blobRet, container_header->Size); - mm_delete_ke_heap(blob); + return blobRet; } } |
