OS202 - johanessteven19 - Updated Weekly throughout the semester!
About files.
Files, in the context of computers, refer to an abstract data type that is defined and implemented into the computer by the Operating System. Each file will store a sequence of logical records that may either be a byte, a line, or more complex data items. What these logical records mean is defined by its creator and user. These files are usually stored on a secondary hardware, such as magnetic disks and optical disks. Every file on the computer will have a format that may or may not be accessible by the operating system. For example, MacOS by itself cannot open .exe files without the help of other programs.
Source: OSC Chapter 13.
The role of OS in managing files.
Each file that still exists as a logical file concept has to be mapped onto an actual physical storage device, such as the hard disk of a computer. This task itself is what makes the user able to access files through the usage of the Operating System. The user may also organize files into certain directories that can be sorted. The directory will contain information such as date of creation, name, type and length of file, etc. All of this is available through the usage of Operating Systems.
Source: OSC Chapter 13.
Protection of files.
Since files are used to store various types of data that may or may not be critical to the user, each file will need to be protected from outside threats, such as hackers, etc. Therefore, each file is attached with a ‘permission level’. Each file access could be limited by these permission levels, such as only being able to read the file, only being able to read-and-write, all the way up to full permission, where the user can read, write, execute, append, delete, list directory, so on and so forth. These permission levels can be bypassed by the usage of secret keys such as passwords, etc.
Source: OSC Chapter 13.
File storage.
Files are organized and managed by a file system. These file systems are stored permanently secondary storage device that can be partitioned to allow multiple varying types of file systems on a single device. They are mounted onto a specific logical architecture to then be used. The system will then allocate the appropriate space for each file on the file system.
Source: OSC Chapter 14.
Using the file systems.
To use the created file systems, we have to first mount it onto a particular mount point in a directory tree. The OS will automatically manage and organize everything so that the file system is accessible. UNIX and Linux-based operating systems will then create a singular directory tree that will contain every file of the file system such that they will be accessible from an existing subdirectory.It should be noted that each particular file system will have their own directory tree. The file system can also be unmounted whenever it is no longer necessary.
Source: The Linux Documentation Project.
-t fstype
, selects the type of file system.-c
, searches and initializes bad blocks.-l filename
, reads initial bad block list from the name file.File system details.
There are many file system types provided by the general-purpose OS, ranging from special-purpose to general. When the system is powered on, the boot loader will always boot at least one file system. The desired file system can be selected by the administrator. The file system does not have to be stored locally, as remote file systems can now be implemented by usage of the program ftp, or by connecting through web servers and clients through the internet. The remote user will have to send a mount request and be authenticated before sharing is possible.
Source: OSC Chapter 15.