Project 5 Roadmap - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Project 5 Roadmap

Description:

Data storage Single Indirect. Data storage Double Indirect. 4KB data ... Works on an unopened file. Simply copy verbatim from GOSFS_Dir_Entry. SYS_FSTAT ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 14
Provided by: personal82
Category:

less

Transcript and Presenter's Notes

Title: Project 5 Roadmap


1
Project 5 Roadmap
2
Logical layout of the disk
3
Directory Entry
GOSFS_Dir_Entry
blockList10
size
filename128
acl10
data blocks
Directory
MAX_FILES_PER_DIR
Directory Block
4
Data storage Direct Mapping
Data storage Direct Mapping
GOSFS_Dir_Entry.blockList10
DISK
0
1
2
used
12KB file depicted
5
Data storage Single Indirect
Data storage Single Indirect
GOSFS_Dir_Entry.blockList10
DISK
0
0
1
2
3
4
.
5
6
7
single indirect block
8
9
0
0
1
2
3
4
.
.
40KB file depicted
.
1022
1023
6
Data storage Double Indirect
Data storage Double Indirect
GOSFS_Dir_Entry.blockList10
DISK
0
0
1
single indirect block
2
3
4
.
5
6
7
0
0
0
0
1
1
8
2
2
3
3
4
4
9
.
.
.
.
.
.
1022
1022
1023
1023
4136KB file depicted
single indirect block
double indirect block
7
Data storage - overview
  • 0,32KB use direct mapped blocks only
  • (32KB,4128KB use direct mapped blocks single
    indirect blocks
  • (4128KB,32MB use direct mapped blocks single
    indirect blocks double indirect blocks

8
Mount
  • SYS_MOUNT
  • Mount(char dev, char prefix, char fstype)
  • Make sure it works, so that we can test the rest
    of your project

9
Syscalls
  • SYS_OPEN
  • Open(char name, int mode)
  • Not allowed for directories
  • Create files when appropriate
  • SYS_OPENDIRECTORY
  • Open_Directory(char path)
  • Not allowed for files
  • SYS_CLOSE
  • Close(int fd)
  • SYS_DELETE
  • Delete(char path)
  • If directory and not empty, forbid !

10
Syscalls
  • SYS_READ
  • Read(int fd, char buffer, int length)
  • Not allowed for directories
  • Watch out return value !
  • SYS_WRITE
  • Write(int fd, char buffer, int length)
  • Not allowed for directories
  • Grow on write - allocate blocks on the fly if
    past end of file
  • Grow minimum needed a random seek to the
    middle of an empty file and a write result in
    only one allocated block
  • Synchronous
  • SYS_READ/SYS_WRITE increase the offset with
    bytes read/written

11
Syscalls
  • SYS_READENTRY
  • Read_Entry(int fd,VFS_Dir_Entry entry)
  • Read and return information about a single file
    in a directory
  • Advance one file entry at a time, return 1 when
    the directory ends
  • Seek specifies number of entries to skip (i.e.
    seek(5) would then read the 5th entry)
  • Not allowed for files

12
Syscalls
  • SYS_STAT
  • Stat(char path, VFS_File_Stat stat)
  • Works on an unopened file
  • Simply copy verbatim from GOSFS_Dir_Entry
  • SYS_FSTAT
  • FStat(int fd, VFS_File_Stat stat)
  • Works on an open file
  • Simply copy verbatim from GOSFS_Dir_Entry
  • SYS_SEEK
  • Seek(int fd, int offset)
  • Implement only absolute semantics for offset
  • Allowed to past end of file

13
Syscalls
  • SYS_CREATEDIR
  • Create_Directory(char name)
  • Should NOT go recursively
  • Create_Directory("/d/d1/d2/d3/d4)
  • SYS_SYNC
  • Sync(void)
  • Should synchronize any outstanding data to disk
  • SYS_FORMAT
  • Format(char dev, char fstype)
  • Original Disk Layout
  • Dont have to do it in init, will be called from
    user space
  • Only for GOSFS, not for PFAT
Write a Comment
User Comments (0)
About PowerShow.com