implement elf loader

This commit is contained in:
Alex Zenla committed 2024-01-09 22:42:49 -08:00
1 parent 35f3346858
commit 19b797f1a2
11 files changed
+383 -25

No files matched your search

+10
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(())
}
+1 -1
View File
@@ -11,6 +11,6 @@ fn main() -> Result<(), XenClientError> {
None,
None,
));
client.create(2, config)?;
client.create(config)?;
Ok(())
}