Skip to content

Commit

Permalink
task 6 still buggy
Browse files Browse the repository at this point in the history
  • Loading branch information
mocraimer committed Jun 22, 2016
1 parent 2aab60a commit 72dfd82
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct partition partitions[NPARTITIONS] = {{0, 0, 0, 0, 0},

int checkForBootPrograms(int index) {
// TODO implement
return boot_partition == -1 ? 0 : boot_partition;
return boot_partition == -1 ? index : boot_partition;
}

void
Expand Down
6 changes: 4 additions & 2 deletions ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ idestart(struct buf *b)
if(b == 0)
panic("idestart");

if(b->blockno >= FSSIZE * NPARTITIONS + 500)
panic("incorrect blockno");
if(b->blockno >= FSSIZE * NPARTITIONS + 500){
cprintf("b->blockno:%d \n",b->blockno);
panic("incorrect blockno");
}
int sector_per_block = BSIZE/SECTOR_SIZE;
int sector = b->blockno * sector_per_block;

Expand Down
2 changes: 1 addition & 1 deletion param.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define NFILE 100 // open files per system
#define NINODE 50 // maximum number of active i-nodes
#define NDEV 10 // maximum major device number
#define ROOTDEV 0 // device number of file system root disk
#define ROOTDEV 1 // device number of file system root disk
#define MAXARG 32 // max exec arguments
#define MAXOPBLOCKS 10 // max # of blocks any FS op writes
#define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log
Expand Down

0 comments on commit 72dfd82

Please sign in to comment.