Add support for Hermit Image decompression#511
Draft
fogti wants to merge 1 commit intohermit-os:mainfrom
Draft
Conversation
da963be to
b87905f
Compare
fogti
commented
Nov 24, 2025
c03df71 to
3dcc652
Compare
fogti
commented
Nov 27, 2025
src/os/none/allocator/oneshot.rs
Outdated
| /// A simple, `!Sync` implementation of a one-shot allocator. | ||
| /// | ||
| /// This allocator manages the provided memory. | ||
| pub struct OneshotAllocator { |
Contributor
Author
There was a problem hiding this comment.
TODO: this might have to interact with the paging subsystem.
fogti
commented
Nov 27, 2025
src/os/mod.rs
Outdated
| } | ||
| } | ||
|
|
||
| //#[cfg(any(target_os = "none", feature = "fc"))] |
Contributor
Author
There was a problem hiding this comment.
The boot_kernel functions appear to not be limited by cfg conditionals, so this is also unconditional, for now.
0d9d117 to
18130d0
Compare
fogti
commented
Nov 27, 2025
src/os/none/allocator/oneshot.rs
Outdated
|
|
||
| unsafe impl Allocator for OneshotAllocator { | ||
| fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> { | ||
| assert!(layout.align() <= 8); |
Contributor
Author
There was a problem hiding this comment.
This is done because we can't change the alignment during reallocation/ growth.
fogti
commented
Nov 28, 2025
31f545b to
38cac76
Compare
ba5a841 to
ac15df4
Compare
Contributor
Author
|
Obvious mistakes — found via |
Contributor
Author
|
TODO: fix non-UEFI version (currently, it should always panic) and test UEFI versoin (which should pretty much work as-is) using hermit-os/kernel#2077 as the kernel (using |
5dce468 to
da91104
Compare
a8f52c0 to
f16f95b
Compare
4ebdbe2 to
e591ea2
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends upon hermit-os/hermit-entry#61.
TODO:
chosen,image_reg: [u64;2] = (offset, length))boot_kernelforos=none(e.g.multiboot,firecracker, etc.) needs to gain an argument to pass an optional image range along. It might be a good idea to introduce a structure for "FDT parameters" to make further extensions easier in the future.