CST 334 Week 7 Journal Entry

Persistence 

This week, we learned about persistence in operating systems. Persistence involves managing data and devices so that their state is maintained even if a system loses power intentionally or unintentionally. When interacting with I/O devices, the OS can communicate with them by using I/O instructions or memory-mapped I/O. When dealing with different interfaces, we can build an abstract file system on top of a block interface. This will help with managing the data from the device. 

To make storage persistent, we can use Hard Drive Disks or Solid State Disks. In most cases, Hard Drive Disks are used for storage persistence. We can manage and organize data on either of these storage by using two key abstractions: files and directories. A file is a linear array of bytes that are stored persistently. It usually consists of a human-readable file and has an OS-level identifier called an inode number. A directory consists of subdirectories and files with inode numbers. 

File operations consist of creating and opening a file using open(). This operation returns the file descriptor, which is a number associated with the file. We can also read and write to a file using read() and write(). Both of these operations take the file descriptor, buffer pointer, and buffer size and return the number of bytes read/written. Files can also be removed using remove() or unlink(), and directories can be removed using rmdir().

Data structures and access methods are needed to implement a file system. The data region in the file system is divided into blocks. Most blocks hold data, but some blocks hold information regarding the file system. Some blocks hold the inode numbers of blocks, while others hold the bitmap for inodes and data blocks that are free and allocated. One block is also dedicated to the superblock, which holds the plans for all other blocks. 








Comments

Popular posts from this blog

CST 300 - Week 8

CST 300 - Week 5

CST 300 - Week 4