From 50df049fbbaab5a7d95590e29959518454aa3007 Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Fri, 13 Mar 2020 20:01:02 -0400 Subject: [PATCH] I messed up the header size, which is why writes failed --- risc_v/ch9/src/block.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/risc_v/ch9/src/block.rs b/risc_v/ch9/src/block.rs index 8cea182..47d6237 100755 --- a/risc_v/ch9/src/block.rs +++ b/risc_v/ch9/src/block.rs @@ -233,7 +233,7 @@ pub fn block_op(dev: usize, buffer: *mut u8, size: u32, offset: u64, write: bool let blk_request_size = size_of::(); let blk_request = kmalloc(blk_request_size) as *mut Request; let desc = Descriptor { addr: &(*blk_request).header as *const Header as u64, - len: blk_request_size as u32, + len: size_of::
() as u32, flags: virtio::VIRTIO_DESC_F_NEXT, next: 0, }; let head_idx = fill_next_descriptor(bdev, desc);