disk.htm

来自「吐血了」· HTM 代码 · 共 22 行

HTM
22
字号
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>The Disk Structure:</TITLE>
<META NAME="Template" CONTENT="D:\advcpp\VOLUME5.DOT">
</HEAD>
<BODY LINK="#0000ff">

<B><I><U><FONT SIZE=7><P ALIGN="RIGHT">Disk</P>
</B></I></U></FONT><FONT SIZE=3><P ALIGN="JUSTIFY"></P>
<P ALIGN="JUSTIFY">y 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.</P>
<P ALIGN="JUSTIFY">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.</P>
</FONT><B><FONT SIZE=5><P ALIGN="JUSTIFY">The Disk Structure</P>
</B></FONT><FONT SIZE=3><P ALIGN="JUSTIFY">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 6-1 shows the four logical parts of a 1.44 MB disk.</P>
</FONT><FONT SIZE=2><P><HR ALIGN="RIGHT" WIDTH="10%" SIZE=1></P>
</FONT><B><FONT FACE="Arial" SIZE=2><P>Figure 6-1.</B><I>  Logical structure of a 1.44 MB disk.</P>
</I><B>
<P>&nbsp;</P>
</B></FONT><FONT SIZE=3><P ALIGN="JUSTIFY">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 <I>cluster</I>.<I> </I>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 2<SUP>12</SUP> (4096). Similarly, in case of a 16-bit FAT the maximum cluster number is 2<SUP>16</SUP> (65536). Also, for a 32-bit FAT the maximum cluster number is 2<SUP>28</SUP> (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.</P>
</FONT><B><FONT SIZE=4><P ALIGN="JUSTIFY">The Boot Sector</P>
</B></FONT><FONT SIZE=3><P ALIGN="JUSTIFY">The boot sector contains two parts: 態oot Parameters

⌨️ 快捷键说明

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