SlideShare a Scribd company logo
1 of 6
1
CPU-Scheduling (Galvin)
Outline
 FILE CONCEPT
o File Attributes (Name, Identifier, Type, Location, Size, Protection, Time & Date, UserID)
o File Operations
o File Types
o File Structure
o Internal File Structure
 ACCESS METHODS
o Sequential Access
o Direct Access
o Other Access Methods
 DIRECTORY STRUCTURE
o Storage Structure
o Directory Overview
o Single-Level Directory
o Two-Level Directory
o Tree-Structured Directories
o Acyclic-Graph Directories
o General Graph Directory
 FILE-SYSTEMMOUNTING
 FILE SHARING
o Multiple Users
o Remote File Systems (The Client-Server Model, Distributed Information Systems, Failure Modes)
o Consistency Semantics (UNIX Semantics, Session Semantics, Immutable-Shared-Files Semantics)
 PROTECTION
o Types of Access
o Access Control
o Other Protection Approaches and Issues
Contents
FILE CONCEPT
File Attributes
Different OSes keeptrack ofdifferent file attributes, includingName, Identifier (e.g. inode number), Type (Text, executable, other binary, etc.),
Location (E.g., Hard drive), Size, Protection, Time & Date, User ID. Some systems give special significance to names, and particularlyextensions (.exe,
.txt, etc.), and some donot. Some extensions maybe of significance to the OS (.exe), andothers onlyto certain applications (.jpg).
File Operations
 The file ADT supports manycommonoperations:Creating a file, Writing a file, Readinga file, Repositioning withina file, Deletinga file,
Truncatinga file.
 Informationabout currentlyopenfiles is storedinan openfile table, containing for example:
2
CPU-Scheduling (Galvin)
o File pointer - records the current position inthe file, for the next reador write access.
o File-open count - How manytimes has the current file beenopened(simultaneouslybydifferent processes)andnot yet closed?
When this counter reacheszerothe file canbe removed from the table.
o Disk location of the file.
o Access rights
 Some systems provide support for file locking.
o A shared lock is for readingonly.
o An exclusive lock is for writing as well as reading.
o An advisory lock is informationalonly, andnot enforced. (A "KeepOut"
sign, whichmaybe ignored.)
o A mandatory lock is enforced. (A trulylockeddoor.) UNIXusedadvisory
locks, andWindows uses mandatorylocks.
File Types
 Windows (andsome other systems) use specialfile extensions to indicate the type
of each file. Macintoshstores a creator attribute for eachfile, according to the
program that first createdit with the create() system call. Macintoshstores a
creator attribute for eachfile, accordingto the program that first createdit withthe
create()systemcall.
File Structure
 Some files containaninternal structure, whichmayor maynot be knownto the OS. For the OS to support particular file formats increasesthe
size andcomplexityof the OS.
 UNIXtreats all files as sequences of bytes, withnofurther considerationof the internal structure. (Withthe exceptionof executable binary
programs, whichit must know how to load and findthe first executable statement, etc.)
 Macintosh files have two forks - a resource fork, and a datafork. The resource forkcontains informationrelatingto the UI, such as icons and
button images, and canbe modified independentlyof the data fork, which contains the code or data as appropriate.
Internal File Structure
 Diskfiles are accessed in units of physical blocks, typically512 bytes or some power-of-twomultiple thereof. (Larger physical disks use larger
block sizes, to keepthe range ofblock numbers withinthe range of a 32-bit integer.)
 Internallyfiles are organizedinunits oflogical units, which maybe as small as a single byte, or maybe a larger size corresponding to some
data record or structure size. The number of logical units which fit into one physical block determines its packing, and has animpact on the
amount of internal fragmentation(wasted space) that occurs. As a general rule, half a physicalblockis wastedfor eachfile, andthe larger the
block sizes the more space is lost to internalfragmentation.
ACCESS METHODS
 Sequential Access: A sequentialaccessfile emulates magnetic tape
operation, andgenerallysupports a few operations: a)readnext - read a
record andadvance the tape to the next position. b)write next - write a
record andadvance the tape to the next position. c) rewind d) skipn
records - Mayor maynot be supported. N maybe limitedto positive
numbers, or maybe limitedto +/- 1.
 Direct Access: Jump to anyrecord andread that record. Operations
supportedinclude: read n - readrecord number n. (Note an argument is
now required.) write n - write recordnumber n. (Note anargument is
now required.) jumpto recordn - couldbe 0 or the endof file. Query
current record - usedto return backto this record later. Sequential
access canbe easilyemulated using direct access. The inverse is
complicatedandinefficient.
 Other Access Methods: An indexed access scheme canbe easilybuilt ontop ofa direct access system. Verylarge files mayrequire a multi-
tieredindexingscheme, i.e. indexes of indexes. (Lot of cool and relevant content is there in the book for all chapters)
DIRECTORY STRUCTURE
 Storage Structure: A diskcanbe usedinits entiretyfor a file system. Alternativelya physical diskcanbe brokenup into multiple partitions,
slices, or mini-disks, each of which becomes a virtual diskand canhave its own filesystem. (or be usedfor raw storage, swapspace, etc.)Or,
multiple physicaldisks can be combinedintoone volume, i.e. a larger virtual disk, withits own filesystem spanning the physicaldisks.
3
CPU-Scheduling (Galvin)
 Directory Overview: Directoryoperations to be supported include: a) Search
for a file, b)Create a file (addto the directory) C) Delete a file (erase fromthe
directory) d) List a directory(possiblyorderedin different ways) e)Rename a file
(maychange sorting order) f) Traverse the file system.
 Single-Level Directory: Simple to implement, but each file must have a unique
name.
 Two-Level Directory: Each user gets their own directoryspace. File names only
need to be unique within a givenuser's directory. A master file directoryis used
to keep track of each users directory, andmust be maintained when users are
added to or removedfrom the system. A separate directoryis generallyneeded
for system(executable) files.
Systems mayor maynot allowusers to access other directoriesbesides their
own If access to other directories is allowed, thenprovision must be made to
specifythe directorybeing accessed. Ifaccessis denied, thenspecial
consideration must be made for users to run programs locatedin system
directories. A searchpath is the list of directories in whichto searchfor
executable programs, andcan be set uniquelyfor each user.
 Tree-Structured Directories: This is an obvious extensionto
the two-tiereddirectorystructure. Eachuser / processhas
the concept of a current directoryfrom whichall (relative)
searches take place. Files maybe accessedusing either
absolute pathnames (relative to the root of the tree) or
relative pathnames(relative to the current directory.)
Directories are storedthe same as anyother file in the
system, except there is a bit that identifies them as
directories, andtheyhave some specialstructure that the
OS understands.
 Acyclic-Graph Directories: When the same files needto be accessed in more thanone place inthe directorystructure (e.g. because theyare
being sharedbymore thanone user / process), it can be useful to provide anacyclic-graph structure.
UNIXprovidestwo types of links for implementing the acyclic-graph structure. A hardlink (usuallyjust called a link) involves multiple
directoryentries that bothrefer to the same file. Hardlinks are onlyvalid for ordinaryfilesinthe same filesystem. A symbolic link, that
involves a special file, containing information about where to find the linkedfile. Symbolic links maybe used to link directories and/or filesin
other filesystems, as well as ordinaryfilesinthe current filesystem. Windows onlysupports symbolic links, termedshortcuts.
Hard links require a reference count, or linkcount for each file, keeping track of howmanydirectoryentries are currently referring to this
file. Whenever one of the referencesis removedthe linkcount is reduced, andwhenit reaches zero, the diskspace canbe reclaimed.
 General-Graph Directory: If cycles are allowedinthe graphs, thenseveralproblems canarise: Search algorithms cango intoinfinite loops. One
solution is to not followlinks in searchalgorithms. (Or not to followsymbolic links, and to onlyallowsymbolic links to refer to directories.) Sub-
trees can become disconnected from the rest ofthe tree andstill not have their reference counts reducedto zero. Periodic garbage collection
is requiredto detect andresolve this problem. (chkdsk inDOS and fsck in UNIXsearch for these problems, amongothers, eventhough cycles
are not supposedto be allowedineither system. Disconnecteddisk blocks that are not markedas free are added back to the file systems with
made-upfile names, andcan usuallybe safelydeleted.).ReferFigure11.3
4
CPU-Scheduling (Galvin)
FILE SYSTEM MOUNTING
The basic idea behind mounting file systems is to combine multiple file
systems intoone large tree structure. The mount command is given a
filesystem to mount anda mount point (directory) on which to attachit.
Once a file system is mountedontoa mount point, anyfurther references
to that directoryactuallyrefer to the root of the mountedfile system. Any
files (or sub-directories)that hadbeenstored inthe mount point directory
prior to mounting the newfilesystem are nowhiddenbythe mounted
filesystem, and are no longer available. For this reason some systems only
allowmountingontoemptydirectories.
Filesystems canonlybe mountedbyroot, unless root has previously
configured certainfilesystems to be mountable ontocertainpre-
determined mount points. (E.g. root mayallow users to mount floppy
filesystems to /mnt or somethinglike it.) Anyone canrunthe mount
commandto see what filesystems are currentlymounted. Filesystems
maybe mountedread-only, or have other restrictions imposed.
The traditional Windows OS runs anextendedtwo-tier directorystructure, where the first tier of the structure separatesvolumesbydrive letters, and
a tree structure is implemented belowthat level. Macintoshruns a similar system, where eachnew volume that is found is automaticallymountedand
added to the desktop whenit is found. More recent Windows systems allow filesystems to be mountedto anydirectoryinthe filesystem, muchlike
UNIX.
FILE SHARING
 Multiple Users: On a multi-user system, more informationneeds to be stored for eachfile: The owner (user)whoowns the file, andwhocan
control its access. The group ofother user IDs that mayhave some specialaccessto the file. What access rights are afforded to the owner
(User), the Group, and to the rest of the world (the universe, a.k.a. Others.) Some systems have more complicatedaccesscontrol, allowing or
denying specific accessesto specificallynamedusers or groups.
 Remote File Systems: The advent ofthe Internet introduces issuesfor accessing files storedonremote computers The original methodwas
ftp, allowing individual filesto be transportedacross systems as needed. Ftp can be either account andpassword controlled, or anonymous,
not requiring anyuser name or password. Various forms of distributedfile systems allowremote file systems to be mountedontoa local
directorystructure, andaccessedusing normal file access commands. (The actualfiles are still transportedacrossth e network as needed,
possiblyusing ftpas the underlyingtransport mechanism.)The WWW hasmade it easyonce againto access files onremote systems without
mountingtheir filesystems, generallyusing (anonymous)ftp as the underlying file transport mechanism.
 The Client-Server Model: When one computer system remotelymounts a filesystem that is physicallylocated onanother system, the system
which physicallyowns the filesacts as a server, andthe systemwhichmounts them is the client. User IDs and gro upIDs must be consistent
across bothsystems for the systemto work properly. (I.e. this is most applicable across multiple computers managed bythe same
organization, sharedbya common groupof users.) The same computer canbe both a client anda server. (E.g. cross-linkedfile systems.). The
NFS (NetworkFile System) is a classic example of sucha system.
 Distributed Information Systems: The DomainName System, DNS, provides for a unique naming system acrossall of the Internet. Domain
names are maintainedbythe Network Information System, NIS. Microsoft's CommonInternet File System, CIFS, establishes a network login
for each user ona networked system withsharedfile access. Older Windows systems useddomains, andnewer systems (XP, 2000), use active
directories. User names must match acrossthe network for thissystemto be valid. A newer approachis the Lightweight Directory-Access
Protocol, LDAP, which providesa secure single sign-onfor all users to accessallresources ona network. Thisis a secure system which is
gaininginpopularity, andwhich has the maintenance advantage of combining authorizationinformationin one central location .
 Consistency Semantics: Consistency Semantics dealswith the consistencybetweenthe views of sharedfileson a networkedsystem. When
one user changes the file, when doother users see the changes?
PROTECTION
Files must be kept safe for reliability(against accidental damage), and protection (against deliberate malicious access.) The former is usuallymanaged
with backup copies. This section discusses the latter.
 Types of Access: The following low-level operations are oftencontrolled:
o Read - View the contents of the file
o Write - Change the contents ofthe file.
o Execute - Loadthe file onto the CPU and follow the instructions contained therein.
o Append - Add to the endof an existing file.
o Delete - Remove a file from the system.
o List -View the name andother attributes offiles onthe system.
Higher-level operations, suchas copy, cangenerallybe performedthrough combinations ofthe above.
5
CPU-Scheduling (Galvin)
 Access Control: One approach is to have complicated Access Control Lists, ACL, which specifyexactlywhat access is allowedor denied for
specific users or groups. The AFS usesthis system for distributedaccess. Control is veryfinelyadjustable, but maybe complicated, particularly
when the specific users involved are unknown. (AFSallows some wildcards, so for example all users on a certainremote system maybe
trusted, or a givenusername maybe trustedwhenaccessing fromanyremote system.)
UNIXuses a set of 9 access control bits, in three groups of three. These correspondto R, W, and Xpermissions for eachof the Owner,
Group, and Others. (See"manchmod" for full details.) The RWXbits control the following privileges for ordinaryfilesanddirectories:
bit Files Directories
R
Read (view) file
contents.
Read directory contents. Required to get a listing of the directory.
W
Write (change)
file contents.
Change directory contents. Required to create or delete files.
X
Execute file
contents as a
program.
Access detailed directory information. Required to get a long listing, or to access any specific
file in the directory. Note that if a user has X but not R permissions on a directory, they can still
access specific files, but only if they already know the name of the file they are trying to access.
In addition there are some special bits that canalsobe
applied:The set user ID (SUID)bit and/or the set group
ID (SGID) bits appliedto executable files temporarily
change the identityof whoever runs the program to
match that ofthe owner / groupof the executable
program. Thisallows users running specific programs
to have access to files (whilerunning that program) to
which theywouldnormallybe unable to access. Setting
of these twobits is usuallyrestricted to root, andmust
be done withcaution, as it introduces a potential
securityleak.
Windows adjusts files access througha simple GUI.
 Other Protection Approaches and Issues:
o Older systems which didnot originallyhave multi-user file access permissions (DOS andolder versions of Mac)must now be
retrofittedif theyare to share files ona network.
o Access to a file requires access to all the files along its pathas well. Ina cyclic directorystructure, users mayhave different access to
the same file accessedthroughdifferent paths.
o Sometimesjust the knowledge of the existence ofa file ofa certain name is a security(or privacy) concern. Hence the distinction
betweenthe R andXbits onUNIXdirectories.
AssortedContent
 XXX
To be cleared
 I
Glossary
ReadLater
Further Reading
 S
6
CPU-Scheduling (Galvin)

Grey Areas
 XXX

More Related Content

What's hot

What's hot (19)

OSCh11
OSCh11OSCh11
OSCh11
 
10 File System
10 File System10 File System
10 File System
 
File Protection
File ProtectionFile Protection
File Protection
 
File system Os
File system OsFile system Os
File system Os
 
File Directory Structure-R.D.Sivakumar
File Directory Structure-R.D.SivakumarFile Directory Structure-R.D.Sivakumar
File Directory Structure-R.D.Sivakumar
 
File system structure
File system structureFile system structure
File system structure
 
File System Interface
File System InterfaceFile System Interface
File System Interface
 
Ch11
Ch11Ch11
Ch11
 
Operating Systems - Implementing File Systems
Operating Systems - Implementing File SystemsOperating Systems - Implementing File Systems
Operating Systems - Implementing File Systems
 
Ch11 file system implementation
Ch11 file system implementationCh11 file system implementation
Ch11 file system implementation
 
Ch11 file system interface
Ch11 file system interfaceCh11 file system interface
Ch11 file system interface
 
Files
FilesFiles
Files
 
File System Implementation
File System ImplementationFile System Implementation
File System Implementation
 
File management
File managementFile management
File management
 
OSCh12
OSCh12OSCh12
OSCh12
 
File System in Operating System
File System in Operating SystemFile System in Operating System
File System in Operating System
 
File systemimplementationfinal
File systemimplementationfinalFile systemimplementationfinal
File systemimplementationfinal
 
FILE SYSTEMS IN WINDOWS OPERATING SYSTEMS
FILE SYSTEMS IN WINDOWS OPERATING SYSTEMSFILE SYSTEMS IN WINDOWS OPERATING SYSTEMS
FILE SYSTEMS IN WINDOWS OPERATING SYSTEMS
 
File management
File managementFile management
File management
 

Viewers also liked

Processscheduling 161001112521
Processscheduling 161001112521Processscheduling 161001112521
Processscheduling 161001112521marangburu42
 
Process scheduling
Process schedulingProcess scheduling
Process schedulingmarangburu42
 
337 история россии. к. xvii-xixв. 10кл. проф. ур п.р. сахарова а.н-2012 -336с
337  история россии. к. xvii-xixв. 10кл. проф. ур п.р. сахарова а.н-2012 -336с337  история россии. к. xvii-xixв. 10кл. проф. ур п.р. сахарова а.н-2012 -336с
337 история россии. к. xvii-xixв. 10кл. проф. ур п.р. сахарова а.н-2012 -336сpsvayy
 
SANDEEP SK _ CV
SANDEEP SK _ CVSANDEEP SK _ CV
SANDEEP SK _ CVSandeep SK
 
337 поурочные разработки по русскому языку. 11кл егорова н.в. и др-2008 -400с
337  поурочные разработки по русскому языку. 11кл егорова н.в. и др-2008 -400с337  поурочные разработки по русскому языку. 11кл егорова н.в. и др-2008 -400с
337 поурочные разработки по русскому языку. 11кл егорова н.в. и др-2008 -400сpsvayy
 
349 химия. 10кл. раб. тетрадь габриелян-2014 -160с
349  химия. 10кл. раб. тетрадь габриелян-2014 -160с349  химия. 10кл. раб. тетрадь габриелян-2014 -160с
349 химия. 10кл. раб. тетрадь габриелян-2014 -160сpsvayy
 
350 химия. 11кл. раб. тетрадь габриелян-2014 -192с
350  химия. 11кл. раб. тетрадь габриелян-2014 -192с350  химия. 11кл. раб. тетрадь габриелян-2014 -192с
350 химия. 11кл. раб. тетрадь габриелян-2014 -192сpsvayy
 
343 химия. 11кл. раб. тетрадь к уч. габриеляна 2014 -176с
343  химия. 11кл. раб. тетрадь к уч. габриеляна 2014 -176с343  химия. 11кл. раб. тетрадь к уч. габриеляна 2014 -176с
343 химия. 11кл. раб. тетрадь к уч. габриеляна 2014 -176сpsvayy
 
339 химия. 10кл. раб. тетрадь к уч. габриеляна 2014 -144с
339  химия. 10кл. раб. тетрадь к уч. габриеляна 2014 -144с339  химия. 10кл. раб. тетрадь к уч. габриеляна 2014 -144с
339 химия. 10кл. раб. тетрадь к уч. габриеляна 2014 -144сpsvayy
 
340 химия. 10кл. проф. уровень карцова, лёвкин-2011 -432с
340  химия. 10кл. проф. уровень карцова, лёвкин-2011 -432с340  химия. 10кл. проф. уровень карцова, лёвкин-2011 -432с
340 химия. 10кл. проф. уровень карцова, лёвкин-2011 -432сpsvayy
 
[Azure Council Experts (ACE) 第19回定例会] Microsoft Azureアップデート情報 (2016/08/19-201...
[Azure Council Experts (ACE) 第19回定例会] Microsoft Azureアップデート情報 (2016/08/19-201...[Azure Council Experts (ACE) 第19回定例会] Microsoft Azureアップデート情報 (2016/08/19-201...
[Azure Council Experts (ACE) 第19回定例会] Microsoft Azureアップデート情報 (2016/08/19-201...Naoki (Neo) SATO
 
Carte di credito contactless: quali i rischi per la privacy e per il portaf...
Carte di credito contactless:  quali i rischi per la privacy e  per il portaf...Carte di credito contactless:  quali i rischi per la privacy e  per il portaf...
Carte di credito contactless: quali i rischi per la privacy e per il portaf...Massimo Chirivì
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinalmarangburu42
 

Viewers also liked (13)

Processscheduling 161001112521
Processscheduling 161001112521Processscheduling 161001112521
Processscheduling 161001112521
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
337 история россии. к. xvii-xixв. 10кл. проф. ур п.р. сахарова а.н-2012 -336с
337  история россии. к. xvii-xixв. 10кл. проф. ур п.р. сахарова а.н-2012 -336с337  история россии. к. xvii-xixв. 10кл. проф. ур п.р. сахарова а.н-2012 -336с
337 история россии. к. xvii-xixв. 10кл. проф. ур п.р. сахарова а.н-2012 -336с
 
SANDEEP SK _ CV
SANDEEP SK _ CVSANDEEP SK _ CV
SANDEEP SK _ CV
 
337 поурочные разработки по русскому языку. 11кл егорова н.в. и др-2008 -400с
337  поурочные разработки по русскому языку. 11кл егорова н.в. и др-2008 -400с337  поурочные разработки по русскому языку. 11кл егорова н.в. и др-2008 -400с
337 поурочные разработки по русскому языку. 11кл егорова н.в. и др-2008 -400с
 
349 химия. 10кл. раб. тетрадь габриелян-2014 -160с
349  химия. 10кл. раб. тетрадь габриелян-2014 -160с349  химия. 10кл. раб. тетрадь габриелян-2014 -160с
349 химия. 10кл. раб. тетрадь габриелян-2014 -160с
 
350 химия. 11кл. раб. тетрадь габриелян-2014 -192с
350  химия. 11кл. раб. тетрадь габриелян-2014 -192с350  химия. 11кл. раб. тетрадь габриелян-2014 -192с
350 химия. 11кл. раб. тетрадь габриелян-2014 -192с
 
343 химия. 11кл. раб. тетрадь к уч. габриеляна 2014 -176с
343  химия. 11кл. раб. тетрадь к уч. габриеляна 2014 -176с343  химия. 11кл. раб. тетрадь к уч. габриеляна 2014 -176с
343 химия. 11кл. раб. тетрадь к уч. габриеляна 2014 -176с
 
339 химия. 10кл. раб. тетрадь к уч. габриеляна 2014 -144с
339  химия. 10кл. раб. тетрадь к уч. габриеляна 2014 -144с339  химия. 10кл. раб. тетрадь к уч. габриеляна 2014 -144с
339 химия. 10кл. раб. тетрадь к уч. габриеляна 2014 -144с
 
340 химия. 10кл. проф. уровень карцова, лёвкин-2011 -432с
340  химия. 10кл. проф. уровень карцова, лёвкин-2011 -432с340  химия. 10кл. проф. уровень карцова, лёвкин-2011 -432с
340 химия. 10кл. проф. уровень карцова, лёвкин-2011 -432с
 
[Azure Council Experts (ACE) 第19回定例会] Microsoft Azureアップデート情報 (2016/08/19-201...
[Azure Council Experts (ACE) 第19回定例会] Microsoft Azureアップデート情報 (2016/08/19-201...[Azure Council Experts (ACE) 第19回定例会] Microsoft Azureアップデート情報 (2016/08/19-201...
[Azure Council Experts (ACE) 第19回定例会] Microsoft Azureアップデート情報 (2016/08/19-201...
 
Carte di credito contactless: quali i rischi per la privacy e per il portaf...
Carte di credito contactless:  quali i rischi per la privacy e  per il portaf...Carte di credito contactless:  quali i rischi per la privacy e  per il portaf...
Carte di credito contactless: quali i rischi per la privacy e per il portaf...
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinal
 

Similar to CPU File and Directory Structure

Similar to CPU File and Directory Structure (20)

File System operating system operating system
File System  operating system operating systemFile System  operating system operating system
File System operating system operating system
 
File Systems
File SystemsFile Systems
File Systems
 
file management_osnotes.ppt
file management_osnotes.pptfile management_osnotes.ppt
file management_osnotes.ppt
 
OS_Ch11
OS_Ch11OS_Ch11
OS_Ch11
 
Ch11 OS
Ch11 OSCh11 OS
Ch11 OS
 
Unit 3 chapter 1-file management
Unit 3 chapter 1-file managementUnit 3 chapter 1-file management
Unit 3 chapter 1-file management
 
Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file management
 
file management
 file management file management
file management
 
File Input/output, Database Access, Data Analysis with Pandas
File Input/output, Database Access, Data Analysis with PandasFile Input/output, Database Access, Data Analysis with Pandas
File Input/output, Database Access, Data Analysis with Pandas
 
Ch12 OS
Ch12 OSCh12 OS
Ch12 OS
 
OS_Ch12
OS_Ch12OS_Ch12
OS_Ch12
 
Chapter 12.pptx
Chapter 12.pptxChapter 12.pptx
Chapter 12.pptx
 
Os6
Os6Os6
Os6
 
linux-file-system01.ppt
linux-file-system01.pptlinux-file-system01.ppt
linux-file-system01.ppt
 
Host security
Host securityHost security
Host security
 
Host security
Host securityHost security
Host security
 
Linux File System.docx
Linux File System.docxLinux File System.docx
Linux File System.docx
 
Unix1
Unix1Unix1
Unix1
 
Ch10
Ch10Ch10
Ch10
 
File structure
File structureFile structure
File structure
 

More from marangburu42

Hennchthree 161102111515
Hennchthree 161102111515Hennchthree 161102111515
Hennchthree 161102111515marangburu42
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuitsmarangburu42
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuitsmarangburu42
 
Hennchthree 160912095304
Hennchthree 160912095304Hennchthree 160912095304
Hennchthree 160912095304marangburu42
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuitsmarangburu42
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuitsmarangburu42
 
Karnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuitsKarnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuitsmarangburu42
 
Aac boolean formulae
Aac   boolean formulaeAac   boolean formulae
Aac boolean formulaemarangburu42
 
Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858marangburu42
 
Mass storage structurefinal
Mass storage structurefinalMass storage structurefinal
Mass storage structurefinalmarangburu42
 
All aboutcircuits karnaugh maps
All aboutcircuits karnaugh mapsAll aboutcircuits karnaugh maps
All aboutcircuits karnaugh mapsmarangburu42
 
Virtual memoryfinal
Virtual memoryfinalVirtual memoryfinal
Virtual memoryfinalmarangburu42
 
Mainmemoryfinal 161019122029
Mainmemoryfinal 161019122029Mainmemoryfinal 161019122029
Mainmemoryfinal 161019122029marangburu42
 
Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904marangburu42
 
Process synchronizationfinal
Process synchronizationfinalProcess synchronizationfinal
Process synchronizationfinalmarangburu42
 

More from marangburu42 (20)

Hol
HolHol
Hol
 
Write miss
Write missWrite miss
Write miss
 
Hennchthree 161102111515
Hennchthree 161102111515Hennchthree 161102111515
Hennchthree 161102111515
 
Hennchthree
HennchthreeHennchthree
Hennchthree
 
Hennchthree
HennchthreeHennchthree
Hennchthree
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
Hennchthree 160912095304
Hennchthree 160912095304Hennchthree 160912095304
Hennchthree 160912095304
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
Karnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuitsKarnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuits
 
Aac boolean formulae
Aac   boolean formulaeAac   boolean formulae
Aac boolean formulae
 
Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858
 
Io systems final
Io systems finalIo systems final
Io systems final
 
Mass storage structurefinal
Mass storage structurefinalMass storage structurefinal
Mass storage structurefinal
 
All aboutcircuits karnaugh maps
All aboutcircuits karnaugh mapsAll aboutcircuits karnaugh maps
All aboutcircuits karnaugh maps
 
Virtual memoryfinal
Virtual memoryfinalVirtual memoryfinal
Virtual memoryfinal
 
Mainmemoryfinal 161019122029
Mainmemoryfinal 161019122029Mainmemoryfinal 161019122029
Mainmemoryfinal 161019122029
 
Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904
 
Process synchronizationfinal
Process synchronizationfinalProcess synchronizationfinal
Process synchronizationfinal
 

Recently uploaded

VIP Call Girls Mumbai Arpita 9910780858 Independent Escort Service Mumbai
VIP Call Girls Mumbai Arpita 9910780858 Independent Escort Service MumbaiVIP Call Girls Mumbai Arpita 9910780858 Independent Escort Service Mumbai
VIP Call Girls Mumbai Arpita 9910780858 Independent Escort Service Mumbaisonalikaur4
 
Call Girl Koramangala | 7001305949 At Low Cost Cash Payment Booking
Call Girl Koramangala | 7001305949 At Low Cost Cash Payment BookingCall Girl Koramangala | 7001305949 At Low Cost Cash Payment Booking
Call Girl Koramangala | 7001305949 At Low Cost Cash Payment Bookingnarwatsonia7
 
Russian Call Girls Chickpet - 7001305949 Booking and charges genuine rate for...
Russian Call Girls Chickpet - 7001305949 Booking and charges genuine rate for...Russian Call Girls Chickpet - 7001305949 Booking and charges genuine rate for...
Russian Call Girls Chickpet - 7001305949 Booking and charges genuine rate for...narwatsonia7
 
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Service
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls ServiceKesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Service
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Servicemakika9823
 
Call Girls Service Jaipur Grishma WhatsApp ❤8445551418 VIP Call Girls Jaipur
Call Girls Service Jaipur Grishma WhatsApp ❤8445551418 VIP Call Girls JaipurCall Girls Service Jaipur Grishma WhatsApp ❤8445551418 VIP Call Girls Jaipur
Call Girls Service Jaipur Grishma WhatsApp ❤8445551418 VIP Call Girls Jaipurparulsinha
 
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.Artifacts in Nuclear Medicine with Identifying and resolving artifacts.
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.MiadAlsulami
 
College Call Girls Pune Mira 9907093804 Short 1500 Night 6000 Best call girls...
College Call Girls Pune Mira 9907093804 Short 1500 Night 6000 Best call girls...College Call Girls Pune Mira 9907093804 Short 1500 Night 6000 Best call girls...
College Call Girls Pune Mira 9907093804 Short 1500 Night 6000 Best call girls...Miss joya
 
VIP Mumbai Call Girls Hiranandani Gardens Just Call 9920874524 with A/C Room ...
VIP Mumbai Call Girls Hiranandani Gardens Just Call 9920874524 with A/C Room ...VIP Mumbai Call Girls Hiranandani Gardens Just Call 9920874524 with A/C Room ...
VIP Mumbai Call Girls Hiranandani Gardens Just Call 9920874524 with A/C Room ...Garima Khatri
 
Low Rate Call Girls Mumbai Suman 9910780858 Independent Escort Service Mumbai
Low Rate Call Girls Mumbai Suman 9910780858 Independent Escort Service MumbaiLow Rate Call Girls Mumbai Suman 9910780858 Independent Escort Service Mumbai
Low Rate Call Girls Mumbai Suman 9910780858 Independent Escort Service Mumbaisonalikaur4
 
Call Girl Lucknow Mallika 7001305949 Independent Escort Service Lucknow
Call Girl Lucknow Mallika 7001305949 Independent Escort Service LucknowCall Girl Lucknow Mallika 7001305949 Independent Escort Service Lucknow
Call Girl Lucknow Mallika 7001305949 Independent Escort Service Lucknownarwatsonia7
 
Call Girls Service in Bommanahalli - 7001305949 with real photos and phone nu...
Call Girls Service in Bommanahalli - 7001305949 with real photos and phone nu...Call Girls Service in Bommanahalli - 7001305949 with real photos and phone nu...
Call Girls Service in Bommanahalli - 7001305949 with real photos and phone nu...narwatsonia7
 
High Profile Call Girls Jaipur Vani 8445551418 Independent Escort Service Jaipur
High Profile Call Girls Jaipur Vani 8445551418 Independent Escort Service JaipurHigh Profile Call Girls Jaipur Vani 8445551418 Independent Escort Service Jaipur
High Profile Call Girls Jaipur Vani 8445551418 Independent Escort Service Jaipurparulsinha
 
Call Girls Hebbal Just Call 7001305949 Top Class Call Girl Service Available
Call Girls Hebbal Just Call 7001305949 Top Class Call Girl Service AvailableCall Girls Hebbal Just Call 7001305949 Top Class Call Girl Service Available
Call Girls Hebbal Just Call 7001305949 Top Class Call Girl Service Availablenarwatsonia7
 
Call Girls ITPL Just Call 7001305949 Top Class Call Girl Service Available
Call Girls ITPL Just Call 7001305949 Top Class Call Girl Service AvailableCall Girls ITPL Just Call 7001305949 Top Class Call Girl Service Available
Call Girls ITPL Just Call 7001305949 Top Class Call Girl Service Availablenarwatsonia7
 
Call Girl Bangalore Nandini 7001305949 Independent Escort Service Bangalore
Call Girl Bangalore Nandini 7001305949 Independent Escort Service BangaloreCall Girl Bangalore Nandini 7001305949 Independent Escort Service Bangalore
Call Girl Bangalore Nandini 7001305949 Independent Escort Service Bangalorenarwatsonia7
 
Call Girl Service Bidadi - For 7001305949 Cheap & Best with original Photos
Call Girl Service Bidadi - For 7001305949 Cheap & Best with original PhotosCall Girl Service Bidadi - For 7001305949 Cheap & Best with original Photos
Call Girl Service Bidadi - For 7001305949 Cheap & Best with original Photosnarwatsonia7
 
Russian Call Girls in Pune Riya 9907093804 Short 1500 Night 6000 Best call gi...
Russian Call Girls in Pune Riya 9907093804 Short 1500 Night 6000 Best call gi...Russian Call Girls in Pune Riya 9907093804 Short 1500 Night 6000 Best call gi...
Russian Call Girls in Pune Riya 9907093804 Short 1500 Night 6000 Best call gi...Miss joya
 
Bangalore Call Girls Majestic 📞 9907093804 High Profile Service 100% Safe
Bangalore Call Girls Majestic 📞 9907093804 High Profile Service 100% SafeBangalore Call Girls Majestic 📞 9907093804 High Profile Service 100% Safe
Bangalore Call Girls Majestic 📞 9907093804 High Profile Service 100% Safenarwatsonia7
 
Call Girls Hsr Layout Just Call 7001305949 Top Class Call Girl Service Available
Call Girls Hsr Layout Just Call 7001305949 Top Class Call Girl Service AvailableCall Girls Hsr Layout Just Call 7001305949 Top Class Call Girl Service Available
Call Girls Hsr Layout Just Call 7001305949 Top Class Call Girl Service Availablenarwatsonia7
 
Sonagachi Call Girls Services 9907093804 @24x7 High Class Babes Here Call Now
Sonagachi Call Girls Services 9907093804 @24x7 High Class Babes Here Call NowSonagachi Call Girls Services 9907093804 @24x7 High Class Babes Here Call Now
Sonagachi Call Girls Services 9907093804 @24x7 High Class Babes Here Call NowRiya Pathan
 

Recently uploaded (20)

VIP Call Girls Mumbai Arpita 9910780858 Independent Escort Service Mumbai
VIP Call Girls Mumbai Arpita 9910780858 Independent Escort Service MumbaiVIP Call Girls Mumbai Arpita 9910780858 Independent Escort Service Mumbai
VIP Call Girls Mumbai Arpita 9910780858 Independent Escort Service Mumbai
 
Call Girl Koramangala | 7001305949 At Low Cost Cash Payment Booking
Call Girl Koramangala | 7001305949 At Low Cost Cash Payment BookingCall Girl Koramangala | 7001305949 At Low Cost Cash Payment Booking
Call Girl Koramangala | 7001305949 At Low Cost Cash Payment Booking
 
Russian Call Girls Chickpet - 7001305949 Booking and charges genuine rate for...
Russian Call Girls Chickpet - 7001305949 Booking and charges genuine rate for...Russian Call Girls Chickpet - 7001305949 Booking and charges genuine rate for...
Russian Call Girls Chickpet - 7001305949 Booking and charges genuine rate for...
 
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Service
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls ServiceKesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Service
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Service
 
Call Girls Service Jaipur Grishma WhatsApp ❤8445551418 VIP Call Girls Jaipur
Call Girls Service Jaipur Grishma WhatsApp ❤8445551418 VIP Call Girls JaipurCall Girls Service Jaipur Grishma WhatsApp ❤8445551418 VIP Call Girls Jaipur
Call Girls Service Jaipur Grishma WhatsApp ❤8445551418 VIP Call Girls Jaipur
 
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.Artifacts in Nuclear Medicine with Identifying and resolving artifacts.
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.
 
College Call Girls Pune Mira 9907093804 Short 1500 Night 6000 Best call girls...
College Call Girls Pune Mira 9907093804 Short 1500 Night 6000 Best call girls...College Call Girls Pune Mira 9907093804 Short 1500 Night 6000 Best call girls...
College Call Girls Pune Mira 9907093804 Short 1500 Night 6000 Best call girls...
 
VIP Mumbai Call Girls Hiranandani Gardens Just Call 9920874524 with A/C Room ...
VIP Mumbai Call Girls Hiranandani Gardens Just Call 9920874524 with A/C Room ...VIP Mumbai Call Girls Hiranandani Gardens Just Call 9920874524 with A/C Room ...
VIP Mumbai Call Girls Hiranandani Gardens Just Call 9920874524 with A/C Room ...
 
Low Rate Call Girls Mumbai Suman 9910780858 Independent Escort Service Mumbai
Low Rate Call Girls Mumbai Suman 9910780858 Independent Escort Service MumbaiLow Rate Call Girls Mumbai Suman 9910780858 Independent Escort Service Mumbai
Low Rate Call Girls Mumbai Suman 9910780858 Independent Escort Service Mumbai
 
Call Girl Lucknow Mallika 7001305949 Independent Escort Service Lucknow
Call Girl Lucknow Mallika 7001305949 Independent Escort Service LucknowCall Girl Lucknow Mallika 7001305949 Independent Escort Service Lucknow
Call Girl Lucknow Mallika 7001305949 Independent Escort Service Lucknow
 
Call Girls Service in Bommanahalli - 7001305949 with real photos and phone nu...
Call Girls Service in Bommanahalli - 7001305949 with real photos and phone nu...Call Girls Service in Bommanahalli - 7001305949 with real photos and phone nu...
Call Girls Service in Bommanahalli - 7001305949 with real photos and phone nu...
 
High Profile Call Girls Jaipur Vani 8445551418 Independent Escort Service Jaipur
High Profile Call Girls Jaipur Vani 8445551418 Independent Escort Service JaipurHigh Profile Call Girls Jaipur Vani 8445551418 Independent Escort Service Jaipur
High Profile Call Girls Jaipur Vani 8445551418 Independent Escort Service Jaipur
 
Call Girls Hebbal Just Call 7001305949 Top Class Call Girl Service Available
Call Girls Hebbal Just Call 7001305949 Top Class Call Girl Service AvailableCall Girls Hebbal Just Call 7001305949 Top Class Call Girl Service Available
Call Girls Hebbal Just Call 7001305949 Top Class Call Girl Service Available
 
Call Girls ITPL Just Call 7001305949 Top Class Call Girl Service Available
Call Girls ITPL Just Call 7001305949 Top Class Call Girl Service AvailableCall Girls ITPL Just Call 7001305949 Top Class Call Girl Service Available
Call Girls ITPL Just Call 7001305949 Top Class Call Girl Service Available
 
Call Girl Bangalore Nandini 7001305949 Independent Escort Service Bangalore
Call Girl Bangalore Nandini 7001305949 Independent Escort Service BangaloreCall Girl Bangalore Nandini 7001305949 Independent Escort Service Bangalore
Call Girl Bangalore Nandini 7001305949 Independent Escort Service Bangalore
 
Call Girl Service Bidadi - For 7001305949 Cheap & Best with original Photos
Call Girl Service Bidadi - For 7001305949 Cheap & Best with original PhotosCall Girl Service Bidadi - For 7001305949 Cheap & Best with original Photos
Call Girl Service Bidadi - For 7001305949 Cheap & Best with original Photos
 
Russian Call Girls in Pune Riya 9907093804 Short 1500 Night 6000 Best call gi...
Russian Call Girls in Pune Riya 9907093804 Short 1500 Night 6000 Best call gi...Russian Call Girls in Pune Riya 9907093804 Short 1500 Night 6000 Best call gi...
Russian Call Girls in Pune Riya 9907093804 Short 1500 Night 6000 Best call gi...
 
Bangalore Call Girls Majestic 📞 9907093804 High Profile Service 100% Safe
Bangalore Call Girls Majestic 📞 9907093804 High Profile Service 100% SafeBangalore Call Girls Majestic 📞 9907093804 High Profile Service 100% Safe
Bangalore Call Girls Majestic 📞 9907093804 High Profile Service 100% Safe
 
Call Girls Hsr Layout Just Call 7001305949 Top Class Call Girl Service Available
Call Girls Hsr Layout Just Call 7001305949 Top Class Call Girl Service AvailableCall Girls Hsr Layout Just Call 7001305949 Top Class Call Girl Service Available
Call Girls Hsr Layout Just Call 7001305949 Top Class Call Girl Service Available
 
Sonagachi Call Girls Services 9907093804 @24x7 High Class Babes Here Call Now
Sonagachi Call Girls Services 9907093804 @24x7 High Class Babes Here Call NowSonagachi Call Girls Services 9907093804 @24x7 High Class Babes Here Call Now
Sonagachi Call Girls Services 9907093804 @24x7 High Class Babes Here Call Now
 

CPU File and Directory Structure

  • 1. 1 CPU-Scheduling (Galvin) Outline  FILE CONCEPT o File Attributes (Name, Identifier, Type, Location, Size, Protection, Time & Date, UserID) o File Operations o File Types o File Structure o Internal File Structure  ACCESS METHODS o Sequential Access o Direct Access o Other Access Methods  DIRECTORY STRUCTURE o Storage Structure o Directory Overview o Single-Level Directory o Two-Level Directory o Tree-Structured Directories o Acyclic-Graph Directories o General Graph Directory  FILE-SYSTEMMOUNTING  FILE SHARING o Multiple Users o Remote File Systems (The Client-Server Model, Distributed Information Systems, Failure Modes) o Consistency Semantics (UNIX Semantics, Session Semantics, Immutable-Shared-Files Semantics)  PROTECTION o Types of Access o Access Control o Other Protection Approaches and Issues Contents FILE CONCEPT File Attributes Different OSes keeptrack ofdifferent file attributes, includingName, Identifier (e.g. inode number), Type (Text, executable, other binary, etc.), Location (E.g., Hard drive), Size, Protection, Time & Date, User ID. Some systems give special significance to names, and particularlyextensions (.exe, .txt, etc.), and some donot. Some extensions maybe of significance to the OS (.exe), andothers onlyto certain applications (.jpg). File Operations  The file ADT supports manycommonoperations:Creating a file, Writing a file, Readinga file, Repositioning withina file, Deletinga file, Truncatinga file.  Informationabout currentlyopenfiles is storedinan openfile table, containing for example:
  • 2. 2 CPU-Scheduling (Galvin) o File pointer - records the current position inthe file, for the next reador write access. o File-open count - How manytimes has the current file beenopened(simultaneouslybydifferent processes)andnot yet closed? When this counter reacheszerothe file canbe removed from the table. o Disk location of the file. o Access rights  Some systems provide support for file locking. o A shared lock is for readingonly. o An exclusive lock is for writing as well as reading. o An advisory lock is informationalonly, andnot enforced. (A "KeepOut" sign, whichmaybe ignored.) o A mandatory lock is enforced. (A trulylockeddoor.) UNIXusedadvisory locks, andWindows uses mandatorylocks. File Types  Windows (andsome other systems) use specialfile extensions to indicate the type of each file. Macintoshstores a creator attribute for eachfile, according to the program that first createdit with the create() system call. Macintoshstores a creator attribute for eachfile, accordingto the program that first createdit withthe create()systemcall. File Structure  Some files containaninternal structure, whichmayor maynot be knownto the OS. For the OS to support particular file formats increasesthe size andcomplexityof the OS.  UNIXtreats all files as sequences of bytes, withnofurther considerationof the internal structure. (Withthe exceptionof executable binary programs, whichit must know how to load and findthe first executable statement, etc.)  Macintosh files have two forks - a resource fork, and a datafork. The resource forkcontains informationrelatingto the UI, such as icons and button images, and canbe modified independentlyof the data fork, which contains the code or data as appropriate. Internal File Structure  Diskfiles are accessed in units of physical blocks, typically512 bytes or some power-of-twomultiple thereof. (Larger physical disks use larger block sizes, to keepthe range ofblock numbers withinthe range of a 32-bit integer.)  Internallyfiles are organizedinunits oflogical units, which maybe as small as a single byte, or maybe a larger size corresponding to some data record or structure size. The number of logical units which fit into one physical block determines its packing, and has animpact on the amount of internal fragmentation(wasted space) that occurs. As a general rule, half a physicalblockis wastedfor eachfile, andthe larger the block sizes the more space is lost to internalfragmentation. ACCESS METHODS  Sequential Access: A sequentialaccessfile emulates magnetic tape operation, andgenerallysupports a few operations: a)readnext - read a record andadvance the tape to the next position. b)write next - write a record andadvance the tape to the next position. c) rewind d) skipn records - Mayor maynot be supported. N maybe limitedto positive numbers, or maybe limitedto +/- 1.  Direct Access: Jump to anyrecord andread that record. Operations supportedinclude: read n - readrecord number n. (Note an argument is now required.) write n - write recordnumber n. (Note anargument is now required.) jumpto recordn - couldbe 0 or the endof file. Query current record - usedto return backto this record later. Sequential access canbe easilyemulated using direct access. The inverse is complicatedandinefficient.  Other Access Methods: An indexed access scheme canbe easilybuilt ontop ofa direct access system. Verylarge files mayrequire a multi- tieredindexingscheme, i.e. indexes of indexes. (Lot of cool and relevant content is there in the book for all chapters) DIRECTORY STRUCTURE  Storage Structure: A diskcanbe usedinits entiretyfor a file system. Alternativelya physical diskcanbe brokenup into multiple partitions, slices, or mini-disks, each of which becomes a virtual diskand canhave its own filesystem. (or be usedfor raw storage, swapspace, etc.)Or, multiple physicaldisks can be combinedintoone volume, i.e. a larger virtual disk, withits own filesystem spanning the physicaldisks.
  • 3. 3 CPU-Scheduling (Galvin)  Directory Overview: Directoryoperations to be supported include: a) Search for a file, b)Create a file (addto the directory) C) Delete a file (erase fromthe directory) d) List a directory(possiblyorderedin different ways) e)Rename a file (maychange sorting order) f) Traverse the file system.  Single-Level Directory: Simple to implement, but each file must have a unique name.  Two-Level Directory: Each user gets their own directoryspace. File names only need to be unique within a givenuser's directory. A master file directoryis used to keep track of each users directory, andmust be maintained when users are added to or removedfrom the system. A separate directoryis generallyneeded for system(executable) files. Systems mayor maynot allowusers to access other directoriesbesides their own If access to other directories is allowed, thenprovision must be made to specifythe directorybeing accessed. Ifaccessis denied, thenspecial consideration must be made for users to run programs locatedin system directories. A searchpath is the list of directories in whichto searchfor executable programs, andcan be set uniquelyfor each user.  Tree-Structured Directories: This is an obvious extensionto the two-tiereddirectorystructure. Eachuser / processhas the concept of a current directoryfrom whichall (relative) searches take place. Files maybe accessedusing either absolute pathnames (relative to the root of the tree) or relative pathnames(relative to the current directory.) Directories are storedthe same as anyother file in the system, except there is a bit that identifies them as directories, andtheyhave some specialstructure that the OS understands.  Acyclic-Graph Directories: When the same files needto be accessed in more thanone place inthe directorystructure (e.g. because theyare being sharedbymore thanone user / process), it can be useful to provide anacyclic-graph structure. UNIXprovidestwo types of links for implementing the acyclic-graph structure. A hardlink (usuallyjust called a link) involves multiple directoryentries that bothrefer to the same file. Hardlinks are onlyvalid for ordinaryfilesinthe same filesystem. A symbolic link, that involves a special file, containing information about where to find the linkedfile. Symbolic links maybe used to link directories and/or filesin other filesystems, as well as ordinaryfilesinthe current filesystem. Windows onlysupports symbolic links, termedshortcuts. Hard links require a reference count, or linkcount for each file, keeping track of howmanydirectoryentries are currently referring to this file. Whenever one of the referencesis removedthe linkcount is reduced, andwhenit reaches zero, the diskspace canbe reclaimed.  General-Graph Directory: If cycles are allowedinthe graphs, thenseveralproblems canarise: Search algorithms cango intoinfinite loops. One solution is to not followlinks in searchalgorithms. (Or not to followsymbolic links, and to onlyallowsymbolic links to refer to directories.) Sub- trees can become disconnected from the rest ofthe tree andstill not have their reference counts reducedto zero. Periodic garbage collection is requiredto detect andresolve this problem. (chkdsk inDOS and fsck in UNIXsearch for these problems, amongothers, eventhough cycles are not supposedto be allowedineither system. Disconnecteddisk blocks that are not markedas free are added back to the file systems with made-upfile names, andcan usuallybe safelydeleted.).ReferFigure11.3
  • 4. 4 CPU-Scheduling (Galvin) FILE SYSTEM MOUNTING The basic idea behind mounting file systems is to combine multiple file systems intoone large tree structure. The mount command is given a filesystem to mount anda mount point (directory) on which to attachit. Once a file system is mountedontoa mount point, anyfurther references to that directoryactuallyrefer to the root of the mountedfile system. Any files (or sub-directories)that hadbeenstored inthe mount point directory prior to mounting the newfilesystem are nowhiddenbythe mounted filesystem, and are no longer available. For this reason some systems only allowmountingontoemptydirectories. Filesystems canonlybe mountedbyroot, unless root has previously configured certainfilesystems to be mountable ontocertainpre- determined mount points. (E.g. root mayallow users to mount floppy filesystems to /mnt or somethinglike it.) Anyone canrunthe mount commandto see what filesystems are currentlymounted. Filesystems maybe mountedread-only, or have other restrictions imposed. The traditional Windows OS runs anextendedtwo-tier directorystructure, where the first tier of the structure separatesvolumesbydrive letters, and a tree structure is implemented belowthat level. Macintoshruns a similar system, where eachnew volume that is found is automaticallymountedand added to the desktop whenit is found. More recent Windows systems allow filesystems to be mountedto anydirectoryinthe filesystem, muchlike UNIX. FILE SHARING  Multiple Users: On a multi-user system, more informationneeds to be stored for eachfile: The owner (user)whoowns the file, andwhocan control its access. The group ofother user IDs that mayhave some specialaccessto the file. What access rights are afforded to the owner (User), the Group, and to the rest of the world (the universe, a.k.a. Others.) Some systems have more complicatedaccesscontrol, allowing or denying specific accessesto specificallynamedusers or groups.  Remote File Systems: The advent ofthe Internet introduces issuesfor accessing files storedonremote computers The original methodwas ftp, allowing individual filesto be transportedacross systems as needed. Ftp can be either account andpassword controlled, or anonymous, not requiring anyuser name or password. Various forms of distributedfile systems allowremote file systems to be mountedontoa local directorystructure, andaccessedusing normal file access commands. (The actualfiles are still transportedacrossth e network as needed, possiblyusing ftpas the underlyingtransport mechanism.)The WWW hasmade it easyonce againto access files onremote systems without mountingtheir filesystems, generallyusing (anonymous)ftp as the underlying file transport mechanism.  The Client-Server Model: When one computer system remotelymounts a filesystem that is physicallylocated onanother system, the system which physicallyowns the filesacts as a server, andthe systemwhichmounts them is the client. User IDs and gro upIDs must be consistent across bothsystems for the systemto work properly. (I.e. this is most applicable across multiple computers managed bythe same organization, sharedbya common groupof users.) The same computer canbe both a client anda server. (E.g. cross-linkedfile systems.). The NFS (NetworkFile System) is a classic example of sucha system.  Distributed Information Systems: The DomainName System, DNS, provides for a unique naming system acrossall of the Internet. Domain names are maintainedbythe Network Information System, NIS. Microsoft's CommonInternet File System, CIFS, establishes a network login for each user ona networked system withsharedfile access. Older Windows systems useddomains, andnewer systems (XP, 2000), use active directories. User names must match acrossthe network for thissystemto be valid. A newer approachis the Lightweight Directory-Access Protocol, LDAP, which providesa secure single sign-onfor all users to accessallresources ona network. Thisis a secure system which is gaininginpopularity, andwhich has the maintenance advantage of combining authorizationinformationin one central location .  Consistency Semantics: Consistency Semantics dealswith the consistencybetweenthe views of sharedfileson a networkedsystem. When one user changes the file, when doother users see the changes? PROTECTION Files must be kept safe for reliability(against accidental damage), and protection (against deliberate malicious access.) The former is usuallymanaged with backup copies. This section discusses the latter.  Types of Access: The following low-level operations are oftencontrolled: o Read - View the contents of the file o Write - Change the contents ofthe file. o Execute - Loadthe file onto the CPU and follow the instructions contained therein. o Append - Add to the endof an existing file. o Delete - Remove a file from the system. o List -View the name andother attributes offiles onthe system. Higher-level operations, suchas copy, cangenerallybe performedthrough combinations ofthe above.
  • 5. 5 CPU-Scheduling (Galvin)  Access Control: One approach is to have complicated Access Control Lists, ACL, which specifyexactlywhat access is allowedor denied for specific users or groups. The AFS usesthis system for distributedaccess. Control is veryfinelyadjustable, but maybe complicated, particularly when the specific users involved are unknown. (AFSallows some wildcards, so for example all users on a certainremote system maybe trusted, or a givenusername maybe trustedwhenaccessing fromanyremote system.) UNIXuses a set of 9 access control bits, in three groups of three. These correspondto R, W, and Xpermissions for eachof the Owner, Group, and Others. (See"manchmod" for full details.) The RWXbits control the following privileges for ordinaryfilesanddirectories: bit Files Directories R Read (view) file contents. Read directory contents. Required to get a listing of the directory. W Write (change) file contents. Change directory contents. Required to create or delete files. X Execute file contents as a program. Access detailed directory information. Required to get a long listing, or to access any specific file in the directory. Note that if a user has X but not R permissions on a directory, they can still access specific files, but only if they already know the name of the file they are trying to access. In addition there are some special bits that canalsobe applied:The set user ID (SUID)bit and/or the set group ID (SGID) bits appliedto executable files temporarily change the identityof whoever runs the program to match that ofthe owner / groupof the executable program. Thisallows users running specific programs to have access to files (whilerunning that program) to which theywouldnormallybe unable to access. Setting of these twobits is usuallyrestricted to root, andmust be done withcaution, as it introduces a potential securityleak. Windows adjusts files access througha simple GUI.  Other Protection Approaches and Issues: o Older systems which didnot originallyhave multi-user file access permissions (DOS andolder versions of Mac)must now be retrofittedif theyare to share files ona network. o Access to a file requires access to all the files along its pathas well. Ina cyclic directorystructure, users mayhave different access to the same file accessedthroughdifferent paths. o Sometimesjust the knowledge of the existence ofa file ofa certain name is a security(or privacy) concern. Hence the distinction betweenthe R andXbits onUNIXdirectories. AssortedContent  XXX To be cleared  I Glossary ReadLater Further Reading  S