Struct linux_loader::loader::bzimage::BzImage
source · pub struct BzImage;
Available on x86 or x86-64 only.
Expand description
Big zImage (bzImage) kernel image support.
Trait Implementations§
source§impl KernelLoader for BzImage
Available on crate feature bzimage
only.
impl KernelLoader for BzImage
Available on crate feature
bzimage
only.source§fn load<F, M: GuestMemory>(
guest_mem: &M,
kernel_offset: Option<GuestAddress>,
kernel_image: &mut F,
highmem_start_address: Option<GuestAddress>
) -> Result<KernelLoaderResult>where
F: ReadVolatile + Seek,
fn load<F, M: GuestMemory>(
guest_mem: &M,
kernel_offset: Option<GuestAddress>,
kernel_image: &mut F,
highmem_start_address: Option<GuestAddress>
) -> Result<KernelLoaderResult>where
F: ReadVolatile + Seek,
Loads a kernel from a bzImage to guest memory.
The kernel is loaded at code32_start
, the default load address stored in the bzImage
setup header.
§Arguments
guest_mem
:GuestMemory
to load the kernel in.kernel_offset
: Address in guest memory where the kernel is loaded.kernel_image
- Input bzImage image.highmem_start_address
: Address where high memory starts.
§Examples
let mem_size: usize = 0x1000000;
let himem_start = GuestAddress(0x0);
let kernel_addr = GuestAddress(0x200000);
let gm = GuestMemoryMmap::from_ranges(&[(GuestAddress(0x0), mem_size)]).unwrap();
let mut kernel_image = vec![];
kernel_image.extend_from_slice(include_bytes!("bzimage"));
bzimage::BzImage::load(
&gm,
Some(kernel_addr),
&mut Cursor::new(&kernel_image),
Some(himem_start),
)
.unwrap();
Auto Trait Implementations§
impl RefUnwindSafe for BzImage
impl Send for BzImage
impl Sync for BzImage
impl Unpin for BzImage
impl UnwindSafe for BzImage
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more