FAT12 is one of FAT file system families,mostly used on 1.44MB floppy disk。

FAT 's full name is File Allocation System

FAT12 has 4 key parts as follows:

  1. boot sector
  2. FAT tables
  3. root directory entry
  4. data area

 

Boot sector:

Store data and code that necessary for OS or other users to use it. The data is BPB, BIOS Parameter Block。

regularly, BPB take 25 Bytes, some attributes :

As you can see, in fat12, it has 512 Bytes every sector, and a cluster has ONLY one sector.

And you can write your program into the code area of boot , for example, you can use it to create you OS with a tool--Bochs.

FAT tables:

  FAT tables is very important.

  It take Sector 1 to Sector 18, 18 sectors totally. And it's has two copies,--FAT1, FAT2

  it was splited into little entries. Every entry has 12 bits.

  Why 12 bits, because 1.44MB floppy need 12 bits to address: 2^11< 1.44MB < 2^12

  every 12-bit entry is one-to-one-correspondence to a cluster in data area.  So it just like contents of books, which can locate to the chapters.

 

  12 bits means a value, it has special meaning:

Root Directory Entry:

  A file system must has root, FAT12 has root directories.

  We know that there are two types things in a file system: 1. File, 2. Directory

  So how to express and store them???

  In FAT12, every directory has a sector to store it's sub-directories or files. As for the sector, if it's root directory or file(parallel to the root dir), it's stored in Root Dorectory Area. Others are stored in data area.

  enery Dir or file has a entry, which is 32 bytes:

  so: a dir has 16 sub-dir or files at most.

  Where is the cluster of sub-dir?

    A entry has attr "First Logicial Cluster", which point to the next cluster. As for a dir , it's cluster No of  it's entries of sub-files, sub-dir. As for File, if it's size < 512Bytes, over. if not ,it has another cluster, and the logical cluster points to it.

    (Note: A file take integer clusters)

Data Area:

  The main area of data, store file/dir entries and file data.

总结:

  文件系统由根目录开始,每个目录/文件有一个表项,存储了相关的信息,其中,根目录/根文件的表项存在根目录区,而其他普通的则存在数据区。

  对于每个表项,占32位,其中有第一逻辑簇号FLC,目录的FLC指向另一个簇,里面存的的文件和子目录的表项,一个目录最多有16个子目录和文件。文件的GLC指向的簇里存储了文件的内容,如果文件大于512字节,需要另一个存,用当前簇号去FAT表中取出下一簇号即可重定位到下一簇。

FAT12的更多相关文章

  1. 《Orange‘s》FAT12文件系统

    FAT12 层次 扇区(Sector):磁盘上的最小数据单元 簇(Cluster):一个或多个扇区 分区(Partition):通常指整个文件系统 引导扇区 引导扇区是整块软盘的第0个扇区,在这个扇区 ...

  2. FAT12格式的引导区实现

    org 07c00h ;================================================ jmp short START nop ; 这个 nop 不可少 ;这个结构将 ...

  3. 制作FAT12软盘以查看软盘的根目录条目+文件属性+文件内容

    [-1]Before for specific info , please visit http://wiki.osdev.org/Loopback_Device [0]我们先上干货,看到效果后,我们 ...

  4. FAT12中,如何定位大于一个扇区(512B)的文件内容

    [0]README 0.1)本文旨在于 演示在FAT12中, 如何取定位大于 512B 的文件内容,和查看它: 0.2)如何制作FAT12文件系统,以及如何向文件中添加temp.txt文件,参见: { ...

  5. 【转载】FAT12格式的引导程序

    FAT12格式的引导程序 在上一篇文章中详细介绍了FAT12格式的引导扇区数据结构,详情请浏览: 地址是:http://blog.sina.com.cn/s/blog_3edcf6b80100cr08 ...

  6. 【转载】FAT12文件系统之引导扇区结构

    FAT12文件系统之引导扇区结构 文件系统即文件管理系统,是操作系统的重要组成部分之一,如果需要开发底层磁盘驱动或编写自己的操作系统,就必须详细了解文件系统. FAT12是Microsoft公司DOS ...

  7. FAT12 img tool

    NJU/2019/OS Description: CODE: Main.cpp: /* @author: Edwin Xu @Date:2019/11/13 @Note: just ASCII */ ...

  8. 【转载】FAT12格式的引导程序(2)

     1.用WinImage来写入到引导区的详细步骤: 启动WinImage后,打开“文件”菜单,单击菜单中的“打开”命令. 选择之前保存的磁盘镜像文件“boot.img”或者“boot.ima”. 打开 ...

  9. Linux基础介绍【第九篇】

    服务器添加3块磁盘的体系结构 [root@oldboylinux test]# free -m              total used free shared buffers cached M ...

随机推荐

  1. SpEL 实例

    SpEl 实例 基于 Spring 解析 @RestController @RequestMapping("/spel") @Slf4j public class SpELCont ...

  2. ThreadLocal 源码分析

    线程局部变量 ThreadLocal 用于实现线程隔离和类间变量共享. 创建实例 /** * 当前 ThreadLocal 实例的哈希值 */ private final int threadLoca ...

  3. WCF 出现System.Core version 2.0.5.0 未能加载问题

    Window server 2008 R2 Enterprise 版本测试: 需要安装Net补丁: NDP40-KB2468871-v2-x64 下载地址 https://www.microsoft. ...

  4. java日常统计

    姓名:Danny         日期:2017/11/27 任务 日期 听课 编程程序 阅读课本 准备考试 日统计 周一 30 120 150 周二 50 140 190 周三 周四 周五 周六 周 ...

  5. Android中Bitmap对象和字节流之间的相互转换(转)

    android 将图片内容解析成字节数组:将字节数组转换为ImageView可调用的Bitmap对象:图片缩放:把字节数组保存为一个文件:把Bitmap转Byte import java.io.Buf ...

  6. (3.5)常用知识-NULL与零长度、字符串尾部填充空格

    概述:NULL与零长度是不同的,NULL表示数据未知或不可用,它是与零(数值或2进制).零长度字符串不 同的一种值,也可以理解为一种状态. 即可以理解为:所有的变量都有2种状态,一种有值,一种为NUL ...

  7. Scrapy 教程(三)-网站解析

    有经验的人都知道,解析网站需要尝试,看看得到的数据是不是想要的,那么在scrapy中怎么尝试呢? 调试工具-shell 主要用于编写解析器 命令行进入shell scrapy shell url 这个 ...

  8. HNUSTOJ-1253 Babelfish(字典树)

    1253: Problem C: Babelfish 时间限制: 1 Sec  内存限制: 128 MB提交: 14  解决: 3[提交][状态][讨论版] 题目描述 Problem C: Babel ...

  9. 通过编写串口助手工具学习MFC过程——(三)Unicode字符集的宽字符和多字节字符转换

    通过编写串口助手工具学习MFC过程 因为以前也做过几次MFC的编程,每次都是项目完成时,MFC基本操作清楚了,但是过好长时间不再接触MFC的项目,再次做MFC的项目时,又要从头开始熟悉.这次通过做一个 ...

  10. 我的第一个Delphi DLL

    library dd; { 使用字符串参数或嵌套字符串参数需要在uses子句中包括sharemm单元,并将BorlandMM.dll与您的应用程序一起发布. 否则需要对参数值使用PChar或Short ...