main.c: main is start ... init.c: mips_init() is called Physical memory: 65536K available, base = 65536K, extended = 0K to memory 80401000for struct page directory. to memory 80431000for struct Pages. pmap.c: mips vm init success pageout: @@@___0x7f3fe000___@@@ ins a page pageout: @@@___0x40d000___@@@ ins a page FS is running FS can do I/O pageout: @@@___0x7f3fe000___@@@ ins a page pageout: @@@___0x407000___@@@ ins a page superblock is good diskno:0 diskno:0 read_bitmap is good diskno:0 alloc_block is good file_open is good file_get_block is good file_flush is good file_truncate is good diskno:0 file rewrite is good serve_open 00000400 ffff000 0x2 open is good read is good father read is good && father_fd == 0 father_fd's offset == 41 [00000400] destroying 00000400 [00000400] free env 00000400 i am killed ... child read is good && child_fd == 0 child_fd's offset == 41 [00001402] destroying 00001402 [00001402] free env 00001402 i am killed ...
structFile *f_dir;// the pointer to the dir where this file is in, valid only in memory. 文件目录指针 char f_pad[FILE_STRUCT_SIZE - MAXNAMELEN - (3 + NDIRECT) * 4 - sizeof(void *)]; //填充块保证256字节对齐 } __attribute__((aligned(4), packed));
structFile *f_dir;// the pointer to the dir where this file is in, valid only in memory. char f_pad[FILE_STRUCT_SIZE - MAXNAMELEN - (3 + NDIRECT) * 4 - sizeof(void *)]; }