Currently the memory allocation works by just giving out memory in increasing order. This works with most of the NXDK samples because they simply make a few allocations at startup and never free, but this would fail spectacularly if any title tried to actually free/alloc. Thus, a proper memory allocator is needed.
[x] Support tracking of physical memory
[x] Support allocation of contiguous and non-contiguous chunks of physical memory
[x] Support mapping physical memory into the virtual address space
Implement associated functions:
[ ] MmAllocateContiguousMemory
[x] MmAllocateContiguousMemoryEx (Partial)
[ ] MmAllocateSystemMemory
[ ] MmClaimGpuInstanceMemory
[ ] MmCreateKernelStack
[ ] MmDeleteKernelStack
[ ] MmFreeContiguousMemory
[ ] MmFreeSystemMemory
[ ] MmGetPhysicalAddress
[ ] MmIsAddressValid
[ ] MmLockUnlockBufferPages
[ ] MmLockUnlockPhysicalPage
[ ] MmMapIoSpace
[ ] MmPersistContiguousMemory
[ ] MmQueryAddressProtect
[ ] MmQueryAllocationSize
[ ] MmQueryStatistics
[ ] MmSetAddressProtect
[ ] MmUnmapIoSpace
[x] NtAllocateVirtualMemory (Partial)
[ ] NtFreeVirtualMemory
It may be possible to leverage parts of the Linux kernel to implement this. Recommend an earlier kernel version for simplicity.
Currently the memory allocation works by just giving out memory in increasing order. This works with most of the NXDK samples because they simply make a few allocations at startup and never free, but this would fail spectacularly if any title tried to actually free/alloc. Thus, a proper memory allocator is needed.
Implement associated functions:
It may be possible to leverage parts of the Linux kernel to implement this. Recommend an earlier kernel version for simplicity.