COSC 519 FINAL PROJECT Dr' Ramesh Karne - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

COSC 519 FINAL PROJECT Dr' Ramesh Karne

Description:

Space and new file must be under the directory. ... Most common schemes for Directory structure. ... Max 8 directories can be created. ... – PowerPoint PPT presentation

Number of Views:75
Avg rating:3.0/5.0
Slides: 24
Provided by: scie3
Category:

less

Transcript and Presenter's Notes

Title: COSC 519 FINAL PROJECT Dr' Ramesh Karne


1
COSC 519 FINAL PROJECT Dr. Ramesh
Karne
  • FILE SYSTEM SIMULATION
  • GROUP NO. 4
  • Darshan Vaishnav
  • Robert Williams
  • Roxanne Beaton
  • Ruqing Wang

2
What is file?
  • File logical block defined by the operating
    system to store the info.
  • Attributes
  • Name defined by the user, human readable.
  • Size size of it, max size.
  • Type type such as exe, txt, data etc.
  • Location the pointer that refers to the exact
    location.
  • Protection info about the read, write, exe and
    access.
  • Time, date info about creation, last modified
    and also last used.

3
File operations
  • Create 2 steps. Space and new file must be under
    the directory.
  • Write the name, path and the info to be written.
    System must keep the write pointer at location
    where the next write takes place.
  • Read the name, path. The system must keep the
    read pointer at the location where the next read
    takes place.
  • Repositioning within the file known as seek.
    Keep the current position and the reposition
    according to the change.
  • Delete the name, path must be given and the
    space should be made free for future purpose,
    erase the directory entry.
  • Truncating the file same attributes, change in
    the content. Without delete, recreate truncate
    the file according to the change.

4
File access
  • Two methods
  • Sequential access info must be accessed as it
    stored. System maintains the pointer the location
    of the next access.
  • Direct access any logical location in the file
    may be accessed at any time. Two ways
  • by specifying the exact location to be accessed
    as a parameter of read and write
  • by specifying the location in a seek operation
    to be called before the read write.

5
Protection
  • User needs to protect the info that is stored.
  • The access permitted or denied depends on many
    factors and several attributes can be controlled.
  • Read
  • Write
  • Execute
  • Delete
  • Change access

6
Directory structure
  • System may store huge info which need to
    organized in proper manner.
  • Two ways,
  • File system is broken into partitions. Low level
    structure.
  • Each partition contains info about the files
    within it.
  • The info is kept in the device directory or
    volume label, such as name, size, type etc.
  • Most common schemes for Directory structure.
  • Single-level all files are stored in the single
    directory.
  • Simple but naming problem.
  • Two-level each user has User File Directory.
  • No naming problem, but access permission required
    to work together.
  • Three-level also called tree structure.
  • Complex but very effective. Each user can male
    his/her own directory structure.
  • Deletion is a little question. Some system wont
    allow to delete if it has any content (DOS). Some
    will prompt to delete every content (UNIX).

7
Operations on directory
  • Search for the file need to search the directory
    structure for the file.
  • Create file new file needs to be added in the
    directory.
  • Delete delete the file if not needed.
  • List Directory list all directories and files.
  • Rename file file name is changed if user changes
    it or if any content is changed.
  • The position of the file also changed in the
    directory.
  • Traverse the file system it is useful to access
    every file in the directory structure.
  • We can save the contents and structure for the
    back up purpose regularly.

8
Windows hierarchical file system
9
Unix tree structure
10
Project description
  • In this project we have simulated the UNIX like
    file system and some of its features such as
  • mkdir
  • ls
  • symlink
  • bitmap
  • This program takes the input from the user and
    allocate the memory to mount the file system.
  • This will also show the memory usage as a bitmap.

11
-------------------------------------------------
-------- FILEMANAGEMENT SYSTEM COSC 519 FINAL
PROJECT ----------------------------------------
----------------- CMD 0 quit
CMD 1 mkfs
CMD 2 mount CMD 3
unmount CMD 4 mkdir
CMD 5 write
CMD 6 read CMD 7
ls CMD 8 symlink
CMD 9 live
CMD 10 part CMD 11
help
12
Commands
  • mkfs takes 5 arguments
  • ri root inode
  • is inode size
  • bs block size
  • fs file system size
  • ib number of blocks devoted to the inode
  • This command will allocate the memory defined by
    the user and within this space the file system
    will be mounted.

13
Commands
  • mount this command will actually copies the
    superblock in to the memory apart from the
    superblock.
  • unmount this command will unmount the file
    system and also frees the space which was
    consumed by the file system.

14
ddig-1.07 mkfs 2 8 64 128 15 Making File
System.... Superblock Info
Inode BMP Size 120 Block BMP
Size 112 Size in Bytes
49 Filesystem successfully
created. ddig-1.07 mount Mounting File
System....
15
Commands
  • mkdir this command is same as UNIX mkdir.
  • This will make a directory of name input by user.
    It will only take max. 8 character long name.
  • Max 8 directories can be created. We can create
    subdirectories also but it will depend upon the
    inode blocks given by the user.
  • It will also update the memory usage in the
    bitmap.

16
Commands
  • ls it will list all the directory and also
    files.
  • In our program the inode pointer keeps the track
    of the file listed.
  • This is one of the hard part of the file system
    because it has to keep track of the directories
    and files are created and also allocate the
    memory to that so we have to update the bitmap
    also.

17
ddig-1.07 mkdir dp ddig-1.07 mkdir
abcd ddig-1.07 ls dp abcd
ddig-1.07 mkdir /dp/a ddig-1.07 ls /dp
a ddig-1.07 mkdir darshanvpsla Error
Directory name "darshanvpsla" too long. 7 or
less character limit
18
Commands
  • write by this command we can write something in
    to the file.
  • If the file is not present, then it will create
    the file, and if the file is there it will
    overwrite it.
  • read this command will read the content of the
    specific file. If the file is empty then it will
    not show anything.

19
ddig-1.07 write darshan /dp/test ddig-1.07
read /dp/test darshan ddig-1.07 write
darshanvaishnav /dp/test1 ddig-1.07 read
/dp/test1 darshanvaishnav ddig-1.07
symlink /dp/test x ddig-1.07 read x
darshan ddig-1.07 symlink /dp/test1
y ddig-1.07 read y darshanvaishnav
20
Commands
  • symlink this command will create a link
    resemble the soft link of UNIX system.
  • If we say symlink x y and then Read y will show
    us the content of the x.
  • part this will show the superblock info as a
    bitmap and makes sure that nothing is written on
    the superblock.
  • live this is opposite of the part. It will show
    the usage of memory by the file system as a
    bitmap.

21
ddig-1.07 part Attempting to print
superblock.... ri 2 is 8
bs 64 fs 128 ib 15 Inode
Bitmap Table... Printing bitmap. 10111111 11111111
11111111 11111111 11111111 11111111 11111111 1111
1111 11111111 11111111 11111111 11111111 11111111
11111111 11111111 Block Bitmap Table... Printing
bitmap. 10111111 11111111 11111111 11111111 111111
11 11111111 11111111 11111111 11111111 11111111 11
111111 11111111 11111111 11111111
ddig-1.07 live Attempting to print
superblock.... ri 2 is 8
bs 64 fs 128 ib 15 Inode
Bitmap Table... Printing bitmap. 00000000 01111111
11111111 11111111 11111111 11111111 11111111 1111
1111 11111111 11111111 11111111 11111111 11111111
11111111 11111111 Block Bitmap Table... Printing
bitmap. 00000000 01111111 11111111 11111111 111111
11 11111111 11111111 11111111 11111111 11111111 11
111111 11111111 11111111 11111111
22
Commands
  • quit this will unmount the file system and also
    quit the program.
  • help this will list the main menu of the file
    system.

ddig-1.07 unmount Unmounting File
System.... ddig-1.07 quit Quitting FILE
system...
23
Conclusion
  • By doing this project we learned how the file
    system actually work inside the system and also
    learned that the file system and management is
    closely connected with the memory allocation and
    management.
  • Some holes
  • Delete
  • Check the overwrite
  • Rename
  • List files separately
Write a Comment
User Comments (0)
About PowerShow.com