diff --git a/memide.c b/memide.c index 2e09e33..91b7f92 100644 --- a/memide.c +++ b/memide.c @@ -9,6 +9,7 @@ #include "x86.h" #include "traps.h" #include "spinlock.h" +#include "fs.h" #include "buf.h" extern uchar _binary_fs_img_start[], _binary_fs_img_size[]; @@ -44,10 +45,10 @@ iderw(struct buf *b) panic("iderw: nothing to do"); if(b->dev != 1) panic("iderw: request not for disk 1"); - if(b->block >= disksize) + if(b->blockno >= disksize) panic("iderw: block out of range"); - p = memdisk + b->block*BSIZE; + p = memdisk + b->blockno*BSIZE; if(b->flags & B_DIRTY){ b->flags &= ~B_DIRTY;