4.1 File System
4.1.1 Getting to know the concepts and functions of file management
1. File attributes
2. Internal organization of documents
3. Functions provided by the OPERATING system
4. How to store files for external storage
5. Other file management functions to be implemented by the operating system
4.1.2 File logical structure (sequential file, index file, index sequential file, multilevel index sequential file) about the database index such as clustered index can see the index file sample analysis, feel or can harvest things
1. No structure file
2. Have structure files
Sequential file
Index file
Indexed sequential file
Efficiency analysis of indexing sequential files:
Multi-level index sequential file
4.1.3 OS file Directory Directory structure (single-level – two-level – multi-level – acyclic diagram), index node FCB thin
1. File control block
2. Operations on directories
3. Multi-level directory structure (tree directory structure)
4. Acyclic graph directory structure (solve sharing problem)
5. Thin index nodes (FCB improvement)
6. Summary
- This section mainly describes the storage method of files in external storage (currently mainly acyclic graph + index sequential file scheme)
- You learned about the thinness of index nodes
4.1.4 Physical structure of files (continuous allocation, link allocation [implicit – explicit], index allocation [link scheme – multi-layer index – mixed index])
1. File blocks and disk blocks
2. Continuous distribution
3. Link allocation
4. Index allocation
5. Summary
4.1.5 Several algorithms of free disk blocks (free table method, free linked list method, bitmap method, group link method)
1. Divide and initialize storage space
2. Free table method
3. Free linked list method
4. Bitmap method
5. Group chaining
Group linking is a common method to manage free disk areas in Unix systems. It divides free blocks into several groups with 100 free blocks. The first free block in each group records the total number of free blocks and the number of the next free physical block. It’s important to understand that. Especially if you look at the diagram below.
First, look at the green stack of free disks on the left. This is the first group (the only one that goes into memory, and only one that takes up storage). If s.tree = 100, the number of free blocks in the group is 300. If s.tree = 100, the number of free blocks in the group is 300. If you look at the yellow blocks, those blocks are actually free blocks that are available, which means that there are only 99 blocks available in each group. Still, there are 100 blocks in each group. In particular, there is no disk number in the next group of the last group. What we use here is the end mark “0”, that is, the second item of the blue block on the right is 0.
4.1.6 Basic Operation Principles of Files (Creating, deleting, opening, closing, and read-write)
4.1.7 File Sharing in OS (Inode-hard Link, Symlink-Soft Link)
1. Sharing mode based on index nodes (hard link)
2. Sharing method based on symbolic chain (soft link)
4.2 Disk Organization and Management
4.2.1 Disk Structure (Disk, track, sector, disk, cylinder, and head)
1. Disks, tracks, and sectors
2. How do I read/write data to the disk
3. Disk and cylinder
4.2.2 Disk Scheduling Algorithms (FCFS, SSTF, SCAN, LOOK, S-Scan, C-look)
4.2.3 OS method to Reduce disk latency (Alternate Numbering and Misnamed)
1. Previous episodes
2. Alternate numbering
3. Design the disk address structure
4. Misnaming
4.2.4 OS Disk Management (Disk initialization, boot block, and bad block management)
1. Initialize the disk
2. Boot block
3. Bad block management
reference
Blog.csdn.net/weixin_4391…