Skip to content

Commit

Permalink
virtualbox: impl read_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenzel committed Apr 29, 2021
1 parent 49a0b0a commit 88b48f4
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/driver/virtualbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ use std::error::Error;

use fdp::{RegisterType, FDP};

use crate::api::{
DriverInitParam, DriverType, Introspectable, Registers, SegmentReg, SystemTableReg,
X86Registers,
};
use crate::api::{DriverInitParam, DriverType, Introspectable, Registers, SegmentReg, SystemTableReg, X86Registers, PageFrame};

// unit struct
#[derive(Debug)]
Expand All @@ -30,15 +27,8 @@ impl Introspectable for VBox {
Ok(1)
}

fn read_physical(
&self,
paddr: u64,
buf: &mut [u8],
bytes_read: &mut u64,
) -> Result<(), Box<dyn Error>> {
self.fdp.read_physical_memory(paddr, buf)?;
*bytes_read = buf.len() as u64;
Ok(())
fn read_frame(&self, frame: PageFrame, buf: &mut [u8]) -> Result<(), IoError> {
self.fdp.read_physical_memory(frame.to_paddr(), buf)
}

fn get_max_physical_addr(&self) -> Result<u64, Box<dyn Error>> {
Expand Down

0 comments on commit 88b48f4

Please sign in to comment.