中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » 好久没来啦,来转点东东:FAT系统 ^_^
作者:
标题: 好久没来啦,来转点东东:FAT系统 ^_^ 上一主题 | 下一主题
starsky
初级用户




积分 191
发帖 22
注册 2004-7-30
状态 离线
『楼 主』:  好久没来啦,来转点东东:FAT系统 ^_^

Examining the new FAT 32 system

Inside Microsoft Windows 95
A publication of the Cobb Group
Published January 1998
【转载至】Compguys TechWeb TSP
If you're like most Windows 95 users, you're running a Pentium system with a gigabyte or more of hard disk space designated as drive C. Since one GB is equivalent to 1,024MB, you probably never imagined that you'd fill your disk to capacity. However, once you started installing software and creating documents, you no doubt noticed that your hard disk appeared to fill up much quicker than you thought possible. If you're using Plus!'s System Agent, you may have even encountered the Low Disk Space Notification dialog box, shown in Figure A. You may be surprised to see this dialog box.

【图略】
In all actuality, a large percentage of your hard disk is probably empty. Unfortunately, this space is wasted and unavailable because the current FAT (file allocation table) system in Windows 95 wasn't designed for today's massive hard disks. Therefore, the FAT doesn't manage the available space on large hard disks very efficiently. To make Windows 95 use today's hard disks more efficiently, Microsoft recently upgraded the FAT system. The new system, known as FAT 32, is now available with the OSR2 version of Windows 95 and will be standard equipment with Windows 98 when it ships later this year. In this article, we'll discuss the new FAT 32 system and show you why it's more efficient. To help you understand and appreciate the advantages of the FAT 32 system, we'll begin with a detailed look at the current FAT system, which we'll refer to as FAT 16.
What is the FAT and how does it work?In order to grasp the inadequacies of the FAT 16 system, you need to understand what the FAT is and how it manages your hard disk. To do so, imagine that your hard disk is a filing cabinet. In a filing cabinet, you store information on pieces of paper as files. You store the files in folders within folder dividers. To keep track of what's in the folders and dividers, you place tabs on them noting their contents. Basically, the FAT system works the same way with your hard disk. It provides the electronic equivalent of papers, folders, dividers, and tabs. The FAT system stores the tabs indicating the file locations in a special database called the file allocation table, or FAT for short. To carry our analogy further, on a hard disk the pieces of paper are known as sectors. Sectors are the smallest units of storage on your hard disk and measure 512 bytes in size. To keep track of the sectors, the FAT
organizes them into units called clusters, which are similar in function to the file folders. When you save a file on your hard disk, the operating system looks in the FAT for free space in the cabinet. It finds the free clusters on your hard disk, writes the data to the sectors, and makes notations of the filename and the cluster's location in the FAT. Overall, the FAT system works pretty efficiently as far as keeping track of your files goes. However, the problem with the FAT is that it's limited in size. It can store only so many items at a time. The reason for this can be traced back to the FAT system's origin.
The price of backward compatibilityThe FAT system was invented in 1977 as a way to store data on floppy disks for Microsoft Stand-alone Disk Basic. At that time, floppies stored 180KB of data. Soon, floppies grew to larger capacity and PCs began shipping with hard disks. Back in those days, the memory models used for designing operating systems had limits. For example, when the FAT was invented, it was capable of holding only 64KB of data. This limit was imposed because DOS was a 16-bit operating system designed to work with 16-bit computer architecture. Let's take a moment to examine this further. As we mentioned in our analogy, a hard disk is divided into 512-byte pieces called sectors. In order to keep track of its sectors and perform as a 16-bit operating system, DOS assigns a 16-bit binary number to each sector on the hard disk and stores that number in the FAT. In decimal terms, the largest number you can write with 16-bits is 65,535, which is equivalent to 64KB. Thus, the FAT can keep track of at most 65,535 sectors, or 64KB of data. This 64KB limit was fine for the storage capacities at the time. Even FAT entries on the seemingly mammoth 10MB disks wouldn't exceed 64KB. However, by the mid-1980s, hard-disk sizes began to increase. Disks holding 40MB and 60MB were becoming common. It was also beginning to become apparent that the FAT had reached its limit. With 65,535 sectors of 512 bytes, the maximum hard disk size that the FAT could keep track of was 32MB (65,535 * 512). This meant that if you had a large disk, you had to partition it into 32MB pieces in order to stay within FAT's limits. For example, to use a 40MB hard disk, you'd have to partition it into two drives: one would be 32MB and the other would be 8MB. As you can imagine, this wasn't very efficient. To compensate for the 64KB limit on the FAT, Microsoft developed a workaround which it implemented in MS-DOS 4.0. To extend the FAT's capabilities, MS-DOS 4.0 grouped the sectors on the hard disk into clusters and then replaced the sector addresses in the FAT with cluster addresses. Thus, the FAT could store addresses for 65,535 clusters. This meant that you could now create partitions larger than 32MB and still stay within FAT's 64KB limit. When you create a partition in DOS that's larger than 32MB, DOS increases the number of sectors contained in a cluster in order to keep the FAT under its 64KB limit. Table A shows the sizes of the clusters used by different hard-disk sizes. Table A The bigger your disks, the bigger your clusters
Disk Size Cluster Size 0 - 32MB 1/2KB 33MB - 64MB 1KB 64MB - 128MB 2KB 129MB - 256MB 4KB 257MB - 512MB 8KB 513MB - 1GB 16KB 1.1GB - 2GB 32KB 2.1GB - 4GB 64KB Fat FAT disks = fat clustersAs you can see from Table A, when the standard hard disk got larger, DOS was forced to increase the cluster size to remain within the 64KB limit. This system worked fine until hard disks surpassed the gigabyte level. Once that happened, cluster sizes jumped to a whopping 32KB. Having such a large cluster size can be a huge problem for most users梕specially if you store lots of small files on your hard disk. No matter how small the file, it will consume at least one cluster. For example, if you store a 1KB file on a 1.2GB hard disk, that small file will take up an entire 32KB of space. The other 31KB will remain empty. This unused space in a cluster is called slack space. Since the operating system can't write data into slack space, it's completely wasted. So again, it became obvious that the FAT had reached another limit.
How is FAT 32 more efficient?Now that you have a basic understanding of how the FAT works and the problems that are inherent in its design, you'll appreciate the advantages of the FAT 32 system. Before we go on, it's important to understand that FAT 32 is still based on the original FAT system and works very similarly in order to remain compatible with existing programs, networks, and device drivers. The biggest improvement in FAT 32 is its ability to efficiently manage storage space on today's large hard disks.
Smaller cluster sizeTo improve storage efficiency, the FAT 32 system uses a 4KB cluster size for all hard disks under 8GB. This reduces the amount of slack space on your hard disk when you save small files. For example, saving a 1KB file on a 1GB hard disk using the old FAT system takes up 32KB of space. Saving the same file on the same hard disk using the FAT 32 system, however, takes up only a 4KB of space梩hat's a savings of 28KB. While this may sound trivial, when you look at an entire hard disk with thousands of small files, the savings is dramatic. In fact, Microsoft guarantees that the average large hard disk will use its disk space at least 10 to 15 percent more efficiently. However, in some cases, we've determined that the space savings is even larger梤eaching almost the 50-percent range. Of course, the results vary depending on the number of small files on the hard disk.
Improved reliabilityFAT 32 also offers advantages that fall into the category of improved reliability. For instance, under the FAT 16 system, the root directory could be located only at the beginning of the hard disk. If anything happened to that section of the hard disk, the whole thing was unusable. Under the FAT 32 system, the root directory can be located anywhere on the hard disk. This means that if something does happen to the section of the hard disk storing the root directory, the new FAT 32 hard disk utilities will be able to easily move the root directory and repair the defective area. Another advantage FAT 32 has over FAT 16 is that it can use both the default and the back-up copy of the FAT. The FAT 16 system can use only the default copy to run your system; the backup copy is used only by low-level disk utilities when repairing the default FAT. FAT 32, on the other hand, can use both copies of the FAT. Thus, if something happens to the default FAT, the system will continue to run off the backup copy until the default can be repaired. This ability to run off either copy of the FAT opens the door for more dramatic improvements in the near future. For example, this technology will soon enable you to dynamically resize your partitions without losing data.
A larger root directoryIn addition to being able to locate the root directory anywhere on a hard disk, the FAT 32 system has eliminated the 512 entry limit of the root directory. The FAT 16 system uses 32 sectors of 512 bytes each to store the root directory. Thus, the size of the root directory on a hard disk is limited to 16KB, or 512 entries. In other words, the FAT 16 system will let you store at most 512 files and folders in the root directory. Under the FAT 32 system, you can have as many files and folders in the root directory as you want.
Larger hard disksIf you thought a gigabyte hard disk was large, wait until hard disk manufacturers release their first terabyte (TB) hard disks. (A terabyte is equal to 1,099,511,627,776 bytes梤oughly one trillion bytes!) In preparation for that day, Microsoft has given FAT 32 the ability to support hard disks as large as 2TB.
ConclusionIf you have a gigabyte or larger hard disk, you've probably been surprised at how quickly your hard disk is filling up. The reason behind this problem is that the FAT 16 system is out-dated and can't manage disk space very efficiently on the new large hard disks. In this article, we've discussed the FAT 16's problems. We also examined the new FAT 32 system and discussed the advantages it brings to the table.

2004-8-27 00:00
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
Prince
初级用户




积分 151
发帖 12
注册 2003-1-15
状态 离线
『第 2 楼』:  

那位对羊文熟悉请帮忙翻译一下,在下我多谢了。

[此贴子已经被作者于2004-8-28 20:04:27编辑过]




2004-8-28 00:00
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
starsky
初级用户




积分 191
发帖 22
注册 2004-7-30
状态 离线
『第 3 楼』:  

这些还好吧 , 我英语也不是很好。开着金山词霸读好了。 翻译挺费时间的说...

2004-8-28 00:00
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: