文件系统
FAT
关于fat文件系统:https://www.iteye.com/blog/lobin-2433943
多任务
遍址
不同的架构会采用不同的遍址方式。目前主要有两种遍址方式。
遍址方式
1、独立遍址方式
2、统一遍址方式
x86架构采用的是独立变址方式。采用统一遍址方式的有ARM,MIPS等架构。
独立遍址方式
统一遍址方式
x86遍址方式
独立遍址
IO端口
内存映射IO
显卡
显卡IO端口
显卡内存映射
VGA
VGA(Video Graphies Array, 视频图形阵列), Video Graphies Adapter, 视频图形适配器
SVGA
SVGA(Super VGA)
显示器
键盘鼠标
磁盘
硬盘
软盘
声卡
网卡
网卡驱动
ARP(Address Resolution Protocol,地址解析协议)是一个位于TCP/IP协议栈中的网络层,负责将某个IP地址解析成对应的MAC地址。
主引导程序
关于主引导程序参考另一篇:https://www.iteye.com/blog/lobin-2345973
从一个简单的主引导程序开始
.code16 .global start .text start: jmpl $0x07c0, $entry entry: mov %cs, %ax mov %ax, %es push $0x00 call print_message pop %bx push $0x01 call print_message pop %bx mov %cr0, %eax bts $0, %eax mov %eax, %cr0 push $0x02 call print_message pop %bx push $0x03 call print_message pop %bx endl: hlt jmp endl print_message: push %bp mov %sp, %bp mov $0x13, %ah mov $0x01, %al mov $0x00, %bh mov $0x1f, %bl mov 4(%bp), %dh # mov $0x00, %dh mov $0x0f, %dl mov $message, %bp mov $length, %cx int $0x10 pop %bp ret message: .ascii "Hello, This is AS!" .byte 0x0d, 0x0a length = . - message .org 510 mbr_flag: .word 0xaa55
FAT文件系统中主引导记录结构
FAT文件系统中主引导记录结构的描述,在FAT文件系统中称为引导扇区(Boot Sector)
在引导扇区(Boot Sector)中有一个很重要的结构:BPB (BIOS Parameter Block),也就是BIOS参数块。
BS_JmpBoot | 0 | 3 | Jump instruction to the bootstrap code (x86 instruction) used by OS boot sequence. There are two type of formats for this field and the former format is prefered. 0xEB, 0x??, 0x90 (Short jump + NOP) 0xE9, 0x??, 0x?? (Near jump) ?? is the arbitrary value depends on where to jump is. In case of any format out of these formats, the volume will not be recognized by Windows. |
BS_OEMName | 3 | 8 | "MSWIN 4.1" is recommended but also "MSDOS 5.0" is often used. There are many misconceptions about this field. This is only a name. Microsoft's OS does not pay any attention to this field, but some FAT drivers do some reference. This string is recommended because it is considered to minimize compatibility problems. You can set something else, but some FAT drivers may not recognize that volume. This field usually indicates name of the system created the volume. |
BPB_BytsPerSec | 11 | 2 | Sector size in unit of byte. Valid values for this field are 512, 1024, 2048 or 4096. Microsoft's OS properly supports these sector sizes, but many FAT drivers assume the sector size is 512 and do not check this field. For this reason, 512 should be used for maximum compatibility. However, you should not misunderstand that it is only related to compatibility. This value must be the same as the sector size of the storage contains the FAT volume. |
BPB_SecPerClus | 13 | 1 | Number of sectors per allocation unit. In the FAT file system, the allocation unit is called Cluster. This is a block of one or more consecutive sectors and the data area is managed in this unit. The number of sectors per cluster must be a power of 2. Therefore, valid values are 1, 2, 4,... and 128. However, any value whose cluster size (BPB_BytsPerSec * BPB_SecPerClus) exceeds 32 KB should not be used. Recent systems, such as Windows, supprts cluster size larger than 32 KB, such as 64 KB, 128 KB, and 256 KB, but such volumes will not be recognized correctly by MS-DOS or old disk utilities. |
BPB_RsvdSecCnt | 14 | 2 | Number of sectors in reserved area. This field must not be 0 because there is the boot sector itself contains this BPB in the reserved area. To avoid compatibility problems, it should be 1 on FAT12/16 volume. This is because some old FAT drivers ignore this field and assume that the size of reserved area is 1. On the FAT32 volume, it is typically 32. Microsoft's OS properly supports any value of 1 or larger. |
BPB_NumFATs | 16 | 1 | Number of FATs. The value of this field should always be 2. Also any value eaual to or greater than 1 is valid but it is strongly recommended not to use values other than 2 to avoid compatibility problem. Microsoft's FAT driver properly supports the values other than 2 but some tools and FAT drivers ignore this field and operate with number of FAT is 2. The standard value for this field 2 is to provide redudancy for the FAT data. The value of FAT entry is typically read from the first FAT and any change to the FAT entry is refrected to each FATs. If a sector in the FAT area is damaged, the data will not be lost because it is duplicated in another FAT. Therefore it can minimize risk of data loss. On the non-disk based storages, such as memory card, such redundancy is a useless feature, so that it may be 1 to save the disk space. But some FAT driver may not recognize such a volume properly. |
BPB_RootEntCnt | 17 | 2 | On the FAT12/16 volumes, this field indicates number of 32-byte directory entries in the root directory. The value should be set a value that the size of root directory is aligned to the 2-sector boundary,BPB_RootEntCnt * 32 becomes even multiple ofBPB_BytsPerSec. For maximum compatibility, this field should be set to 512 on the FAT16 volume. For FAT32 volumes, this field must be 0. |
BPB_TotSec16 | 19 | 2 | Total number of sectors of the volume in old 16-bit field. This value is the number of sectors including all four areas of the volume. When the number of sectors of the FAT12/16 volumes is 0x10000 or larger, an invalid value 0 is set in this field, and the true value is set to BPB_TotSec32. For FAT32 volumes, this field must always be 0. |
BPB_Media | 21 | 1 | The valid values for this field is 0xF0, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE and 0xFF. 0xF8 is the standard value for non-removable disks and 0xF0 is often used for non partitioned removable disks. Other important point is that the same value must be put in the lower 8-bits of FAT[0]. This comes from the media determination of MS-DOS Ver.1 and not used for any purpose any longer. |
BPB_FATSz16 | 22 | 2 | Number of sectors occupied by a FAT. This field is used for only FAT12/16 volumes. On the FAT32 volumes, it must be an invalid value 0 and BPB_FATSz32 is used instead. The size of the FAT area becomes BPB_FATSz?? *BPB_NumFATs sectors. |
BPB_SecPerTrk | 24 | 2 | Number of sectors per track. This field is relevant only for media that have geometry and used for only disk BIOS of IBM PC. |
BPB_NumHeads | 26 | 2 | Number of heads. This field is relevant only for media that have geometry and used for only disk BIOS of IBM PC. |
BPB_HiddSec | 28 | 4 | Number of hidden physical sectors preceding the FAT volume. It is generally related to storage accessed by disk BIOS of IBM PC, and what kind of value is set is platform dependent. This field should always be 0 if the volume starts at the beginning of the storage, e.g. non-partitioned disks, such as floppy disk. |
BPB_TotSec32 | 32 | 4 | Total number of sectors of the FAT volume in new 32-bit field. This value is the number of sectors including all four areas of the volume. When the value on the FAT12/16 volume is less than 0x10000, this field must be invalid value 0 and the true value is set to BPB_TotSec16. On the FAT32 volume, this field is always valid and old field is not used. |
BS_DrvNum | 36 | 1 | Drive number used by disk BIOS of IBM PC. This field is used in MS-DOS bootstrap, 0x00 for floppy disk and 0x80 for fixed disk. Actually it depends on the OS. |
BS_Reserved1 | 37 | 1 | Reserved (used by Windows NT). It should be set 0 when create the volume. |
BS_BootSig | 38 | 1 | Extended boot signature (0x29). This is a signature byte indicates that the following three fields are present. |
BS_VolID | 39 | 4 | Volume serial number used with BS_VolLab to track a volume on the removable storage. It enables to detect a wrong media change by FAT driver. This value is typically generated with current time and date on formatting. |
BS_VolLab | 43 | 11 | This field is the 11-byte volume label and it matches volume label recorded in the root directory. FAT driver should update this field when the volume label in the root directory is changed. MS-DOS does it but Windows does not do it. When volume label is not present, "NO NAME " should be set in this field. |
BS_FilSysType | 54 | 8 | "FAT12 ", "FAT16 " or "FAT ". Many people think that this string has any effect in determination of the FAT type but it is clearly a misrecognization. From the name of this field, you will find that this is not a part of BPB. Since this string is often incorrect or not set, Microsoft's FAT driver does not use this field to determine the FAT type. However, some old FAT drivers use this string to determine the FAT type, so that it should be set based on the FAT type of the volume to avoid compatibility problems. |
BS_BootCode | 62 | 448 | Bootstrap program. It is platform dependent and filled with zero when not used. |
BS_BootSign | 510 | 2 | 0xAA55. A boot signature indicating that this is a valid boot sector. |
512 | When the sector size is larger than 512 bytes, rest field in the sector should be filled with zero. |
<tr style="margin: 0px; padding: 0px; border-width
BPB_FATSz32 | 36 | 4 | Size of a FAT in unit of sector. The size of the FAT area is BPB_FATSz32 * BPB_NumFATs sector. This is an only field needs to be referred prior to determine the FAT type while this field exists in only FAT32 volume. But this is not a problem because BPB_FATSz16 is always invalid in FAT32 volume. |
BPB_ExtFlags | 40 | 2 | Bit3-0: Active FAT starting from 0. Valid when bit7 is 1. Bit6-4: Reserved (0). Bit7: 0 means that each FAT are active and mirrored. 1 means that only one FAT indicated by bit3-0 is active. Bit15-8-4: Reserved (0). |
BPB_FSVer | 42 | 2 | FAT32 version. Upper byte is major version number and lower byte is minor version number. This document describes FAT32 version 0.0. This field is for futuer extension of FAT32 volume to manage the filesystem verison. However, FAT32 volume will not be updated any longer. |
BPB_RootClus | 44 | 4 | First cluster number of the root directory. It is usually set to 2, the first cluster of the volume, but it does not need to always be 2. |
BPB_FSInfo | 48 | 2 | Sector of FSInfo structure in offset from top of the FAT32 volume. It is usually set to 1, next to the boot sector. |
BPB_BkBootSec | 50 | 2 | Sector of backup boot sector in offset from top of the FAT32 volume. It is usually set to 6, next to the boot sector but 6 and any other value is not recommended. |
BPB_Reserved | 52 | 12 | Reserved (0). |
BS_DrvNum | 64 | 1 | Same as the description of FAT12/16 field. |
BS_Reserved1 | 65 | 1 | Same as the description of FAT12/16 field. |
BS_BootSig | 66 | 1 | Same as the description of FAT12/16 field. |
BS_VolID | 67 | 4 | Same as the description of FAT12/16 field. |
BS_VolLab | 71 | 11 | Same as the description of FAT12/16 field. |
BS_FilSysType | 82 | 8 | Always "FAT32 " and has not any effect in determination of FAT type. |
相关推荐
4. 代数表达式:第四题要求用代数式表示"a的2倍与b的平方的差",正确答案是2a - b^2。 5. 方程解:第五题中,2x是方程2/3x=m的解,可以解出m的值为1。 6. 等式性质:第六题考察等式两边的乘除运算,选项D的等式不...
中国2013年三季度全年的国内生产总值(GDP)达到了386,762亿元人民币,按可比价格计算,同比增长率为7.8%。这个数据反映了2013年前三季度中国经济的总体平稳并呈现出向好的态势。此外,宏观经济百图也显示了中国GDP...
网管教程 从入门到精通软件篇 ★一。★详细的xp修复控制台命令和用法!!! 放入xp(2000)的光盘,安装时候选R,修复! Windows XP(包括 Windows 2000)的控制台命令是在系统出现一些意外情况下的一种非常有效的...
- **第一次发布**:1991年,发布了第一个版本 Linux 0.02。 - **社区贡献**:Linux 社区的参与和贡献对于 Linux 的成长至关重要。 - **版本多样化**: - **Distributions (发行版)**:Linux 有着众多的发行版,...
7. 选择题:涉及了时间间隔的计算,如第1题答案是13小时,第2题是下午2点,第3题是11:30,第4题是5月2日的0时,第5题B选项正确,第6题答案是C,每年下半年都有184天,无论是平年还是闰年。 8. 计算题:包括直接写得...
- **4脚=2.3V**:这通常表示在电路板上某个部件或节点的第4脚输出电压为2.3伏特。 - **5脚=2-4.5V摆动**:此处表示第5脚的电压范围大约在2V至4.5V之间波动,可能用于某些信号输入或输出端口。 ##### 2. **接口...
全书一共被压缩为5个rar,这是第四个!!!! 其他的请看ID:ljtt123(本人分享) 本博客提供的所有教程的资源原稿均来自于互联网,仅供学习交流之用,切勿进行商业传播。同时,转载时不要移除本申明。如产生任何...
第四章节聚焦于架构设计,包括系统体系结构、数据库实体设计和数据库表设计等;第五章节则着重于系统实现,包括登录、注册、信息管理、统计分析等功能模块的设计和实现。 通过这篇论文,读者可以了解到疫情之下社区...
第四篇 C++ STL算法技术 第21章 非变易算法 284 21.1 逐个容器元素for_each 284 21.2 查找容器元素find 285 21.3 条件查找容器元素find_if 286 21.4 邻近查找容器元素adjacent_find 287 21.5 范围查找...
这篇文档主要介绍了数字9在数学中的神奇特性,特别是与整除性和余数计算相关的知识点。以下是这些内容的详细解析: 1. **数字9的整除性**:一个数如果各个位上的数字相加的和能被9整除,那么这个数本身也能被9整除...
这篇C语言作业的目标是计算贷款在第一个月、第二个月、第三个月后的剩余还款金额。这里涉及到的编程概念和计算公式主要包括贷款利率、还款金额、剩余贷款金额以及利息的计算。 首先,我们需要理解贷款的基本概念。...
9. **DOS扩展器**:为了在DOS环境下运行需要更多内存的程序,出现了DOS扩展器,如EMM386,它们利用扩展内存(XMS)和增强内存(EMS)技术。 10. **DOS的局限性**:尽管DOS简单易用,但由于其单任务、内存限制等问题...
第4部分 应用篇 第19章 使用log4j进行日志操作 564 19.1 log4j介绍 564 19.1.1 logger组件 564 19.1.2 appender组件 566 19.1.3 layout组件 567 19.2 使用log4j 568 19.3 log4j使用实例 572 19.4 ndc和mdc ...
第4部分 应用篇 第19章 使用log4j进行日志操作 564 19.1 log4j介绍 564 19.1.1 logger组件 564 19.1.2 appender组件 566 19.1.3 layout组件 567 19.2 使用log4j 568 19.3 log4j使用实例 572 19.4 ndc和mdc ...
第4部分 应用篇 第19章 使用log4j进行日志操作 564 19.1 log4j介绍 564 19.1.1 logger组件 564 19.1.2 appender组件 566 19.1.3 layout组件 567 19.2 使用log4j 568 19.3 log4j使用实例 572 19.4 ndc和mdc ...
第四节 内部订单预算 317 第五节 结算规则自动生成 320 内部订单(Internal Orders) 审批流程配置 322 1 订单主数据 323 [1]激活订单管理(Tcode:OKKP) 323 [2]定义订单类型(Tcode: KOT2|KOT2-OPA|KOT2_FUNCAREA) 324 ...