Wednesday, August 11, 2021

CST 334 - Week 8

Virtual File Systems


This week I studied the very simple file system (vsfs). The vsfs's on-disk data structure splits up disk space into equal-sized blocks, much like how paging splits up the memory into equal-sized pages. Each block consists of eight 512-byte sectors. The first block is the superblock, which contains information about the file system. The second and third blocks store the inode bitmap and data bitmap, respectively, which are used for free space management of the remaining blocks (which store either inodes or, most commonly, user data). 

Inodes store important information about files on a disk. An inode contains a few direct pointers to blocks of user data, but it also may use an indirect pointer to a block full of direct pointers. Or, in the case of multi-level indexing, it points to a block full of indirect pointers (which can either point to more indirect pointer blocks, or direct ones). When the operating system uses an access method (e.g. open, read, write), the root inode and its data are accessed and read (note 2 operations), and then the inodes for the remainder of the pathname are traversed recursively until the correct inode is found. Recently accessed blocks are cached for faster access. 

The in-memory data structure of the vfsf is a directory tree, starting at the root node. Everything in the virtual file system is thus only a file in essence. Directories are a special type of file which contain links from user created filenames to the underlying low-level filenames in the system. Hard links directly link virtual files to a low-level file, which may have more than one hard link assigned to it. Soft links, in contrast, are similar in concept to shortcuts. These symbolic links indirectly point a virtual file to another virtual file, which would then be hard linked to a low-level file. 

Wrap-Up


Thus concludes my journey through the world of operating systems. Although I enjoyed my time quite a lot, and the knowledge I've gained is invaluable, I am excited to leave the low-level realm (at least for now). Even if I choose not to return, I believe that my deeper understanding of how the system actually works will help me be a better software developer. 

No comments:

Post a Comment

CST499 - Week 8

The End? I made it. This is my final week in the CS Online program here at CSUMB. I still have one final hurdle in the form of a mock techni...