-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kernel): put back bump pointer region (#367)
At one point in time, Mycelium contained a bump pointer allocator that could be used for very early allocations before a better heap allocator is initialized with information from the BIOS memory map. This was removed in #130, since it was possible to use the buddy-block allocator for all heap allocations. In order to add a scrollback capability to framebuffer logging (#364), though, we want to be able to allocate a dynamically sized scrollback buffer. This is because we don't know the actual size of the framebuffer at compile time, and need to determine how long the lines in the scrollback ring are based on the dimensions of the framebuffer. However, we want to preallocate the entire scrollback ring, since we want to be able to store logs from inside the allocator in the scrollback ring. Also, if the scrollback ring isn't allocated until after the heap is initialized, we won't include early log messages in the scrollback ring. Therefore, it would be nice to be able to allocate the scrollback ring before we initialize the heap. This PR puts back the bump pointer allocator so that it can be used for allocating the scrollback ring. We could potentially use it for other very early dynamic allocations as well, if we can guarantee that they will live for the entire lifetime of the kernel. We may want to emit a warning, or even panic, if we try to deallocate a bump-allocated address?
- Loading branch information
Showing
2 changed files
with
85 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters