mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 13:11:31 +00:00
implement elf loader
This commit is contained in:
10
xenclient/examples/boot.rs
Normal file
10
xenclient/examples/boot.rs
Normal file
@ -0,0 +1,10 @@
|
||||
use std::alloc::Layout;
|
||||
use xenclient::boot::ElfLoader;
|
||||
use xenclient::XenClientError;
|
||||
|
||||
fn main() -> Result<(), XenClientError> {
|
||||
let boot = ElfLoader::load_file_kernel("/boot/vmlinuz-6.1.0-17-amd64")?;
|
||||
let ptr = unsafe { std::alloc::alloc(Layout::from_size_align(128 * 1024 * 1024, 16).unwrap()) };
|
||||
boot.load(ptr)?;
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user