diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-27 16:47:12 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-27 16:47:12 +0200 |
| commit | 86a2d7327f84519f525d66a7745554b41dddeb93 (patch) | |
| tree | 427d3747e0d94441216b1df6276105007c1bbe35 /Private/HALKit | |
| parent | d7519f338b544624145997576d2800f9670aa699 (diff) | |
MHR-18: Improved virtual memory architecture.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit')
| -rw-r--r-- | Private/HALKit/64x0/HalVirtualMemory.cxx | 2 | ||||
| -rw-r--r-- | Private/HALKit/64x0/MBCI/.gitkeep | 0 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/HalControlRegister.s | 8 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/HalKernelMain.cxx | 2 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/HalPageAlloc.hpp | 2 |
5 files changed, 8 insertions, 6 deletions
diff --git a/Private/HALKit/64x0/HalVirtualMemory.cxx b/Private/HALKit/64x0/HalVirtualMemory.cxx index 2ae0f7ac..96202c00 100644 --- a/Private/HALKit/64x0/HalVirtualMemory.cxx +++ b/Private/HALKit/64x0/HalVirtualMemory.cxx @@ -10,5 +10,5 @@ using namespace NewOS; /// @brief Flush system TLB, looks like the POWER version, as it acts the same, no specific instruction for that. -/// @note The 88K MMU should be present in the die. +/// @note The 88K MMU should be present as well. EXTERN_C void hal_flush_tlb() { asm volatile("invltlb"); } diff --git a/Private/HALKit/64x0/MBCI/.gitkeep b/Private/HALKit/64x0/MBCI/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Private/HALKit/64x0/MBCI/.gitkeep diff --git a/Private/HALKit/AMD64/HalControlRegister.s b/Private/HALKit/AMD64/HalControlRegister.s index 74dda36c..2a649f04 100644 --- a/Private/HALKit/AMD64/HalControlRegister.s +++ b/Private/HALKit/AMD64/HalControlRegister.s @@ -11,10 +11,12 @@ .globl hal_read_cr0 .globl hal_flush_tlb -.section .text +.text hal_flush_tlb: - invlpg (%rcx) + call hal_read_cr3 + mov %rcx, %rax + call hal_write_cr3 ret hal_read_cr3: @@ -36,5 +38,3 @@ hal_write_cr3: hal_write_cr0: movq %cr0, %rdi ret - - diff --git a/Private/HALKit/AMD64/HalKernelMain.cxx b/Private/HALKit/AMD64/HalKernelMain.cxx index d6b4ab76..82b80d34 100644 --- a/Private/HALKit/AMD64/HalKernelMain.cxx +++ b/Private/HALKit/AMD64/HalKernelMain.cxx @@ -74,5 +74,7 @@ EXTERN_C void hal_init_platform( AppMain(); + hal_flush_tlb(); + NewOS::ke_stop(RUNTIME_CHECK_BOOTSTRAP); } diff --git a/Private/HALKit/AMD64/HalPageAlloc.hpp b/Private/HALKit/AMD64/HalPageAlloc.hpp index d23c6e96..553f136e 100644 --- a/Private/HALKit/AMD64/HalPageAlloc.hpp +++ b/Private/HALKit/AMD64/HalPageAlloc.hpp @@ -26,7 +26,7 @@ #define kPTESize (0x1000) #endif // !kPTESize -EXTERN_C void hal_flush_tlb(NewOS::UIntPtr pde); +EXTERN_C void hal_flush_tlb(); EXTERN_C void hal_write_cr3(NewOS::UIntPtr pde); EXTERN_C void hal_write_cr0(NewOS::UIntPtr bit); |
