Unverified Commit 849ce0b9 authored by Jeremy Soller's avatar Jeremy Soller Committed by GitHub
Browse files

Merge pull request #29 from ids1024/atapi_capacity

ahcid: fix atapi capacity detection
parents a081f9e2 d893a73e
......@@ -63,7 +63,8 @@ impl DiskATAPI {
self.port.packet(&cmd, 8, &mut self.clb, &mut self.ctbas, &mut self.buf)?;
let blk_count = BigEndian::read_u32(&self.buf[0..4]);
// Instead of a count, contains number of last LBA, so add 1
let blk_count = BigEndian::read_u32(&self.buf[0..4]) + 1;
let blk_size = BigEndian::read_u32(&self.buf[4..8]);
Ok((blk_count, blk_size))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment