Crate qemu_fw_cfg

source ·
Expand description

A Rust library for reading fw_cfg from QEMU.

Supported architectures

As of today, this crate only supported x86 and x86_64. However, it is possible to add support for other platforms, such as ARM.

Examples

use qemu_fw_cfg::FwCfg;

// Verify that we are inside QEMU.
if running_in_qemu() {
    // Create a new `FwCfg` instance.
    let fw_cfg = unsafe { FwCfg::new().unwrap() };
    // Retrieve information of a file.
    let file = fw_cfg.find_file("etc/igd-opregion").unwrap();
    // Read data from the file.
    let data = fw_cfg.read_file(&file);
}

Structs

  • A struct for accessing QEMU fw_cfg.
  • A struct that contains information of a fw_cfg file.

Enums