pagetable lab initialized
This commit is contained in:
@ -20,7 +20,7 @@
|
||||
// Disk layout:
|
||||
// [ boot block | sb block | log | inode blocks | free bit map | data blocks ]
|
||||
|
||||
int nbitmap = FSSIZE/(BSIZE*8) + 1;
|
||||
int nbitmap = FSSIZE/BPB + 1;
|
||||
int ninodeblocks = NINODES / IPB + 1;
|
||||
int nlog = LOGSIZE;
|
||||
int nmeta; // Number of meta blocks (boot, sb, nlog, inode, bitmap)
|
||||
@ -147,6 +147,8 @@ main(int argc, char *argv[])
|
||||
if(shortname[0] == '_')
|
||||
shortname += 1;
|
||||
|
||||
assert(strlen(shortname) <= DIRSIZ);
|
||||
|
||||
inum = ialloc(T_FILE);
|
||||
|
||||
bzero(&de, sizeof(de));
|
||||
@ -238,7 +240,7 @@ balloc(int used)
|
||||
int i;
|
||||
|
||||
printf("balloc: first %d blocks have been allocated\n", used);
|
||||
assert(used < BSIZE*8);
|
||||
assert(used < BPB);
|
||||
bzero(buf, BSIZE);
|
||||
for(i = 0; i < used; i++){
|
||||
buf[i/8] = buf[i/8] | (0x1 << (i%8));
|
||||
|
||||
Reference in New Issue
Block a user