implement elf loader

This commit is contained in:
Alex Zenla
2024-01-09 22:39:32 -08:00
parent 35f3346858
commit 19b797f1a2
11 changed files with 383 additions and 25 deletions

View 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(())
}

View File

@ -11,6 +11,6 @@ fn main() -> Result<(), XenClientError> {
None,
None,
));
client.create(2, config)?;
client.create(config)?;
Ok(())
}