Struct android_bootimage::MagicHeader
[−]
[src]
pub struct MagicHeader { pub magic: [u8; 8], pub kernel_size: u32, pub kernel_load_address: u32, pub ramdisk_size: u32, pub ramdisk_load_address: u32, pub second_size: u32, pub second_load_address: u32, pub device_tree_size: u32, pub kernel_tags_address: u32, pub page_size: u32, pub product_name: [u8; 24], pub boot_arguments: [[u8; 32]; 16], pub unique_id: [u8; 32], // some fields omitted }
Contains a magic header.
Fields
magic: [u8; 8]
Header magic. Used to make sure this is in fact a header.
kernel_size: u32
Ramdisk size, in bytes.
kernel_load_address: u32
Address the ramdisk should be loaded to.
ramdisk_size: u32
Ramdisk size, in bytes.
ramdisk_load_address: u32
Address the ramdisk should be loaded to.
second_size: u32
Size of an optional second file.
second_load_address: u32
Address the optional second file should be loaded to.
device_tree_size: u32
The size of the device tree, in bytes.
Physical address of the kernel tags.
page_size: u32
The page size.
product_name: [u8; 24]
Name of the product. This is a null-terminated ASCII string.
boot_arguments: [[u8; 32]; 16]
Arguments to pass to the kernel during boot. This is a nested array, as rust does not allow us to have arrays larger than 32 in size.
unique_id: [u8; 32]
Used to uniquely identify boot images.
Methods
impl MagicHeader
[src]
fn read_from<R: ReadBytesExt>(
source: &mut R,
check_magic: bool
) -> Result<Self, MagicHeaderParseError>
source: &mut R,
check_magic: bool
) -> Result<Self, MagicHeaderParseError>
Reads a magic header from the supplied source.
fn section_size(&self, section: Section) -> u64
Returns the size of a section, in bytes.
fn section_start(&self, section: Section) -> Result<u64, LocateSectionError>
Returns the start location of a section, in bytes.
Do note that this function can fail because it cannot find a section other than the one that was requested. Sections depend on the other sections for their locations.
fn section_location(
&self,
section: Section
) -> Result<(u64, u64), LocateSectionError>
&self,
section: Section
) -> Result<(u64, u64), LocateSectionError>
Returns the start and the end location of a section, in bytes.
Do note that this function can fail because it cannot find a section other than the one that was requested. Sections depend on the other sections for their locations.
fn read_section_from<R: Read + Seek>(
&self,
source: &mut R,
section: Section
) -> Result<Vec<u8>, ReadSectionError>
&self,
source: &mut R,
section: Section
) -> Result<Vec<u8>, ReadSectionError>
Reads a section from the given readable resource.
Do note that this function can fail because it cannot find a section other than the one that was requested. Sections depend on the other sections for their locations.
fn sections(&self) -> Vec<Section>
Returns the sections in this boot image, in order. Zero-size sections are omitted.