-
Notifications
You must be signed in to change notification settings - Fork 26
Add support for Hermit Image decompression #511
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
base: main
Are you sure you want to change the base?
Conversation
da963be to
b87905f
Compare
c03df71 to
3dcc652
Compare
| /// A simple, `!Sync` implementation of a one-shot allocator. | ||
| /// | ||
| /// This allocator manages the provided memory. | ||
| pub struct OneshotAllocator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: this might have to interact with the paging subsystem.
src/os/mod.rs
Outdated
| } | ||
| } | ||
|
|
||
| //#[cfg(any(target_os = "none", feature = "fc"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The boot_kernel functions appear to not be limited by cfg conditionals, so this is also unconditional, for now.
0d9d117 to
18130d0
Compare
|
|
||
| unsafe impl Allocator for OneshotAllocator { | ||
| fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> { | ||
| assert!(layout.align() <= 8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done because we can't change the alignment during reallocation/ growth.
31f545b to
38cac76
Compare
ba5a841 to
ac15df4
Compare
|
Obvious mistakes — found via |
|
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 |
7045b5e to
5dce468
Compare
Depends upon hermit-os/hermit-entry#61.
TODO:
usize::MAX / 2restriction)?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.