-
fix bug in JOS file system - [康朴塔散思]
2009-08-30
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://damocles.blogbus.com/logs/45423624.html
After changing emulator to qemu, I find that the file flush in file system seems not work correctly. The data I wrote to disk lost after rebooting the machine. Finally I find that the dirty bit is not set in file_write because the address space of fs and user env is different. Copy the content of memory will only make the address of current env dirty. But the memory of fs is still clean. Add two lines after memmove in file_write
for (i = 0; i < n; i += BLKSIZE)
fsipc_dirty(fd->fd_file.id, offset + i);To send request to the file system server to mark the page dirty directly.
Another thing to mention is that, it seems that *blk=*blk has no effect for the dirty bit. I Just map the page using syscall to modify its perm. Also please remember in the sys_map_page, you needs to modify the condition of returning invalid parameter. Add PTE_D to the reasonable parameter to perm.
随机文章:
Use virtual machine manager to run JOS 2009-09-22Interrupt-driven IDE disk access 2009-08-20Snapshot and restore env 2009-04-04Implement system call with sysenter/sysexit 2009-03-24
收藏到:Del.icio.us







