Commit Graph
100 Commits
Author SHA1 Message Date
harraiken bc85eb3c12 Add missing annotations 2026-03-25 15:03:33 +01:00
harraiken 52c119885c Standardize ValidPte setup across architectures 2026-03-25 15:03:33 +01:00
harraiken efe7f28675 Correctly initialize PFN entries for pre-mapped KSEG0 based memory 2026-03-25 15:03:33 +01:00
harraiken c29afe477c Annotate input parameters 2026-03-25 15:03:33 +01:00
harraiken ae43f7c723 Drop obsolete KSEG0_KERNEL_BASE definition 2026-03-25 15:03:33 +01:00
harraiken c8792a013a Abstract base mapping address retrieval 2026-03-25 15:03:33 +01:00
harraiken edfae7ec6a Extract MapDescriptor logic and simplify memory mapping API 2026-03-25 15:03:33 +01:00
harraiken 31002b27be Clean up unused physical-to-virtual conversion routines 2026-03-25 15:03:33 +01:00
harraiken 44a217ea14 Update function documentation and remove debug prints 2026-03-25 15:03:33 +01:00
harraiken 4a26507228 Remove manual virtual address tracking from boot sequence 2026-03-25 15:03:33 +01:00
harraiken 33d41a9442 Relocate kernel and modules to KSEG0 memory space 2026-03-25 15:03:33 +01:00
harraiken d2374799eb Temporary fix for PAE addressing limits and KSEG0 base mapping 2026-03-25 15:03:33 +01:00
harraiken 0ee46924a7 Prevent adding referenced pages to the free list 2026-03-25 15:03:33 +01:00
harraiken 3384556543 Correctly setup PFN database for ROM and in-use pages 2026-03-25 15:03:33 +01:00
harraiken 3b8359042b Ensure every page in a bad memory region is marked as bad 2026-03-25 15:03:33 +01:00
harraiken c8fa998e38 Make memory descriptor processing architecture-dependent 2026-03-25 15:03:33 +01:00
harraiken 807b0a736f Add logic to insert pages at the head of standby list 2026-03-25 15:03:33 +01:00
harraiken cb61566e8b Add temporary fallback for BeginStandbyList insertion 2026-03-25 15:03:33 +01:00
harraiken 41eed4c7ad Allow PFN insertion at the beginning of standby list 2026-03-25 15:03:33 +01:00
harraiken 042d0fa03a Optimize system PTE deallocation by avoiding immediate and expensive TLB flush 2026-03-25 15:03:33 +01:00
harraiken 6accbfd2ae Replace ULONG with PFN_COUNT in system PTE variables 2026-03-25 15:03:33 +01:00
harraiken ec27cb7f76 Fix deadlock by reducing lock scope 2026-03-25 15:03:33 +01:00
harraiken bfa5cddb57 Add missing semicolon 2026-03-25 15:03:33 +01:00
harraiken f8cdcc3f75 Implement kernel stack deallocation and physical page freeing logic 2026-03-25 15:03:33 +01:00
harraiken 602e837e11 Add mechanism to free system PTEs and merge adjacent clusters 2026-03-25 15:03:33 +01:00
harraiken 0ca04a7dfe Clean up paging code 2026-03-25 15:03:33 +01:00
harraiken 3270f920dd Remove dead code from paging and PTE management 2026-03-25 15:03:33 +01:00
harraiken 4f6e8bc07a Initialize system PTEs with arch-specific list terminator 2026-03-25 15:03:33 +01:00
harraiken 4aa841650a Abstract PTE list terminator into paging layer 2026-03-25 15:03:33 +01:00
harraiken c5ea9e4489 Add support for transitioning PTE to invalid state 2026-03-25 15:03:33 +01:00
harraiken c6041b02ae Add explicit default initialization for MM::Colors::ModifiedPages list 2026-03-25 15:03:33 +01:00
harraiken 0153b2fb33 Properly handle bad physical pages 2026-03-25 15:03:33 +01:00
harraiken e0bcac3722 Implement generic PFN list linking function 2026-03-25 15:03:33 +01:00
harraiken 466b0c8eab Introduce helper functions for querying the software prototype and transition bits of PTE 2026-03-25 15:03:33 +01:00
harraiken 374f404324 Introduce per-page-color modified page lists 2026-03-25 15:03:33 +01:00
harraiken 6308fd048b Remove redundant check for invisible memory regions 2026-03-25 15:03:33 +01:00
harraiken 4963ff5367 Initialize PTE template dynamically to resolve build warnings 2026-03-25 15:03:33 +01:00
harraiken e0e3482326 Prevent initialization of invisible memory ranges 2026-03-25 15:03:33 +01:00
harraiken 896803e248 Improve formatting 2026-03-25 15:03:33 +01:00
harraiken b5ebd24f24 Adjust thread initialization to match new stack allocator signature 2026-03-25 15:03:33 +01:00
harraiken e1144da195 Simplify stack page count calculation 2026-03-25 15:03:33 +01:00
harraiken 0c9ea2ed20 Implement kernel stack allocation logic 2026-03-25 15:03:33 +01:00
harraiken 43d0e8932d Implement logic to link physical pages to PTEs 2026-03-25 15:03:33 +01:00
harraiken d88fa93df9 Introduce page fault handling infrastructure 2026-03-25 15:03:33 +01:00
harraiken 9cfc22e1f3 Reserve space for color tables to fix invalid memory access 2026-03-25 15:03:33 +01:00
harraiken d9a95527f3 Ensure page map structures are self-mapped 2026-03-25 15:03:33 +01:00
harraiken 47606faded Initialize paged pool sizing logic 2026-03-25 15:03:33 +01:00
harraiken b6c5bae289 Minor style fixes in MM includes 2026-03-25 15:03:33 +01:00
harraiken 330c9e3eaf Update PTE support to use safe write accessors 2026-03-25 15:03:33 +01:00
harraiken 2854f77159 Refactor memory clearing calls and cleanup code style 2026-03-25 15:03:33 +01:00
harraiken 75dfcec5a6 Implement PFN database initialization and memory descriptor processing 2026-03-25 15:03:33 +01:00
harraiken f33fa0fdaf Expose PFN database lookup via GetPfnEntry 2026-03-25 15:03:33 +01:00
harraiken cdad8ffe2c Implement tracking of available physical pages 2026-03-25 15:03:33 +01:00
harraiken 425780de69 Initialize system PTE pools and implement reservation routines 2026-03-25 15:03:33 +01:00
harraiken 446d9af325 Initialize system page tables and configure kernel mappings 2026-03-25 15:03:33 +01:00
harraiken 536d59c3a8 Include mm/colors.cc in kernel build configuration 2026-03-25 15:03:33 +01:00
harraiken 4192e93157 Introduce page coloring support to memory manager 2026-03-25 15:03:33 +01:00
harraiken b32c66110b Add storage for PFN database size 2026-03-25 15:03:33 +01:00
harraiken cdb3c1a8da Initialize memory manager during kernel startup 2026-03-25 15:03:33 +01:00
harraiken 5e54aca398 Update modified page list enum terminology 2026-03-25 15:03:33 +01:00
harraiken 68604e1bc0 Update memory manager type definitions and constants 2026-03-25 15:03:33 +01:00
harraiken a4b36827e4 Bring up i686 page table initialization 2026-03-25 15:03:33 +01:00
harraiken e8512e9f45 Fix physical page count overflow by using 64-bit type 2026-03-25 15:03:33 +01:00
harraiken 0448217c06 Fix PTE free list sentinel handling 2026-03-25 15:03:33 +01:00
harraiken f9b27b48b0 Select correct self-map base for PAE and non-PAE paging 2026-03-25 15:03:33 +01:00
harraiken eb621e0264 Extend PTE helpers with raw read and write support 2026-03-25 15:03:33 +01:00
harraiken ed769e023f Respect architecture-specific PTE layouts and write PTEs via PML-aware helpers 2026-03-25 15:03:33 +01:00
harraiken 08b095d47c Make PPE mapping architecture-specific 2026-03-25 15:03:33 +01:00
harraiken 87aa3494f9 Add early spin lock initialization 2026-03-25 15:03:33 +01:00
harraiken 244af13500 Clarify page table entry offset semantics 2026-03-25 15:03:33 +01:00
harraiken e6d2574bf9 Fix paging abstraction for PDE/PTE virtual address calculation 2026-03-25 15:03:33 +01:00
harraiken 6f9e537e86 Implement initial virtual memory layout setup 2026-03-25 15:03:33 +01:00
harraiken be6ad1658f Update SelfMapAddress 2026-03-25 15:03:33 +01:00
harraiken a45cd95b6f Call page table initialization 2026-03-25 15:03:33 +01:00
harraiken 3c5bb52152 Add virtual address validation and system PTE helpers 2026-03-25 15:03:33 +01:00
harraiken 3a311a0497 Move memory layout initialization to architecture-specific code 2026-03-25 15:03:33 +01:00
harraiken 140b25ff76 Architecture-specific system PTE limits 2026-03-25 15:03:33 +01:00
harraiken c760016ee5 Extend memory layout 2026-03-25 15:03:33 +01:00
harraiken 6a55b1a42c Remove unsupported PML4/PML5 PTE interfaces 2026-03-25 15:03:33 +01:00
harraiken d8b2af8f1e Split PTE implementation per architecture 2026-03-25 15:03:33 +01:00
harraiken 28fc0ab435 Compute PTE count per page from entry size 2026-03-25 15:03:33 +01:00
harraiken 329c22ae82 Implement early page table mapping routines 2026-03-25 15:03:33 +01:00
harraiken d27954091a Add bootstrap physical page allocator 2026-03-25 15:03:33 +01:00
harraiken df9028d425 Introduce kernel virtual memory layout 2026-03-25 15:03:33 +01:00
harraiken 540c4df13e Compute PFN database size during MM initialization 2026-03-25 15:03:33 +01:00
harraiken 0a2fb7ae38 Tidy up memory type verification helpers 2026-03-25 15:03:33 +01:00
harraiken 6f824c55bb Harden PFN initialization and expose page count 2026-03-25 15:03:33 +01:00
harraiken f371b305ad Make memory type verification helpers accessible to PFN 2026-03-25 15:03:33 +01:00
harraiken 24e20f3d8f Extract PFN management into separate module 2026-03-25 15:03:33 +01:00
harraiken c7bfc028b6 Refactor memory manager initialization into MM::Manager 2026-03-25 15:03:33 +01:00
harraiken 9492ba09a6 Fix GetP5eAddress return type 2026-03-25 15:03:33 +01:00
harraiken 4e7ab3585e Add missing virtual GetPteDistance to pagemap interface 2026-03-25 15:03:33 +01:00
harraiken 9d27778e4c Add architecture-specific GetPteDistance 2026-03-25 15:03:33 +01:00
harraiken 0796164cf8 Refactor XPA detection API 2026-03-25 15:03:33 +01:00
harraiken 2f4d26b432 Fix incorrect pointer types 2026-03-25 15:03:33 +01:00
harraiken 48fafd4a9a Fix incorrect pointer types 2026-03-25 15:03:33 +01:00
harraiken 1996024e96 Split paging interface into arch-specific code 2026-03-25 15:03:33 +01:00
harraiken 42a96ae5c3 Implement virtual address resolvers for all page map levels and add XPA status accessor 2026-03-25 15:03:33 +01:00
harraiken f9a057db2d Add MM::PageMap::GetXpaStatus() for querying PML level 2026-03-25 15:03:33 +01:00
harraiken f210c9e334 Refactor PageMap to enable architecture-specific VA translation 2026-03-25 15:03:33 +01:00