-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrollable framebuffer logs #364
Comments
we probably need to dynamically allocate the text ring buffer because we don't know how many characters long the frame buffer will be at compile-time, unless we want to figure out line wrapping when drawing the text instead of when generating it. the other option is to just have a ring buffer of characters, rather than of lines, but since the goal is to scroll the logs, a ring buffer of lines seems nicer... |
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?
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?
now that we can handle keyboard input (see #358 and #363), it would be cool to make the text that mycelium logs to the framebuffer be scrollable with the up and down arrow keys (and Page Up / Page Down as well).
this would actually be a kind of big and annoying change, since we currently log by writing pixels directly to the framebuffer, and once we've written them, we throw away the text that we formatted the log line to. this is good, since it means logging is very lightweight and we can start logging stuff really early in the boot process, and inside the allocator...but it's also bad, because once text has scrolled off the top of the framebuffer, it's Gone Forever.
we probably want to change this so that we can log stuff to a text buffer, and print that to the framebuffer.
as i see it, we have two options here:
The text was updated successfully, but these errors were encountered: