Hi all!
I am experiencing an issue that I believe may be related to faulty memory allocation. I have implemented a small driver that should allow my code to write to arbitrary positions on the Framebuffer. However, this seems to have uncovered an interesting bug that I cannot seem to track down.
Allocating memory seems to be corrupting the framebuffer memory - which I assume is due to liballoc allocating memory to the same address space as the Framebuffer itself. To try and resolve this, I implemented a check in my frame allocator to prevent it from allocating pages that (should) contain the framebuffer. However, this problem has not stopped.
Additionally, I appear to somehow be allocating memory that either cannot be written to, or gets overwritten almost instantly after (I can't really work out which), which is causing corruption in the memory buffer I have been writing to. (See below).
Does anyone have any idea what might be going on here?
(Github)
Memory & Framebuffer Corruption Bug
-
torii
- Posts: 18
- Joined: Sun Feb 02, 2025 5:59 pm
- GitHub: https://github.com/Toriiiiiiiiii
- Contact:
Re: Memory & Framebuffer Corruption Bug
As far as I can tell, your allocator never actually reads in the memory map. It just starts allocating from end_kernel and goes forward from there. That is not a good thing. You should be telling the allocator to only use that memory which the memory map lists as usable RAM, and then subtract from that set the memory your kernel was loaded to.
Carpe diem!

