The root file system is the root file system. First, it must be a file system, and then a root file system, such as a man.
A file system is a system used to organize files. In fact, it is easier to understand in turn, that is, what format the operating system accesses according, obtain the files stored in the disk (that is, you must access the disk files in the format specified by the file system ). If the file system stores files in one format, the operating system can only access and obtain files in this format. For example, the minix1.0 File System in linux0.11 organizes disks in the format of boot block/super block/I node bitmap/logical block bitmap/I node table/logical block, when you need to obtain a location in the disk where the file is stored, you must first find the I node of the file, the I _zone [] in the I node records the position of the file in the logical block to obtain the file, and the I node is obtained, the Logical Block starting from the I node table recorded in the super block must be obtained by scanning the I node table. Therefore, the start position of the I node table must be obtained, you need to obtain the super block of the disk first. Therefore, when the operating system is started, the super block of the disk will be read into the super block array. Of course, the detailed process requires that you first obtain the root I node (or the current I node) through the directory item, and then compare the file name to obtain the I node, however, the big idea is as described above.
When we get a new disk, it can only be used after formatting, And the formatted file system has multiple types, such as FAT32 and NTFS, because the disk we just got has no format, the file system of the operating system does not know how to identify the disk. After formatting, the new disk is divided into the format of the selected file system, which can be identified by the operating system, that is, the operating system is designed for this format. That is to say, selecting a file system to format the disk is paired with the file system of the operating system, that is, the result of formatting a disk using a file system is that the file system of the operating system can identify the reason for the disk. When the file is stored on the disk, the operating system can access and obtain the data in the specified format.
After a file system with an operating system can recognize a file system, you can place the files used on the disk at the startup and initialization of the operating system, the operating system can read the disk files at this location as needed, so as to correctly start the operating system itself. This is the root cause of the root file system, that is, these files must be files that the operating system can read at startup.
It should be noted that the operating system itself does not write all the content, it also needs to read other files to complete its own startup and running processes, such, the final shell program called by Linux is not the content of the operating system itself, but the operating system needs to call this shell program as a login and execute customer commands, if the root file system does not have this file, the user cannot execute the customer's command, and the operating system has no input/output function.