DOC PREVIEW
U of I CS 241 - System Programming File System I

This preview shows page 1-2-3-27-28-29 out of 29 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS241 System Programming File System (I)ContentAdministrative AnnouncementsWhy Files?File System RequirementsWhat Makes File-systems Hard?File System ComponentsFile ConceptsFile AttributesFile StructuresFile Structures TodayFile TypesSome DefinitionsKinds of MetadataContent of InodeInode Attributes (Unix Example)The UNIX V7 File System (UNIX i-node)Directories in UnixEffects of CorruptionData Structures for A Typical File SystemFile OperationsOpening A FileInformation in per-process file descriptor tableSystem-wide Open-file Table InformationRelation between fd, open file table and i-node table (UNIX Example)Reading And WritingReading A BlockFile Usage PatternsSummaryCS241 System ProgrammingFile System (I)Klara NahrstedtLecture 203/3/200601/14/19 CS 241, System Programming, Klara Nahrstedt2ContentAdministrative announcementsFile systems basic concepts–Concept of File–File System ComponentsSummary01/14/19 CS 241, System Programming, Klara Nahrstedt3Administrative AnnouncementsMidterm March 9, 2006 : 7-7:50pm Students with Last Name A-K will go to 1404 SCStudents with Last Name L-Z will go to 1320 DCLNo Discussion Sections during the week of March 6-10, 2006No Class on Wednesday, March 8, 2006Optional Midterm Material Review on Wednesday, March 8, 11-11:50am01/14/19 CS 241, System Programming, Klara Nahrstedt4Why Files?Physical reality–Block oriented–Physical sector #s–No protection among users of the system–Data might be corrupted if machine crashesFile system model–Byte oriented–Named files–Users protected from each other–Robust to machine failures01/14/19 CS 241, System Programming, Klara Nahrstedt5File System RequirementsUsers must be able to: –create, modify, and delete files at will. –read, write, and modify file contents with a minimum of fuss about blocking, buffering, etc. –share each other's files with proper authorization –transfer information between files. –refer to files by symbolic names. –retrieve backup copies of files lost through accident or malicious destruction. –see a logical view of their files without concern for how they are stored.01/14/19 CS 241, System Programming, Klara Nahrstedt6What Makes File-systems Hard?Files grow and shrink in piecesLittle a priori knowledge6 orders of magnitude in file sizesOvercoming disk performance behavior Desire for efficiencyCoping with failure01/14/19 CS 241, System Programming, Klara Nahrstedt7File System ComponentsDisk management–Arrange collection of disk blocks into filesNaming–User gives file name, not track or sector number, to locate dataSecurity–Keep information secureReliability/durability–When system crashes, lose stuff in memory, but want files to be durableUserFileNamingFileaccessDiskmanagementDiskdrivers01/14/19 CS 241, System Programming, Klara Nahrstedt8File Concepts Files Directory structures Partitions (possible) File Concept: OS abstracts from the physical properties of its storage device to define a logical storage unit, called file. Files are mapped by the OS onto physical devices.01/14/19 CS 241, System Programming, Klara Nahrstedt9File AttributesName: symbolic file name, the only information kept in human-readable form. Many OS support two part file names (name.extension) –File.bak (ackup file); file.pdf (pdf file); file jpg (still picture in JPEG format)–Some OS do not enforce extensions (e.g., UNIX), so do (e.g., Windows, MAC OS)Type: needed for systems that support different types. –Regular files - user information, regular files are generally either ASCII or binary files. –Directories - system files for maintaining the structure of the file system –Character special files - related to input/output and used to model serial I/O devices such as terminals, printers, and networks –Block special files - used to model disks Location: pointer to a device and to the location of the file on that device. Size: current size and maximal possible size Protection: Access-control information. Time, date, user identification: creation time, last modification, last use.01/14/19 CS 241, System Programming, Klara Nahrstedt10File StructuresByte sequence–Read or write a number of bytes–Unstructured or linearRecord sequence–Fixed or variable length–Read or write a number of recordsTree–Records with keys–Read, insert, delete a record (typically using B-tree)01/14/19 CS 241, System Programming, Klara Nahrstedt11File Structures TodayStream of bytes–Simplest to implement in kernel–Easy to manipulate in other forms–Little performance lossMore complicated structures–Hardware-assisted structures fell out of favor–Special-purpose hardware slower, costly01/14/19 CS 241, System Programming, Klara Nahrstedt12File TypesRegular Files and Directories (in UNIX and Windows)Character-special files (for terminals and other character-based devices)Block-based files (for disks and other block-based devices)Example : A Unix executable file–header: magic number, sizes, entry point, flags–Text (code)–Data–relocation bits–symbol table01/14/19 CS 241, System Programming, Klara Nahrstedt13Some DefinitionsFile descriptor (fd) –an integer used to represent a file – easier than using namesMetadata –data about data - bookkeeping data used to eventually access the “real” dataOpen file table –system-wide list of descriptors in use01/14/19 CS 241, System Programming, Klara Nahrstedt14Kinds of MetadataIn UNIX/LINUX –inode – index node, or a specific set of information kept about each file (used in UNIX, LINUX)Two forms – on disk and in memory–Directory – names and location information for files and subdirectoriesNote: stored in files in Unix–Superblock – contains information to describe the file system, disk layout–Information about free blocks/inodes on diskWindows –Master File Table (MFT) in each volume of the NT File System (Windows); each MFT entry Describes one file or directoryContains file attributes (name, time-stamps, list of disk addresses where blocks are located)01/14/19 CS 241, System Programming, Klara Nahrstedt15Content of InodeDisk inode:–File type, size, blocks on disk–Owner, group, permissions (r/w/x)–Reference count–Times: creation, last access, last mod–Inode generation number–Other file attributes128 bytes on classic Unix01/14/19 CS 241, System


View Full Document

U of I CS 241 - System Programming File System I

Documents in this Course
Process

Process

28 pages

Files

Files

37 pages

File I/O

File I/O

52 pages

C Basics

C Basics

69 pages

Memory

Memory

23 pages

Threads

Threads

14 pages

Lecture

Lecture

55 pages

C Basics

C Basics

24 pages

Signals

Signals

27 pages

Memory

Memory

45 pages

Threads

Threads

47 pages

Threads

Threads

28 pages

LECTURE

LECTURE

45 pages

Threads

Threads

30 pages

Threads

Threads

55 pages

Files

Files

37 pages

SIGNALS

SIGNALS

22 pages

Files

Files

37 pages

Threads

Threads

14 pages

Threads

Threads

13 pages

Load more
Download System Programming File System I
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view System Programming File System I and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view System Programming File System I 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?