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 59a7ad4
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/driver/virtualbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::error::Error;
use fdp::{RegisterType, FDP};

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

Expand All @@ -30,15 +30,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 59a7ad4

Please sign in to comment.