⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 explanation.txt

📁 吐血了
💻 TXT
📖 第 1 页 / 共 2 页
字号:
By far the most widely used storage mediums are the floppy disks and the fixed disks (hard disks). Floppy disks and hard disks come in various sizes and capacities but they all work basically in the same way: information is magnetically encoded on their surface in patterns. These patterns are determined by the disk drive and the software that controls the drive.
Although the type of storage device is important, it is the way the stored information is laid out and managed that concerns programmers most. In this chapter we would therefore focus our attention on how information is organized and stored on the disk.
The Disk Structure
As most of us know, the disk drives in DOS and Windows are organized as zero-based drives. That is, drive A is drive number 0, drive B is drive number 1, drive C is drive number 2, etc. The hard disk drive can be further partitioned into logical partitions. Each drive consists of four logical parts: Book Sector, File Allocation Table (FAT), Directory and Data space. Of these, the Boot Sector contains information about how the disk is organized. That is, how many sides does it contain, how many tracks are there on each side, how many sectors are there per track, how many bytes are there per sector, etc. The files and the directories are stored in the Data Space. The Directory contains information about the files like its attributes, name, size, etc. The FAT contains information about where the files and directories are stored in the data space. Figure 1 shows the four logical parts of a 1.44 MB disk.


		Figure disk1.gif
Logical structure of a 1.44 MB disk.

Figure 1.

When a file /directory is created on the disk, instead of allocating a sector for it, a group of sectors is allocated. This group of sectors is often known as a cluster. How many sectors together form one cluster depends upon the capacity of the disk. As the capacity goes on increasing, so also does the maximum cluster number. Accordingly, we have 12-bit, 16-bit or 32-bit FAT. In a 12-bit FAT each entry is of 12 bits. Since each entry in FAT represents a cluster number, the maximum cluster number possible in a 12-bit FAT is 212 (4096). Similarly, in case of a 16-bit FAT the maximum cluster number is 216 (65536). Also, for a 32-bit FAT the maximum cluster number is 228 (268435456. Only 28 of the 32 bits are used in this FAT). All FAT systems are not supported by all versions of Windows. For example, the 32-bit FAT system is supported only in Win 95 OSR2 version or later. There are differences in the organization of contents of Boot Sector, FAT and Directory in FAT12/ FAT16 system on one hand and FAT32 on the other. Some of these differences are discussed below.

The Boot Sector

The boot sector contains two parts: 'Boot Parameters' and 'Disk Bootstrap Program'. The Boot Parameters are useful while performing read/write operations on the disk. Tables 1 and 2 shows the break up of the boot parameters for the 12-bit and the16-bit FAT systems along with their typical values.
As you can observe from Tables 1 and 2, the boot parameters basically contain information indicating how the disk has been organized. Apart from the first 11 bytes in the list of boot parameters, the rest form the 'BIOS Parameter Block' (BPB).
The entry 'Maximum root directory entries' indicates how many maximum files can we create in the root directory of the disk. If one of these entries is a sub-directory name then there can be several more files and sub-sub-directories within it. The 'Media descriptor' byte indicates how the operating system refers to a particular type of disk internally. For example, a 1.44 MB disk has a media descriptor F0, whereas, a hard disk has a media descriptor F8.
<TABLE BORDER CELLSPACING=2 CELLPADDING=7 WIDTH=415>
<TR><TD WIDTH="46%" VALIGN="TOP">
<B><FONT SIZE=2><P>Description</B></FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<B><FONT SIZE=2><P>Length</B></FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<B><FONT SIZE=2><P>Typical Values</B></FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Jump instruction</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>3</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>EB3C90</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>OEM name</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>8</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>MSWIN4.1</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Bytes per sector</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>512</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Sectors per cluster</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>1</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>1</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Reserved sectors</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>1</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Number of FAT copies</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>1</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Max. root directory entries</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>224</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Total sectors</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>2880</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Media descriptor</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>1</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>F0</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Sectors per FAT</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>9</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Sectors per track</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>18</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>No. of sides</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Hidden sectors</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>4</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>0</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Huge sectors</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>4</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>0</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>BIOS drive number</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>1</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>0</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Reserved sectors</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>1</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>0</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Boot signature</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>1</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>41</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Volume ID</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>4</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>349778522</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>Volume label</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>11</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>ICIT</FONT></TD>
</TR>
<TR><TD WIDTH="46%" VALIGN="TOP">
<FONT SIZE=2><P>File system type</FONT></TD>
<TD WIDTH="22%" VALIGN="TOP">
<FONT SIZE=2><P>8</FONT></TD>
<TD WIDTH="32%" VALIGN="TOP">
<FONT SIZE=2><P>FAT12</FONT></TD>
</TR>
</TABLE>

<TABLE BORDER CELLSPACING=2 CELLPADDING=7 WIDTH=409>
<TR><TD WIDTH="43%" VALIGN="TOP">
<B><FONT SIZE=2><P>Description</B></FONT></TD>
<TD WIDTH="19%" VALIGN="TOP">
<B><FONT SIZE=2><P>Length</B></FONT></TD>
<TD WIDTH="38%" VALIGN="TOP">
<B><FONT SIZE=2><P>Typical Values</B></FONT></TD>
</TR>
<TR><TD WIDTH="43%" VALIGN="TOP">
<FONT SIZE=2><P>Jump instruction</FONT></TD>
<TD WIDTH="19%" VALIGN="TOP">
<FONT SIZE=2><P>3</FONT></TD>
<TD WIDTH="38%" VALIGN="TOP">
<FONT SIZE=2><P>EB3C90</FONT></TD>
</TR>
<TR><TD WIDTH="43%" VALIGN="TOP">
<FONT SIZE=2><P>OEM name</FONT></TD>
<TD WIDTH="19%" VALIGN="TOP">
<FONT SIZE=2><P>8</FONT></TD>
<TD WIDTH="38%" VALIGN="TOP">
<FONT SIZE=2><P>MSWIN4.1</FONT></TD>
</TR>
<TR><TD WIDTH="43%" VALIGN="TOP">
<FONT SIZE=2><P>Bytes per sector</FONT></TD>
<TD WIDTH="19%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
<TD WIDTH="38%" VALIGN="TOP">
<FONT SIZE=2><P>512</FONT></TD>
</TR>
<TR><TD WIDTH="43%" VALIGN="TOP">
<FONT SIZE=2><P>Sectors per cluster</FONT></TD>
<TD WIDTH="19%" VALIGN="TOP">
<FONT SIZE=2><P>1</FONT></TD>
<TD WIDTH="38%" VALIGN="TOP">
<FONT SIZE=2><P>64</FONT></TD>
</TR>
<TR><TD WIDTH="43%" VALIGN="TOP">
<FONT SIZE=2><P>Reserved sectors</FONT></TD>
<TD WIDTH="19%" VALIGN="TOP">
<FONT SIZE=2><P>2</FONT></TD>
<TD WIDTH="38%" VALIGN="TOP">
<FONT SIZE=2><P>1</FONT></TD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -