Closed jdonszelmann closed 3 years ago
You already mentioned to me personally that you plan to change this to actual log(n), that is nice to have before merging.
I'm also wondering what happens when you write tot non-existing memory, it just doesn't work or does it actually page fault?
It's already log(n).
Writing to non existing memory is entirely legal and won't cause any data abort handlers. Only when virtual memory is enabled it will. The only way you can notice you write to non existent memory is by reading it again (which must always return 0 on arm) meaning that if you write something nonzero before and read back a zero you found the end.
There's also still a small bug I just found out where with a size of 1G it reports a size that's actually a few kilobytes less. Though this isn't that big of an issue (if it's always less it'll always work, just with a little less memory available) we should resolve it. For 512M it is spot on.
apparently the algorithm reporting a bit less is accurate. For some reason it's getting a bit less from qemu.
Maybe add a TODO somewhere indicating PMM doesn't use it and merge it for next years students?
This PR adds the ability for the kernel to scan the address space in
O(log(n))
time to find how much it has available. It does so inmemory.s
. It passes this size tovoid start()
instart.c
so it can be used.This system executes before jumping to the higher half kernel.
Todos: