Detailed analysis of the hard drive FAT document system principle

A, the physics structure of the hard drive:

   Hard drive the saving data is a basis electricity, ci conversion principle realization of.The head and homologous control electric circuits install by the material diskettes such as metals or glass etc. and the diskette both sideses that an or a few surfaceses plate to have the magnetism material of hard drives constitute( figure 1), among them, the diskette and heads seal completely in metals hull of have no dust.

When the hard drive work, the diskette becomes soon high-speed to revolve with the design, the constitution is in the diskette the head of the surface then controls in the electric circuit path to move to specify the position then read out data saving or.When the system writes in the data toward hard drive," write the data" electric current creation magnetic field makes the diskette surface magnetism material appearance occurrence change in the head, and still can keep after writing the electric current magnetic field to disappear, thus the data saved down;When the system reads the data from the hard drive, the head specified the district through diskette, the diskette surface magnetic field make head the creation responded the electric current or the coil resistance creations variety, restoring through the related electric circuit processing data.Therefore as long as the ability handle the diskette surface smoother, the head design more precise and raise the diskette to revolve the speed as far as possible, can build a capacity larger, read and write the faster hard drive of the data speed.This is because the diskette surface processing is more even and become soon and more quick and then can make the head leave the diskette surface more more near, the exaltation read, writes the intelligent degree and speeds;The head design is more small more precise can make the head take up the space on the diskette more small, make the head build up more ways of ci on a diskette to save more datas.

Two, the logic structure of the hard drive:

The hard drive is constitute by a lot of diskettes( platter), each each one of diskette faces to all have a reads and write the head.If have a diskette.There will be the 2 N face, to should a head( Heads) of 2 N, from 0,1 and 2 beginning serial numbers.Each diskette was divide the line some cis way( logical, can't see. ) The demarcation rule of each diskette is usually similar.Thus the radius of each diskette all for united at heart circle that fixs the value R again logical became a pillar that take the electrical engineering principal axis as the stalk to face( Cylinders), from go to the mile serial number as each way of ci that 0,1 and 2 each diskette of the ……s ascend to was again divided the line to several ten Districts( Sector) outside, the usual capacity is a 512 bytes, and become the Heads × Sector District of Cylinders × for 1,2 and 3 ……s according to the certain rule serial number.These three parameters are the physics parameters of the hard drives.A lot of fulfillments of our underneath need these three meanings of parameter of deep comprehensions.

Three, the disk leading principle:

3.1?MBR(master?boot?Record) an area:

The calculator is pressing the power key hereafter, start carry out the main plank bios procedure.Carry on a series examination through and install hereafter.Start press the bios in the enactment of system guide the in proper order leading system.Suppose now is a hard drive. The Bios performance after finish own procedure how carry out the power to hand over to the hard drive.Carry out again after handing over to the hard drive saving at where of procedure.In fact, a code that is called the mbr rise prominent function. MBR(master?boot?Record), namely lord leading record, sometimes also call lord leading an area.0 pillars that locate the whole hard drive face 01 area( can see make is the first area of the hard drive) of heads, bios at carry out the proper procedure of oneself hereafter arrive the first instruction in the mbr for the meeting jump.Hand over the control power of the system to is carry out by the mbr.In all amount the main leading record of the 512 bytes, the MBR leading procedure have among them ex-446 word stanzas( be partial to move the 0 Hs~ be partial to move the 1 BDH),64 word stanzas( be partial to move the 1 BEH~ be partial to move the 1 FDH) that are later ons are a DPT( Disk?PartitionTable, the hard drive cent area watch), two word stanzas of the end"55?AA"( be partial to move the 1 FEH~ be partial to move the 1 FFH) is separately the valid be over marking of area.

MBR not with the dissimilarity and dissimilarities of the operate system, idea namely the different operate system may exist the same MBR, even different, the MBR also will not clip the property of take the operate system.Have the characteristic of the public leading.

We come to analytical mbr.Underneath is with a piece of rare jie 120 GB hard drive that the winhex look into of mbr.

    The MBR leading code of your hard drive may not thus.However even different, the function big body carry out is similar. Seek the wowocock here concerning the disk mbr of anti- edit and translate, have already added the detailed annotation, interested in can is once with the small and soft research.

We see the part of DPT.Operate system for the sake of management of easy to customer to disk.Joining the disk divides the concept of the area.Will soon a piece of disk logic divide the line for a few pieces.The area number of cent of disk of how much be number by the English letter of alphabet of be limited by the C ~ Z only, in ascend the diagram DPT total 64 word stanzases how mean that many cent areas belong to sex?The method that microsoft through a chain connect resolved this problem.In DPT total 64 word stanzases, take 16 word stanzas as to divide an unit of the area form to describe a cent area to belong to sex.Also is to say, the area form item of the first cent describes a cent area to belong to sex, general for basic cent area.The area form item of the second cent describe in addition to basic cent area of rest space, generally speaking, be we say of expand separately area.The big body of this part elucidation sees the table 1.


  Note:Last watch in of all show with the actual data over 1 datas of the word stanza, is to press the high way manifestation that arrives the position.Saving the hour arrives by the low the high is saving.Both express the dissimilarity, please careful see clear.Hereafter form of emergence, the diagram is all and together.

Can also see the meaning of these parameters in the winhex:

   Elucidation: The area form item of each cent takes up 16 word stanzas, supposing to be partial to move the address from 0 beginning.Such as the figure 3 of the area form item of cent 3.Divide the area form item 4 divide the area form item together 3.

1 , The 0 Hs is partial to move to divide for the activity area whether marking, can choose the 00 Hs and 80 Hses only. The 80 Hs are activities, the 00 Hs are non- activities.Rest value to microsoft for illegal be worth.

2 , Re- explain once:( this is count for much)Big in 1 number of word stanza drive with low word stanza fore of save the format format( little?endian?Format) or call that the anti- word stanza sequence keeps down.Low word stanza fore of format is the method of a kind of conservancy number, thus, the word stanza of the lowest appear first in 16th enter make few sign.For example, a low word stanza that is worth the 0 x3F000000s means for the 0 x0000003Fs ahead.This low word stanza fore of format number of ten enter to make to count to 63.

3 , System while divide area, each cent the areas all disallow to across the pillar to face, namely all with the pillar face for unit, this is usually a degree of cent say.Sometimes we divide the area is an importation cent the size of the area for the 7000 Ms, coming out separately but ising a 6997 Ms, is this reason. Be partial to move the 2 Hs and be partial to in an area and a parameter of pillars of move the 6 Hses, an area has 6, the pillar faces to have 10, to take be partial to move 6 Hs as an example, it low 6 binary systems that used to an area numbers mean.It is high two do the pillar to face to count 10 in of high two, be partial to move the 7 Hs to constitute of 8 do the pillar to face to count 10 in of low 8.Can know from here, use the area capacity of cent that this kind of way mean actually is limited, the pillar face and the head is from 0 beginning serial numbers, an area is from one beginning serial number, so the most can mean that 1024 pillars face 63 District × 256 heads × 512 byteses of ×=8455716864 bytes.The namely usual 8.4 GBs( should be a 7.8 GBs actually or so) limit.Actually the head number usually uses to 255 only, even pressing the line to this 3 word stanzas to look for the address, lacking the ability to do still. In later operate system, have already not passed the way of the C/ H/ S to look for the address in fact over the cent area of the 8.4 GBs.But is pass to be partial to move the CH ~ to be partial to move total 32 lines of 4 word stanzas an area of FH address to mean to divide the area take up of an area total amount.Can know to pass 4 word stanzas can in token of 32 Districts of 2^, namely 2 TBs=2048 GBs, currently for most calculator but speech, this is already an astronomical figure.At don't over the cent area of the 8.4 GBs up, the C/ H/ S means the method in accordance with the line area mean the method mean of the area size of cent is of.Also is to say, two kinds of mean that method is harmonious.Even don't moderate, also with the line looks for the address for precise. ( The possibility will hint to come amiss in some systems).Fill for the FEH generally over the cent area be over C/ H/ S of the 8.4 GBs?FFH?FFH.Then biggest value that C/ H/ S can mean.Sometimes also would with the pillar face 1024 of mold fill.However this a few word stanzas is what in fact all unimportant.

Although the system of now all adopts the way that the line looks for the address to handle the size of divide the area.But can't across the principle that pillar face and did not change still.An area total amount of the duty area pluses to must be the integral that the pillar faces the capacity with area of reservation number between ex- penny area still doubly. ( Reserve an area is of the first area is MBR or an area of the virtual MBRs that deposits to divide the area form, divide the area of an area amount the on-line to mean that way ascend not account in to reserve an area.If is the first cent area, reserve an area is all areas in the duty areas.

Attach:Divide the area watch type marking,such as figure,4

  3.2?Expand to divide the area

Expand to divide area is of each logic actuators exist a similar expand the leading record in the MBR(?Extended?Boot?Record,?EBR), also someone calls it as the virtual mbr or expands the mbr, the meaning is similar.Expand the leading record includes a label that expands to divide the area form and the area.Expand the leading record will record to include to expand the first information that divide each first pillar of logic actuator in area's noodles only.An area of leading within a logic actuator locates an area generally 32 or 63.But, if the disk did not expand up separately area, will not have already expanded the leading record and the logic actuators so.The first logic actuator expands to divide an area of leading that points to its oneself of Clause 1 within the area watch.The second EBR of logic actuator with next direction.If nonexistent further logic actuator, Clause 2 will not use, and is record a series zero.If have the additional logic actuator, so the second logic actuator expands an area of leading that would point to it of Clause 1 of divide the area form.The second logic actuator expands the second EBR of logic actuator with next direction of divide the area form.Clause 3 and Clause 4s that expand to divide the area form can never be used for.

The disk structure diagram that passes the area of a 4 cents can see the disk mostly organized form.Such as the figure 5:

    Concerning expand separately area, such as the figure 6 show, expand to divide the logic actuator in area to expand to guide the record is a conjunction form.That diagram showed an expand to divide the area up of three logic actuator, explained of the logic actuator and the last logic actuator of front in expand divide the area watch of difference.

   In addition to expanding to divide the area up the last logic actuator, table 2 the mediums describe of expand and divide the area form of format is repeated in each logic actuator:The first marking an area of leading of the logic actuator, the second marking the EBR of the next logic actuator.The last logic actuator expand to divide the area watch and will list its cent area item only.A the second item that expands to divide the area form arrives the fourth item to be used for.

    Expand to divide the area form item in of what a segment with numerical area show is from expand to divide the area to start go to the first of area in the logic actuator to move of the word stanza number.The number within a segment with numerical area mean an area number of constitute that logic actuator.The value of a segment with numerical area be equal to from expand to divide the area form item define of an area of leading arrive an area of the logic actuator end tail to count.

The sometimes there will be the surplus space in the end tail of the disk, what the surplus space is?We make reference to before, the area of cent is to take the capacity that the 1 pillars face as to divide a degree of area of, so if the total space of disk is not a pillar of integral to face, the remaining space that not enough pillar face is the surplus space, this part of spaces does not participate separately area, so can't make use of generally.Shine on the truth say that the physics mode of the disk come to a decision the total capacity of the disk and should be the capacity that a pillar of integral face, why there will be the space that a pillar face.In my comprehension's eyes, the disk of original now for the sake of larger exploitation space, is not according to an area of the outer circle on the physics generally is big in in an area this kind of management method of the turn, just for the sake of with operate system and permit but the abstraction come out the CHS.Possible its ctual space zymail@vip.sina.com

Four, the area principle of cent of FAT

Come to a structure diagram first:

    Now we emphasize to study how the data inside the area of cent of the FAT format is save. The FAT cent area format is the area format of cent that the MICROSOFT supported at the earliest stage, according to FAT watch the number( relevant concept, the behind will speak) share of each chain of 簇 was divided into three kinds of formats of fat12, fat16, fat32" mutation", but its basic and saving way is alike.

The careful research figure 7 medium fat16s and fat32s divide the area to constitute the structure.The underneath explains the concept of the DBR, FAT1, FAT2, a catalogue, data area, the surplus an area one by one in order.Address of speak of such as have no to hint specially all for divide the area inner part to be partial to move.

4.1?Concerning the DBR.

DBR area( DOS?BOOT?RECORD) namely the meaning of the operate system leading record area, usually take up the 0512 word stanzas with total areas of divide the areas.( the special circumstance also wants to take up the other reservation an area, we say first the 0)In this 512 word stanzas, in fact again is from jump to turn the instruction, factory marking and the operate system edition number, BPB( BIOS?Parameter?Block), expand the BPB, the os leading procedure, end to symbolize several parts to constitute. With the most FAT32 that use for a meaning that explains to divide each word of DBR of area stanza.See the figure 8.

Figure 8 of to should explain to see the table 3

Figure 9 give winhex to figure 8?The DBR related parameter explain:

 

   According to top the side diagram example, we to discuss the parameter meaning of each word of DBR stanza.

The MBR carries out CPU to transfer to an area of leading, therefore, ex- three word stanzases of an area of leading must be and can carry out legally of according to x86 instruction of CPU.This usually is a jumps to turn the instruction, that instruction is responsible for jumping next several word stanza( BPB and expand the BPB) that can't carry out, jumping the operate system to guide the code part.

Jump after turning the instruction is the OEM that 8 word stanzas grow?ID, it is a string, OEM?Marking of ID the format turns the name and the edition number of the operate system that should divide the area.For reserve with the MS- DOS of and permit sex, usually Windows?2000 The format turn that dish to record in FAT16 and the word's segment on the disk of FAT32s" MSDOS?5.0", on the disk of NTFS, Windows?2000 What to record is" NTFS".Usually at drive Windows?95 On the formatted disk OEM?The ID word segment appear" MSWIN4.0", at drive Windows?95?OSR2 and Windows?98 On the formatted disk OEM?The ID word segment appear" MSWIN4.1".

Next from be partial to move what 0 x0Bs start and is a description to enable the information that can carry out to guide the code to find out the related parameter.Usually call it as the BPB( BIOS?Parameter?Block), the BPB begins from the same to move the quantity generally, therefore, the parameters of the standard all be placed in a position that have already know.The disk capacity and several structure change the quantity to was all seal in the BPB.Because an area of leading the first part is a x86 to jump to turn the instruction.Therefore, in the future pass in the BPB bitter end additional new information, can carry on expand to the BPB.Need only to should jump to turn the instruction to make the variety that a small adjustment can adapt the BPB.Figure 9 have already listed the name of the item and taken the value, for the sake of the research of the system, aim at the figure 8, expand the meaning of BPB that the FAT32 divides the area format and the meaning of BPB releases the righteousness as form, seeing the table 4 and table 5.

    The DBR is partial to the data of move the 0 x5A beginning to guide the code for the operate system.This from be partial to move the 0 x00s to start of jump and turn the instruction point to.In the figure 8 list of be partial to and move 0 x00s~ the 0 x02s jump to turn the instruction" EB?58?90" indicated the OS leading code to be partial to move the position clearly. jump?The 58 Hs pluses to jump the that turn instruction's need to move the quantity, then begin from the 0 x5As.This instruction is different from different leading method top, its contents also on the different operate system.All say the win98 on most data, set up in the fat win2000 of the basic cent area, the DBR that winxp use takes up the 0 area of the basic cent area only.They speak of, for the fat32, general of 32 basic cent the area reserves an area only have the 0 area is useful.Actually, with the operate system that the FAT32 set up if is a win98, the system will use the saving os of the 0 area and the 2 areas of the basic cent area the leading code;With the operate system that the FAT32 set up if is win2000 or winxps, the system will use the 0 area of the basic cent area and the 0 xC Districts( win2000 or winxp, it the position of the 0 xCs is be partial to by the 00 xABs of area to move to point out) saving os leading code.So, divide the area format in the fat32 up, if a contents of area of DBR is right and is in need of the 2 area( system of win98) or 0 xC Districts( win2000 or system of winxp), the system also can't start.If oneself's hand moves to establish a system, needing to know this.

The last two word stanzas of the DBR area save the DBR that is worth for the 0 x55AAs generally to symbolize effectively, for take the value otherly, related instruction of the system would not performance DBR.An area that participates the leading of os of other severals that speak of up also needs to take 0 x55AAs as the legal be over to symbolize.

FAT16?DBR:

DBR meaning in the FAT32 mostly such, for the FAT12 similar to its basic meaning of FAT16, just related be partial to move the quantity and the parameter meaning contain small difference, the differentiation of the format of FAT and come because of, hereafter will make reference to, here not at say FAT12 and FAT16s more.I FAT16 an area parameter meaning row form.Interested in friend's oneself study once, is almost identical with FAT32.

 

    4.2?Concerning reserve an area

Be partial to move the 0 x0Es in the above-mentioned FAT document system DBR, use 2 word stanzas number of the saving area of reservation.So-called reserve an area( the sometimes will call an area of system, conceal an area), mean start only from the area DBR area of the cent is all areas of system, include one DBR area.In the FAT16 document system, the data that reserves an area usually establishes to 1, namely only DBR area.But in the FAT32, reserve the data of an area to usually take to 32, does the sometimes use the Partition?The FAT32 that Magic divided cent the area will establish an area of 36 reservations, the tool that have may establish an area of 63 reservations.

An area of reservation in the FAT32 in addition to total and the 0 area of disk useds to the DBR, total and the 2 area( system of win98) or total the 0 xC Districts( win2000, winxp) useds to the OS leading code to expand the part outside, an areas all do not participate the operate system management and the disk data managements, usually under circumstance have no function.The reason that the operate system establishes to reserve an area in the FAT32, is for making the backup or staying to treat to the DBR later the hour of upgrade use. In the FAT32, the DBR was partial to move the 0 x34s to have 2 datas of the word stanza to indicate an area of the DBR backup place, general is a 0 x06s, namely the 6 area.When FAT32 cent the area DBR area was break the area of cause the cent can't visit.Can substitutes the 0 area to find back the data with the original backup of the 6 area.

4.3?FAT form and saving principle of the data

FAT watch( File?Allocation?Table?The document assigns the watch), is a kind of chain type structure that the Microsoft is convenient to ushers in in the disk data( document) index and fixed position in the FAT document system.If compare the disk to make a book, the FAT watch can think the catalogue within equal to book, but document be each chapter of contents.But the FAT form mean the method have the very big dissimilarity with catalogue.

In the FAT document system, the document saves the 簇 chain type data structure of adhere to the FAT watch establishment to carry on.At the same time, the FAT document system write an article the organization data the hour use of catalogue also abstraction a, with the simplification logarithms according to of manage.

The saving process of ★ imagine:

We imitate saving principle to a cent area saves the process of the data to explain the FAT document system in the data.

Suppose to have a disk that get empty complete and did not deposit the data now, the size is a 100 KBs, we imagine it as the space address of the line form.For saving the convenience on the management, we are artificial of be divided into the space of this 100 KBs all 100, each 1 KB.We come to one by one in order saving thus a few documentses: A.TXT( the size 10 KBs), B.TXT( the size 53.6 KBs), C.TXT( the size 20.5 KBs).

Can thought of most at least, we can with in proper order deposit this 3 documents in this 100 KB space.Did not forget at the same time, we still need to stick down the position of their size and beginnings, then can seek while wanting to use next time thus of to, this seems the catalogue.For the sake of easy to check to seek, we suppose to use saving their characteristic of the space of the 1 K.( belong to sex)Still have, the saving unit that we design is a 1 KB, so, A.TXT we need 10 saving unit( for the sake of the elucidation convenience, we save the unit is called" zu ".Also the little dozen of ability orders the word,ha ha. ), The B.TXT needs 54 zus, the C.TXT needs 21 zu s.Possible someone would say that the B.TXT and C.TXTs do not are each from waste not to one zu of space?Do you n't let them get tightly why, don't is the province place?My answer is, if is saving according to such way, the catalogue needs to stick down the number of zu only originally Central plains, still needing to stick down the zu now inside of be partial to move, will increase the saving quantity of the catalogue thus, and the access had no rule, read also not that convenient, is something to lose more than gain.

According to the thought that top say, we designed such figure 4.3.1 saving way for show.

    We consider again how to write these three catalogues of document.For each document but speech, must record of have:The document, start the zu , size, establish the date, time, modify the date, time, the document reads and write to belong to sex etc..Can the here size use to end the zu to compute?Can't certainly, because the size of the document is not necessarily the size of a zu of integral, the words that are otherwise be like the B.TXT contents is the contents of the 54 KBs, little don't go surely, can have another also is nothing doing.So we how to record?Can imagine once.For the sake of the convenience of management, we use the catalogue that the management method of the database manages us.Hence I am divided into 10 more to the 1 KB, suppose the beginning zu number is 0, define representative's meaning of each position of each 100 Bs,such as figure,4.3.2

   The structure that design thus absolutely can carry on exactitude's reading and write to the document.Immediately after let the document system work that us design.Change to move a document first, for example A.TXT, the increment orders the contents!yi ?Go toward after increase where put ah, although saving the piece have a lot of spaces behind, close on the heels of afterward the B.TXT data return the crest to write?If move to the back to the A.TXT too wasted handle the resources, and also not necessarily solve problem.This problem sees come temporarily can't resolve.

That we change an operation, deleting the B.txt, the b.txt space releases immediately.By this time space,such as figure,4.3.3, catalogue,such as figure,4.3.4

  This operation see to can also, we do immediately after, at deposit a document D.txt( the size is a 60.3 KBs), altogether 100 spaces of the zus used 31 zus only, still having 68 surpluses of zu , pressing to say can let go of.But?Put where?Have no 61 space for continues, the catalogue went to have no way to write, seeing to have no continuous piece temporarily is saving also not go.

You can certainly thought of that we can transfer to affect other documents that we operate at the time of continue space is not enough or the increment document length, thus a space of zu come, but I want to ask you, that not is all day what also do not do, is to pour the thing of ten ?

See come we design of document system have the fatal loophole, how to solve?Can solve thus in fact:

First we allow the document not continuously saving.Record to start zu and the size of the documents still and only in the catalogue.So we how to record the document to take up those zus, reflecting to shoot the zu with the document not that convenient, because the document does not fix.We change a thought, can reflects to shoot the document with the zu , leaving several zus in the whole forepart that saves the space the record data area in the relation between data and number of zu.For last the total space is also not big, so record with the space of the 1 Kb of the forepart this kind of rightness of should, suppose 3 documents all saving, the space allotment,such as figure,4.3.5, modify the catalogue at the same time, such as the figure 4.3.6

   The tuft use to come to the record data area in the each tuft of is take up circumstance, temporarily call that it write an article an allotment form.Combine the document allotment form and the document catalogues can attain the complete document to read.We thought of that make the document assigns the watch into one piece according to the form, with the figure 4.3.7 of the form record zu and data of to should.

Use the figure 4.3.7 of organization method can carry out the record that occupies the zu to the document completely.But return the not enough efficiency.For example the document is in document assign watch the record is too many, the waste space, but have already recorded the beginning cluster of the document in the catalogue actually.So can improve once, deposit the relation of occupy theclusterwith the way of the chain, become the figure 4.3.8 of organization method.

   According to the figure 4.3.8 to comprehend the document to assign the meaning of the form.Such as the document a.txt we according to the catalogue item in appointed a.txt of a cluster is 2, then find out the document allotment form the 2 clusters record, up what to register is 3, we can make sure tuft is 3.Find out the document allotment form 3 cluster records, up what to register is 4, we can make sure tuft is 4...... Until point 11 clusters, discover that next direction is a FF, is a be over. the document reads to complete then and the slightest and without any error.

We have a liking for again to face the third circumstance for speak of, is to delete b.txt hereafter, deposit a size as the d.txt of the 60.3 KBs.Make use of the chain of cluster can very easy realization.Carry out the disk of empress,such as figure,4.3.9?4.3.10?4.3.11

 

    The top is a kind of assumption that we saves to the document, also should uncover the time of the riddle bottom.The thought of the top is the essence of the thought of the fat document system in fact( but is not, be like the meaning of the concrete parameter particularly is totally different with the example that we raise.Please forget up the side detail, work hard to remember underneath).

Saving principle of the ★ FAT16:

When change into the fat document system to a part of disks space format, the fat document system divide this the area be carry on as the whole piece of dispensability of district programming, in order to in data of saving.Speak generally, it divides the line the form,such as figure,7 show.We withdraw out the part of FAT16, the detailed description is once:

The FAT16 is the document system that the Microsoft compares to release early, having the height and permitting sex, currently still extensive applied in personal computer particularly is to move in the saving equipments, the FAT16 speaks in brief from figure 4.3.12 show of 6 parts constitute.( mainly is front 5 part)Guide an area( DBR), we have already said, the FAT16 did not stay an area of any reservation after DBR, closing on the heels of afterward of would be the FAT form. The FAT form is a FAT16 to use to record the disk data area cluster chain structural.Be like the front example that we said, the FAT carry on an area that the disk space press certain number for the unit demarcation, such unit is called the cluster .Usually under circumstance, each area 512 principles of the word stanza are constant.Does the size of the cluster is a 2 ns generally?( The n is an integral) the size of the District, be like the 512 Bs,1 K,2 Ks,4 Ks,8 Ks,16 Ks,32 Ks,64 Ks.Actual medium usually not over 32 Ks. Of so cluster for unit but don't take an area as the allotment that the unit carries on the disk, is because be to divide the area capacity to compare big, the adoption size manages the number that would increase the fat form for an area of the 512 bs, accessing the increment depletion to the big document, the document system efficiency is not high.Size and clusters that divide the area take the value is relational, see the table 9?

 

   Attention:Little in in 32680 cent areas of the Districts, the cluster space size can attain 8 Districts of each cluster at most.Ignore the customer is to use the disk management machine to come to format to turn separately area, still the usage order hints to go to key-in the format order format to turn, the format turns the procedure to all establish a 12 FAT.Little in the cent area of the 16 MBs, the system usually will become its format 12 FAT, the FAT12 is a FAT beginning to start to carry out the form, is to aim at small scaled lie the quality. The FAT12 document allotment watch wants to compare the FAT16 and FAT32 documents to assign the form small, because it to the space that each article use less.This leave more space for data.3.5 inches of soft dishs of 5.25 inches of soft dishs with formatted useful FAT12 and 1.44 MBses are all to be is formatted by the FAT12.In addition to FAT watch win record eachly the binary system number and the FAT16 dissimilarities that the cluster chain knots, the rest principle and FAT16s are all same, no longer alone hermeneutic.

When format turn the FAT16 cent area, the format turns the procedure according to the size that the size of the area of the cent makes sure the cluster , then according to reserve the space that an area number, the data area disjunctive cluster number and FAT watches of the number, a catalogue of an area share to an area number that certain FAT form need, then as a result write in the DBR the calculation is behind of of related position.

FAT16?The parameter of DBR was partial to move the 0 x11s to record a number of area that a catalogue have.Was partial to move the 0 x16s to record a data of area that FAT form have.Was partial to move the 0 x10s to record the duplicate number of the FAT form.System at get this a few parameters hereafter, can was partial to move with an area of beginning of the assurance data area.

The FAT16 document system 32 Districts have from a catalogue after of the first area beginning take cluster as the unit to carry on the processing of the data, this still take an area as the unit before.For a cluster with after the first catalogue, system not serial number for 0 clusters or one cluster ( may be a reason that stays to make the key word), but the serial number is 2 clusters, is also the 1 cluster that says the in proper order top of the data area is also a serial number up of 2 clusters.

The reason that the FAT document system have 12,16, cent of edition of 32 dissimilarities, it basically lies in FAT watch's use to record arbitrarily the binary system number that the tuft chain connect.To take FAT16 as an example, the each tuft occupies 2 word stanza(16 of binary system)s in the FAT watch.So, the FAT16 is biggest can in token of of number of cluster for 0 xFFFFs( ten enter to make of 65535), with 32 Ks for cluster of the words of the size, the biggest disk space that the FAT32 can manage is: The 32 KB × 65535=2048 MBs, this be why the nonsupport of FAT16 divide the reason of the area over the 2 GBs.

The FAT watch is one piece actually according to the form, taking 2 word stanzas as the unit, we temporary be called this unit the FAT record item, usually its 1 and 2 records of circumstance item( ex-4 word stanzas) useds to lie the quality description.Start record the chain circumstance of cluster that clips in addition to a the catalogue other documents and document of outside from the third record item.Use to correspond according to the performance circumstance FAT of the cluster of take value to describe, see the table 10

   See an in the FAT16 that winhex cut of the document allotment form, figure 10:

 

    Such as the diagram, FAT watch with" F8?FF?FF?FF"?Beginning, in order to lie the quality description unit, this 2 word stanzas don't participate the FAT form cluster chain relation.What small red word mark out is one FAT area each 2 word stanzas to should of number of cluster .

Opposite be partial to move the 0 x4s~ the 0 x5s is partial to move for 2 clusters( in proper order top one cluster ), here for FF, mean saving at 2 document( catalogue) on the cluster ss are a small documents, taking up 1 cluster and then ended only.

The data deposit in 3 clusters is a 0 x0005s, this is a cluster that a document or documents clip.Its contents is 5 clusters, is to say that the next cluster locate 5 cluster s?D?The FAT watch of D 〉 guide we arrive the FAT form 5 cluster directions, the data that write up is" FF?FF", idea namely this document has already gone to the tail cluster .

The data deposit in 4 clusters is a 0 x0006s, this is a cluster that a document or documents clip again.Its contents is 6 clusters, is to say that the next cluster locate 6 clusters?D?The FAT watch of D 〉 guide we arrive the FAT form 6 cluster directions, the data that write up is a 0 x0007s, is to say that the next cluster locate 7 clusters?D?The FAT watch of D 〉 guide we arrive the FAT form 7 cluster direction ……s until read to according to the FAT chain an area is opposite to be partial to move the 0 x1As~0 x1Bs, also is 13 clusters, the data that write up is a 0 x000Es, is also a direction 14 clusters?D?The D 〉 14 contentses of the clusters is" FF?FF", idea namely this document has already gone to the tail cluster .

The FAT form data of the behind is same to the truth of the top.No longer analytical.

The description of FAT recorded the saving chain form of the disk data document, reading but talking for the data is very and important, with as for the Microsoft established a backup for the FAT form within the FAT document system that it develop, is the FAT2 that we see. The FAT2 and FAT1 contentses are usually instant synchronous, also is to say if read and write through a normal system to did to change to the FAT1, so the FAT2 also was equally renew.If see from this angle, this function of the system at the data recover is a natural calamity.

The catalogue structure of the FAT document system in fact is a have to of from the tree that the root arrived the leaf, speak of here of have to mean for the FAT divided the area inside of any document( included the document to clip), all needed to look for the address from a catalogue to find out.Can think thus:Catalogue the entrance of the saving structure is a catalogue.

The FAT document system looks for other documents( include the document to clip) of address according to a catalogue, hence the position of a catalogue must can make sure before the disk access data. The FAT document system be according to have already computed the good FAT watch(2) of depositting in the related parameter of DBR and DBRs of the area of cent of size to certain.The format turn hereafter, all have already settled down indeed with the size and positions of the catalogue in fact:After position close on the heels of FAT2, the size is usually 32 Districts.A catalogue woulds be the data area after 2 clusters.

An important thought of the FAT document system is to is regarded as a special document to the catalogue( the document clip) to handle, the FAT32 even regard as a catalogue the document processing( side: The NTFS will divide a lot of thing abstractions, such as area parameter and safe legal power...etc. to write an article a piece BE also this thought of sublimate), in the FAT16, although a catalogue position does not equal the common document to say perhaps to is a catalogue, the catalogue( the document clip) of its organized form and commonnesses without dissimilarity. The area of cent of FAT in all documents clip( catalogue) the document, can see make is a data form that deposits other documents( the document clip) entrance parameter actually.So the catalogue takes up the size of the space not to equal it all size of data, but also not equal 0.Usually is to have the pimping space of, can see make the catalogue document is one two form documents of weis that is simple.It concrete saving principle is:

Ignore the space that the catalogue document share is how much cluster , tuft is how much word stanza.The systems will take 32 word stanzas as the unit to carry on the allotment of the cluster that the catalogue document have.This 32 word stanzas is partial to move to define this catalogue with the assurance under of a document( or the document clip) belong to sex, is one two forms of weis that is simple actually.

The each word stanza of this 32 words stanza is partial to move the definition,such as table,11:

   To the table 11 medium of some take the value to carry on the elucidation:

(1) , For an of short composition, the system become the document honor and duties two parts carry on saving, namely the master document+ file extension. 0 x0s~ the 0 x7 word stanza records the master document of the document,0 x8s~ the 0 xAs records the file extension of the document, taking the ASCII code value within the document.Don't record the master document and"."between file extension?A character list with 8 shortage of master document fills with the blank sign(20 Hs),3 character list sames of the file extension shortage fill with the blank sign(20 Hs). The 0 x0s is partial to move the place to take the value if 00 Hs, enunciation the catalogue item for empty;If E5H, express that the catalogue item once be used for, but to should of document or document clip to have already is delete. ( This is also the theories that the mistake recovers after delete according to).The first character list within the document is if"." Or".." Mean what this cluster record is one catalogue item of the statures catalogue. "." Represent the current catalogue; ".." Represent the upper grade catalogue( is similar to us in dos or windowses of usage meaning, if the disk data is break, can pass the start position of the data area that the concrete parameter of these two catalogues item reckons the disk, guess the size etc. of the cluster , hence is more important)

(2) , The 0 xBs belongs to the sex word segment:Can see make the system use a word stanza of the 0 xBs is divided into 8, among them of a represent a certain belong to sex to have or have no.Thus,8 each ones within a word stanzas take the different value and can reflect the dissimilarity that each one belongs to sex to take to be worth.Such as 00000101 mean that this is a document, belong to sex to read only, system.

(3) ,0 xCs~ the 0 x15s reserve and did not use in the definition of the original FAT16.Sometimes also record to modify time and recent interview time with it in the system of WINDOWS of the high edition.So the meaning of its word segment is similar to FAT32 definition, seeing the back FAT32.

(4) ,0 x16s~ time in the 0 x17s= hour*2048+ minute*32+ second/2.Get as a result converts to 16 enter to make to stuff with.Also be: 0~ of the 0 x16 word stanza 4 with 2 second for unit of quantity be worth; 7 and 0~ of the 0 x17 word stanzas of 5~ of the 0 x16 word stanza 2 are minutes; 3~ of the 0 x17 word stanza 7 is hour.

(5) ,0 x18s~ date in the 0 x19s=( age-1980)*512+ month*32+ day.Get as a result converts to 16 enter to make to stuff with.Also be: 0~4 that days of the 0 x18 word stanza expect the number; 7 and the 0 x19 word stanzas of 5~ of the 0 x18 word stanza 0 are months; 1~ of the 0 x19 word stanza 7 are title of resigns, in the original righteousness 0~119 represent 1980~ respectively 2099, the Windows of the high edition allows to take 0~ currently 127, namely the title of resign is biggest and can be to 2107.

(6) ,0 x1As~ the 0 x1Bs deposits a cluster number that the document or catalogues mean the document, the system finds out the entrance in the FAT watch according to a cluster number that control, then follow the chain of cluster to keep to the tail of cluster , using the 0 x1Cs at the same time~ the 0 x1F word stanza judges the usefulness.Can completely and without any error read document( catalogue).

(7) , The common subdivision record of look for the address process also is pass its father catalogue is of the catalogue item to specify of, different from the data document( point the non- catalogue document) is the catalogue item is partial to move the 0 xBs 4 positions 1, but the data document is 0.

Divide the area but talk for the whole FAT, the allotment of the cluster always assigns the clean incompletely also.Is 99 systems of FAT of the Districts according to the area such as one piece, if the size of the cluster sets to 2 areas, would there are 1 Districts can't assign to the whichever cluster .This is separately an area of surplus of the area, locating the end tail of divide the area.Some systems use the DBR of an area of the last surplus backup duty area, this is also a kind of good backup method.

The early system of FAT16 have no long document on say, the operate system of Windows is already completely the long document support on the FAT16. The FAT16 the long document and FAT32ses grow the definition of the document is same, concerning the long document, in the FAT32 part again detailed make explain.

Saving principle of the ★ FAT32:

The FAT32 is a document system for having the achievement very much, the Microsoft design and make use of it successfully, the down to date NTFS is all over the place at the time that long come, does the FAT32 occupy the Microsoft still?Important position in the Windows document system. The FAT32 proceeded from big cent area, the unit cluster of nonsupport of FAT16's have great capacity at the earliest stage with the result that the nasty play of space waste etc. the weakness design.Physically in the application, the FAT32 is still successful.

The FAT32 and FAT16 principles are same basically, figure 4.3.13 marked out the FAT32 basic composing of the area of cent.

    The FAT32 is in formatted process set up to like its DBR according to the characteristics of the area of the cent, among them, the parameter of BPB is very important, can return overdo to take a look the table 4 and table 5.First the FAT32 reserves the number of an area to recognize tacitly to 32, not the FAT16 is only a.Such advantage is a length that contributes to the disk DBR instruction to expand, and can think a DBR area to stay the backup space.Top we have already speak of, setting up in the win98 or the win2000 on the FAT32, winXP, its operate system leading code has not only one District.An area of reservation that stays to have the surplus can with good expand the OS leading code.Also recorded an area serial number of backup of the DBR area in the BPB.An area of backup can let we at the disk was break by accident recover the DBR.

The FAT32 document assigns the data structure of the form still different from the FAT16 homology, is, the FAT32 will record the binary system number of the chain of cluster to expand to 32, hence this kind of document the department knows together as the FAT32. 32 The chain of cluster of a binary system comes to a decision the FAT watch biggest can look for a cluster of the address 2 T.Thus even the size of the cluster is 1 area, still can look for the cent area in the address 1 TB scope theoretically.But actual medium the FAT32 is to can't look for the address thus big of space of, along with cent the increment of the area space size, the FAT form record number and will become swollen and unbearable, the function of serious influence system.So in actually usually not the format turns to divide the area over the FAT32 of the 32 GBs. WIN2000 and on of OS already not support directly to become the FAT32 over the area format of cent of the 32 GBs, but the WIN98 can turn with the format still big divide the area to the FAT32 of the 127 GBs, but didn't be necessary thus also not recommend.At the same time the FAT32 also has the small restrict, FAT32 book must go to 65527 clusters, so for small cent area, still need to use the FAT16 or FAT12s.

Divide When the area become big, if the cluster is very small, the document allotment the watch also becomes big immediately.Still there will be the efficiency problem of top.Since want to read and write the big document availably, and then want the waste of the biggest and possible decrease space. The FAT32 ruled the area space of homologous cent equally to should of the size of the cluster , see the table 12:

    The FAT32 cluster takes to be worth the meaning similar to FAT16, just the number just grew to order, relatively seeing the table 13:

FAT32 of another an important reform is a document of catalogue to turn, will soon a catalogue equal the common document.Thus a catalogue has no FAT16 then in the restrict of 512 catalogues item, not enough use of time increase the cluster chain, allotment empty cluster then.And, the position of a catalogue also no longer the rigidity ground fixed, can save and can look for the address in divide area arbitrarily cluster inside, however usually a catalogue is a catalogue form build up at the earliest stage.So, the circumstance that we see is all the 1 cluster that a cluster of a catalogue has the in proper order top of the cluster area basically.Is also a painting that press this kind of circumstance creation in figure 4.3.12 of.

The FAT32 is to the serial number of the cluster still and together FAT16.In proper order still ascend the 1 cluster does the serial number is 2 clusters, usually is use by a catalogue?( this is different from FAT16, the FAT16 a catalogue does not have the cluster area space,32 a catalogues of the Districts hereafter is just the 1 cluster of the cluster area)

The FAT32 document look for to the address method is homology to FAT16, but each word stanza parameter meaning of the catalogue item is different from FAT16 have, on the other hand it was in use a reserved word of catalogue in the FAT16 segment, supporting the long document completely again at the same time.

For the catalogue item of a format of short composition.Its parameter meaning sees the table 14:

  Elucidation:

(1) , This is the meaning of a format of the FAT32 short composition catalogue item.Among them, the calculate way of the document, file extension, time, date is similar to hour of FAT16.

(2) , Because the FAT32 can look for the cluster number of the address to 32 binary systems to count.So the system also needs 32 at the time of recording the document( the document clip) beginning cluster address to record, the FAT32 is in use the catalogue item to be partial to move the 0 x12s~0 x13s to high 16 that mean the start cluster number.

(3) , The document length means with 4 word stanzas still, this explain that the FAT32 supports still and only small in the 4 GBs of document( catalogue), over the document( catalogue) of the 4 GBs, the system will cut off the processing.

FAT32 an important characteristics is long document of complete support.The long document is the record still in the catalogue item of.Read for the sake of the OS or procedure ability exactitudes of the low edition a document of long document, the system established for a document of all long documents automatically a to should of an of short composition, make to should data since can use long the document looks for the address, can also look for the address with an of short composition.The nonsupport grow the OS or procedures of the document and will neglect it thinks the illegal and long document name segment, but support long the OS or procedures of the document then would with long the document is named the show type item to record and edit, and conceal since an of short composition.

When establish a document of a long document, the system will plus the principle to should of an of short composition, it has generally automatically:

(1) , Ex-6 character listses that take the long documents plus an of"~1" formation short composition, the file extension is constant.

(2) , If have already existed this document, then sign"~" the numeral of empress passes to increase, until 5.

(3) , If the document in"~" behind of numeral attain 5, then an of short composition use two letter of alphabets of front of the long document only.Pass four letter of alphabets of empress of the born short composition an of surplus letter of alphabet that mathematics manipulates the long document, then add the suffix"~1" to keep till the last.( if necessary, or other numeral with avoid the repeated document)

(4) , If exist the character list that the old OS or procedures can't read, change with"_"

The realization of the long document depends on the catalogue item to be partial to move to belong to sex word stanza for the 0 xBs, being this word stanza of belong to sex is:Read, conceal only, system, a mark, namely when it be worth for the 0 FHs, the DOS and WIN32s will think it illegal but neglect it exist.An existent basis of this exactly long document.Place the 0 xBs of the catalogue item as the 0 F, other take office to be defined by the system, Windows9x or Windows?2000 , The XP usually supports not more than 255 long documents of character list.The system carries on the long document take 13 character lists as the unit to incise, each occupy a catalogue item.So possible several catalogues of document demand item, grow the each catalogue item of the document to press to pour the preface alignment at this time in the catalogue watch, in order to prevent confuse with other documents.

The character list adoption the unicode form within the long document code( a huge progress), each character list occupies 2 spaces of the word stanza.A definition of its catalogue,such as table,15.

    Elucidation:

(1) , This is the meaning of a format of the FAT32 short composition catalogue item.Among them, the calculate way of the document, file extension, time, date is similar to hour of FAT16.

(2) , Because the FAT32 can look for the cluster number of the address to 32 binary systems to count.So the system also needs 32 at the time of recording the document( the document clip) beginning cluster address to record, the FAT32 is in use the catalogue item to be partial to move the 0 x12s~0 x13s to high 16 that mean the start cluster number.

(3) , The document length means with 4 word stanzas still, this explain that the FAT32 supports still and only small in the 4 GBs of document( catalogue), over the document( catalogue) of the 4 GBs, the system will cut off the processing.

FAT32 an important characteristics is long document of complete support.The long document is the record still in the catalogue item of.Read for the sake of the OS or procedure ability exactitudes of the low edition a document of long document, the system established for a document of all long documents automatically a to should of an of short composition, make to should data since can use long the document looks for the address, can also look for the address with an of short composition.The nonsupport grow the OS or procedures of the document and will neglect it thinks the illegal and long document name segment, but support long the OS or procedures of the document then would with long the document is named the show type item to record and edit, and conceal since an of short composition.

When establish a document of a long document, the system will plus the principle to should of an of short composition, it has generally automatically:

(1) , Ex-6 character listses that take the long documents plus an of"~1" formation short composition, the file extension is constant.

(2) , If have already existed this document, then sign"~" the numeral of empress passes to increase, until 5.

(3) , If the document in"~" behind of numeral attain 5, then an of short composition use two letter of alphabets of front of the long document only.Pass four letter of alphabets of empress of the born short composition an of surplus letter of alphabet that mathematics manipulates the long document, then add the suffix"~1" to keep till the last.( if necessary, or other numeral with avoid the repeated document)

(4) , If exist the character list that the old OS or procedures can't read, change with"_"

The realization of the long document depends on the catalogue item to be partial to move to belong to sex word stanza for the 0 xBs, being this word stanza of belong to sex is:Read, conceal only, system, a mark, namely when it be worth for the 0 FHs, the DOS and WIN32s will think it illegal but neglect it exist.An existent basis of this exactly long document.Place the 0 xBs of the catalogue item as the 0 F, other take office to be defined by the system, Windows9x or Windows?2000 , The XP usually supports not more than 255 long documents of character list.The system carries on the long document take 13 character lists as the unit to incise, each occupy a catalogue item.So possible several catalogues of document demand item, grow the each catalogue item of the document to press to pour the preface alignment at this time in the catalogue watch, in order to prevent confuse with other documents.

The character list adoption the unicode form within the long document code( a huge progress) the system at the saving long document, always press to pour the preface to fill the long document title to record the item first, then follow close behind it to should of an of short composition.From the table 15 can see, in the long document not saving rightness should the document of the document start the cluster, document size, various time and dates belong to sex.Document of these belong to sex or deposit in a title of short composition to record in the item, a long document always is 11 rightnesses of with an of short composition that it correspond should, an of short composition had no the long document and can also read, but the long document if have no to should of an of short composition, no matter what systems it is will neglect it exist.So the short composition piece is to go to the pass important.In the environment of the nonsupport long document to the document within an of short composition and expand the name segment to make to change( include the deletion, because the deletion rewrites the E5H to a character list), will make a form of long document together nominal.The long document and contact light between an of short compositions are support by their position relation obviously and far and far not enough.In fact, the school of the 0 xD word stanza of the long document checks and rises the very important function, this school checks and passes a kind of operation method to get with 11 character lists of an of short composition.System according to homologous calculate way to certain whether the long document and an of short compositions match or not that correspond.This calculate way is not that easy to use the formula elucidation, we use a c procedure to take into the elucidation.

Suppose a 11 character lists of document constitute the string shortname[], the school checks and means with the chknum.Get the process as follows:

int?I, j, chknum=0;
for?(i=11;?i>0;?i--)
chksum?=?((chksum?&?1)???0x80?:?0)?+?(chksum?>>?1)?+?shortname[j++];

If check and be partial to with long 0 xDs within the document to move a data through the school that a calculation come out not equal.The system will not form couples they anyway of.

The basis grow the document and an of short composition to the catalogue item of definition, plus to the cluster of serial number and chain connect, the FAT32 top data read and then swim the blade enough to spare.

 

quanzhou tianli technolegy All Right Reserved© 2003-2004  Link To Us
Telephone :0086-0595-22841608   013305960800
E-mail:cailujin163.com QQ:280000895
WWW.TL800.COM