操作系统Chapter12-OSFile-Management课件.ppt
《操作系统Chapter12-OSFile-Management课件.ppt》由会员分享,可在线阅读,更多相关《操作系统Chapter12-OSFile-Management课件.ppt(54页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 Directory structureChapter 1212.1 12.2 12.3 Directory Structure12.4 and Protection112.1 Introduction2What is a fileA named collection of related information that is recorded on secondary storage.Content types:DataNumeric,alphabetic,alphanumeric,binaryProgramsource programs,Object formsPropertiesLon
2、g-term existenceSharable between processesStructure3:Attributes(属性)Name:The symbolic in human-readable formIdentifier:to identify the the (Internal)Type:to support different types.Location:the location on the secondary storage device.Size:the current size(and/or its maximum size)Protection:who can d
3、o reading,writing,executing,and so on.Time,date,and user identification:This information may be kept for creation,last modification,and usage monitoring.Typically,the directory entry consists of the files name and its unique identifier.The identifier in turn locates the other.One of the is the locat
4、ion of file.4:Types6:Structure(结构)None-sequence of words,bytes(流式文件)Simple record structureLines,Fixed length,Variable lengthComplex StructuresFormatted documentRelocatable load fileCan be implemented by inserting appropriate control characters.Who decides:Operating system and ProgramConclusion:Too
5、few structures make programming inconvenient,whereas too many cause OS bloat and programmer confusion.7:Operations(操作)Create:to allocate the and allocate the directory entryRead/Write/Seek:to find the directory entry and keep a read/write pointer or seek to a new position.Delete:to find the director
6、y entry and release all and erase the directory entryTruncate:to find the directory entry and release some Open(F)to search the directory structure on disk for entry F,and copy the directory entry into the open-and allocate a.Close(F)to copy the directory entry in the open-to the directory structure
7、 on disk and free the 8:Other accessIndex fileMaster index index file (ISAM:Indexed Sequential-Access Method from IBM)10:Other access11Directory structureA Typical Organization13Directory structuresSingle-level directoryTwo-level directoryTree-structured directoryAcyclic graph directory15Directory s
8、tructure:Single-Level DirectoryA single directory for all users.Naming problemGrouping problem16Directory structure:Tree-Structured Directories18Directory structure:Tree-Structured DirectoriesAbsolute or relative path nameEfficient searchingGrouping Capability19Directory structure:Acyclic-graph dire
9、ctories2012.4 Types of accessReadWriteExecuteAppendDeleteListAccess control lists(访问列表):1.Difficult to build such a list.2.Complicate space management21Concise Access control lists(精简访问列表)Mode of access:read,write,executeThree classes of users RWXa)owner access(创建者创建者)71 1 1 RWXb)group access(工作组工作组
10、)6 1 1 0 RWXc)public access(其他用户)(其他用户)1 1 0 0“Book DirectoryBoss 111Employees 110Readers 10022 Structure:Layered 24 Structure:Layered I/O control consists of device drivers and interrupt handlers to transfer information between the main memory and the disk system.Input:retrieve drive 1,cylinder 73,
11、track 2,sector 10Output:low-level,hardware-specific instructions that are used by the hardware controllerBasic issues generic commands to the appropriate device driver to read and write physical blocks on the diskInput:retrieve block 123Output:retrieve drive 1,cylinder 73,track 2,sector 1025 Structu
12、re:Layered The module knows about the files and their logical blocks,as well as physical blocks.To translate a files logical block addresses to its physical block addresses.Each files logical block addresses are numbered from 0(or 1)through N.Each files physical block addresses are different,are uni
13、que within a partition.Free-space manager:Tracks unallocated blocksAnd provides these blocks when requested.26 Implementation:OverviewTo open a fileTo pass a to the logical To search the directory for the given To read in the files FCBTo put the files FCB to the system-wide open-To add a new entry i
14、n the per-process open-,with a pointer to the entry in the system-wide open-table and some other fieldsTo return a pointer to the appropriate entry in the per-process table.(or)28 Implementation:Overview29Directory ImplementationLinear listTo reuse a directory entryTo mark the entry as used.To attac
15、h it to a list of free directory entries.To decrease the length of the directory.Discussion:Simple to program,time-consuming to executeThe searching is expensiveBinary searchTo keep it sorted listTo use B-tree31Directory ImplementationHash TableTo use a linear list to store the directory entries and
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 操作系统 Chapter12 OSFile Management 课件
限制150内