Skip to content

Lab 07

Compare
Choose a tag to compare
@JingWangTW JingWangTW released this 24 Jun 13:08

NCTU OSDI Lab 7: Virtual File System

Documentation: Lab 7

Lab 7 Demo Release

Required

  • Required 1
    • Set up tmpfs as the root file system.
  • Requried 2
    • implement struct file* vfs_open(const char *pathname, int flags)
    • implement int vfs_close(struct file* file)
  • Required 3
    • Implement int vfs_write(struct file* file, const void* buf, size_t len)
    • Implement int vfs_read(struct file* file, void* buf, size_t len)

Elective

  • Elective 1
    • Implement an API for users to get the directory entries information from a directory.
  • Elective 2
    • Implement file descriptor table for tasks.
    • Implement VFS system calls.
  • Elective 3
    • Implement a VFS interface and a tmpfs method for int mkdir(const char* pathname).
    • Implement int chdir(const char* pathname)
    • Implement VFS interfaces and tmpfs methods for int mount(const char* device, const char* mountpoint, const char* filesystem) and int umount(const char* mountpoint).
      Implement pathname lookup.
  • Elective 4
    • The procfs creates switch and hello file in its root directory. Users can access them by open, read, and write.
    • The procfs lazily updates the task-related directory and file. Users can read task’s status by reading <task id>/status
  • Elective 5
    • Implement initramfs to populate the root file system.

Questions

  • Is it possible that a file exists in a file system, but there is no vnode object of it?
  • Is EOF pass to the reader by a special character in the reader’s buffer?
  • Should each task owns its current working directory and the root directory?