0.前言
0.1.MINIX File System - extX系列的祖先摘自<>,<>
0.1.1.MINIX History
MINIX is a Unix-like computer operating system based on a microkernel architecture created by Andrew S. Tanenbaum for educational purposes. MINIX (from "mini-Unix") was first released in 1987, with its complete source code made available to universities for study in courses and research. It has been free and open source software since it was re-licensed under the BSD license in April 2000.The design principles Tanenbaum applied to MINIX greatly influenced the design decisions Linus Torvalds applied in the creation of the Linux kernel. Torvalds used and appreciated MINIX, however, his design deviated(偏离) from the MINIX architecture in significant ways, most notably by employing a monolithic kernel instead of a microkernel. This was famously disapproved of by Tanenbaum in the Tanenbaum–Torvalds debate. Tanenbaum explained again his rationale(理由/解释) for using a microkernel in May 2006. Early Linux kernel development was done on a MINIX host system, which led to Linux inheriting various features from MINIX, such as the MINIX file system.
0.1.2.MINIX File System History
The MINIX file system is the native file system of the MINIX operating system. MINIX was written from scratch by Andrew S. Tanenbaum in the 1980s, as a Unix-like operating system whose source code could be used freely in education. The MINIX file system was designed for use with MINIX; it copies the basic structure of the Unix File System but avoids any complex features in the interest of keeping the source code clean, clear and simple, to meet the overall goal of MINIX to be a useful teaching aid. When Linus Torvalds first started writing his Linux operating system kernel (1991), he was working on a machine running MINIX, so the initial releases based a lot of functionality on Minix subsystems. Until the April 1992 introduction of the Extended file system, Linux used the MINIX file system. The format is still used by some Linux distributions for bootable disks and other situations where a simple and compact file system is needed.
0.1.3.Design and implementation
A MINIX file system has six components:
a.The Boot Block which is always stored in the first block. It contains the boot loader that loads and runs an operating system at system startup.
b.The second block is the Superblock which stores data about the file system, that allows the operating system to locate and understand other file system structures. For example, the number of inodes and zones, the size of the two bitmaps and the starting block of the data area.
c.The inode bitmap is a simple map of the inodes that tracks which ones are in use and which ones are free by representing them as either a one (in use) or a zero (free).
d.The zone bitmap works in the same way as the inode bitmap, except it tracks the zones
e.The inodes area. Each file or directory is represented as an inode, which records metadata including type (file, directory, block, char, pipe), ids for user and group, three timestamps that record the date and time of last access, last modification and last status change. An inode also contains a list of addresses that point to the zones in the data area where the file or directory data is actually stored.
f.The data area is the largest component of the file system, using the majority of the space. It is where the actual file and directory data are stored.
0.1.4.MINIX limitations
The MINIX File System used 16-bit offsets internally and thus only had a maximum size limit of 64 megabytes. There was also a filename length limit of 14 characters.
0.1.5.总结
MINIX文件系统最主要是解决了linux kernel文件系统从无到有的问题,MINIX最主要是提供给教育机构的学生学习使用,将其使用在日常生活,工作等中,便暴露了其缺陷。
0.2.Extended file system
摘自<>
0.2.1.ext文件系统的历史
ext文件系统发布于1992年4月, 由设计, 专门作为Linux操作系统的第一个原生态的文件系统, 包含在linux 0.96c中, 它主要是用来克服Minix文件系统的缺陷[0.1.4.]. 为缓解添加新文件系统的难度, 并能够提供一个通用的文件API, VFS被加入到linux内核, ext文件系统是第一个使用VFS API的文件系统的. 但是ext文件系统仍然有一些问题: 如不支持file access, inode modification, and data modification的分离时间戳.
对于linux kernel来说,ext解决了MINIX File System的不足。同时,kernel也引进了VFS(最早出现在SunOS2.0-1985)。
0.2.2.ext2文件系统的历史
ext2文件系统最初也是由设计, 用来替换ext文件系统的. ext2文件系统作为ext文件系统的翻修, 也结合了FFS(Berkeley Fast File System)的许多理念. ext2文件系统在设计之初就考虑了可扩展性, 磁盘上的数据结构保留了一些空间用于将来的版本. 由于ext2文件系统扩展起来较简单,而且其内部原理也是很好理解的, 所以自从发布之后就成为了添加新扩展到VFS API的试验台, 如POSIX的ACL和扩展属性都是首先在ext2文件系统上实现的.
1.磁盘存储设备
1.1.原理
磁盘是由表面涂有磁性物质的金属或塑料构成的圆形盘片. 数据记录在磁盘中, 以后可以通过一个称为磁头的导体线圈从磁盘中取出数据. 在进行读操作或写操作期间, 磁头是固定的, 磁盘在它下面旋转.
写机制基于通过线圈的电流会产生磁场的原理. 电磁脉冲被送到磁头, 产生的磁模式被记录在磁头下面的磁盘面中, 正负电流会产生不同的磁模式. 读机制基于这一事实: 相对于线圈移动的磁场会在线圈中产生电流. 当盘片在磁头下面经过时, 可以产生与以前记录的极性相同的电流.
阅读(1463) | 评论(0) | 转发(0) |