34 -OutlineIntroFilesDirectoriesImplementationLayoutAddressingStructuresPath NamesDirectory OperationsFile NamingFile TypesFile AttributesFile OperationsExample ProgramAnnouncementsReading:IntroFilesDirectoriesImplementationRAM is volatileRAM is ill-suited for sharingRAM is limited in sizeHard Disk Drive (HDD)read block khow do you find the information you want?logical units of info created by processestypically have a stem and extension/suffixRegular fileshold user informationhidden files for file system structuretypically character or binary formatDirectoriesSoft linksCharacter Special filesBlock Special filesabstraction for serial I/Oabstraction for disksabstraction for disksCreate/Deletefiles hidden from usermanaged by OSsingle-level no longer usedSpecifies file locationin hierarchical systemPath contains namesbetween separatorshierarchical from Multics"in-band": attributes stored directly in directorye.g. USB FAT drivese.g. inodes"out-of-band": pointer to attributes in directoryOpen/CloseReadWriteAppendSeekGet/Set AttributesRenamereferences to other fileslength constraints:special/restricted characters/names:case sensitivitye.g. stem.extextension sometimes used to determine how afile should be openedFAT: 8 stem chars, 3 ext charsFAT/NTFS:EXT4:e.g. USBs can have different file systems thanOS, which can mess up transferEXT4: 255 charsOS hides direct block accesseshow do you know which blocks are free?how do you enforce access controls?out of scope in this classwrite block kSolid State Drive (SSD/Flash)Magnetic Tape (cheap)Optical Drives (DVD/CD, largely obsolete)High CapacityPersistentConcurrently AccessibleRAM is good at what it does, but has limitations:1)2)3)4)MOS 4.1 - 4.2; 4.3.1 - 4.3.3; 4.3.7PA 5 due Today.Please use the Makefile to create the zipsubmission.Create your project groups on Canvas.Please try to do this by Monday.File Systems-----------------------Windows: \usr\astUNIX: /usr/astMultics: >usr>ast----------------------------1.2.3.--It is not good for long-term information storage.Good long-term storage has 3 criteria:Physical formats:All are abstracted as "disk-like" block devicesBlock devices represent a linear sequence of fixed-size blocks with 2 basic operations:Given a block device, several questions arise:This is what the file system is for.A file is a byte stream abstraction for disks.OS file system is responsible for managing files andproviding a UI for interacting with files.Different file systems have different limitations orconventions on file names:Information about the file (metadata)Directories are persistent data structures thatorganize and maintain information about files.Typically stores file name and attributes" * / : ? \ |\0 / . ..MOS Figure 4-5Single-LevelHierarchicalCan be absolute or relativeFile systems typically have multiple abstractionlayers and components that are split between theOS and the disk.First we need to understand the file systemlayout on disk.Recall: disks can be divided into partitions withindependent file systems.Createalso creates`.` and `..`DeleteOpendirClosedirReaddirRenameLink (add entry)hardsoftUnlink (remove entry)-----------kernel has file subsystem for managementcontains partition tablecontains code that finds kernel loader in thepartition's file system and starts itcontains file system metadatabasically a mini OS (much more complex)table of "Globally Unique Identifiers"associated with each partitionfaster, larger disks, more partitionssearches for GPTlogical/physical block size defined by devicedisk represented as an array of logical blocksrepresents the physical address of the blockkernel's block size can be different from logicalblock size (usually integer multiple)offset measured in bytesrelative to beginning of file datamaps to a block and offset within that blockkernel's file system uses its own block sizeused to be "cylinder head sector"low-level addressing you won't often seee.g. file system type, number of blocks, etc.kernel loader then finds and starts the kernelpartition table marks bootable partitionBIOS loads MBR and loads bootable partition'spartition boot recordfile system data itself stored on disk-----------------e.g. on linux:echo > foo ; ls -l foo ; du -h foo------ApplicationsLogical File SystemFile Organization ModuleBasic File SystemI/O controlDeviceslayered file subsystemdevicedriverOperating SystemPartitionPartitionPartitionPartitionMBRBootBlockSuperblockFree SpaceMgmt.InodesRootDirFiles &DirectoriesPartition Tableentire diskMaster Boot Record (MBR)Partition Boot Record (PBR / Boot Block)SuperblockBIOS / MBR formatUEFI + GPT formatBIOS + MBR was slow and limited to 4 partitionsMinimal unit of allocation in a disk is a logical blockLogical Block Address is index of block on diskOS accesses file data by file offset (abstraction)Kernel works in terms of blocks as wellUnified Extensible Firmware Interface (UEFI)GUID Partition Table (GPT)MOS Figure 4-11Disk (Block Device)File Datalogicalblockkernel block001N12M......file offset