资源描述:
《中科大操作系统原理与实现课件10_FileSystem.pdf》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、操作系统原理与设计第10章FSinterface(文件系统概述)陈香兰中国科学技术大学计算机学院2009年12月......提纲FileConceptAccessMethodsDirectoryStructureFileSystemMountingProtection小结和作业......FileSystem......OutlineFileConceptAccessMethodsDirectoryStructureFileSystemMountingProtection小结和作业......FileConce
2、ptIOSprovidesauniformlogicalviewofinfomationstoragedespitethevariousstoragemedia.IAfileisalogicalstorageunit.IAfileisanamedcollectionofrelatedinformationthatisrecordedonsecondarystorage.ITypes:IData:numeric;character;binaryIProgramIIngeneral,afileisasequenceofb
3、its,bytes,lines,orrecords.Ithemeaningisdefinedbythefile’screatoranduser.IContiguouslogicaladdressspace......FileAttributes.IName–onlyinformationkeptinhuman-readableformIAnameisusuallyastringofcharacters,suchasexample.cIuppercasevs.lowercase;careornotcareIIdent
4、ifier–uniquetag(number)identifiesfilewithinFSIitisthenon-human-readablenameforthefileIType–neededforsystemsthatsupportdifferenttypesILocation–pointertofilelocationondeviceISize–currentfilesize;mayalsoincludeMAXsizeIProtection–Access-controlinformation:whocandoreadi
5、ng,writing,executingITime,date,anduseridentification–dataforprotection,security,andusagemonitoringIInformationaboutfilesarekeptinthedirectorystructure,whichismaintainedonthedisk.......FileOperationsIIFileisanabstractdatatype.OSprovidesthe6basicsystemcalls1.Cre
6、ate:allocatespace+createandirectoryentry2.Write:writepointer3.Read:readpointer4.Repositionwithinfile:alsoknownasseek5.Delete:releasespace+erasethedirectoryentry6.Truncate:filelen=0;releasespace;allotherattributesremainunchangedIothers:Iforfile:append,renameIfor
7、fileattribute:chown,chmod,:::Ifordirectory&directoryentries:IOpen(Fi)–searchthedirectorystructureondiskforentryFi,andmovethecontentofentrytomemoryIClose(Fi)–movethecontentofentryFiinmemorytodirectorystructureondisk......OpenFiles&Open-FileTableIIOpen-filetable
8、:asmalltablecontaininginformationaboutallopenfilesISeveralprocessesmayopenthesamefileatthesametimeI2-levels:aper-processtable&asystem-widetablewithprocess-independentinformationISeveralpiecesofdat