PDA

View Full Version : FAT32 smash you into pieces


Stitcher
01-11-2005, 05:04 AM
Hello,
if this question of mine is in a wrong forum, please carry me to a right place...(hold me tight or I would fall down!)

I really admire those who made FORMAT command...Could you tell me what is inside FORMAT command ?
Thanks

Rick
01-11-2005, 09:03 AM
If you want to know what the command line switches are
Just run the command from a dos prompt. a dos window , or if in win2k/Xp use the CMD from the run in start menu.
and enter the command with /?
"format /?" without the quotes ""

It will give you a long list of the possible uses..

pop pop
01-12-2005, 03:02 AM
I'm not sure I understand the question but I guess you got it right, Rick.

Could you tell me what is inside FORMAT command ?


Just in case...

Another angle: It's a binary file, an executable (.exe/program/application). Inside it consists of a whole bunch of ones and zeros (thus the name binary). The ones and zeros effectively tell the CPU how to prepare the device (HD, floppy, etc) to accept and store "stuff" as well as how the device will behave after it is prepared (e.g., bootable, non-bootable, etc). The ones and zeros used to be source code--text. The text source code was converted to 101010101010's and the .exe binary file created by a compiler--itself a binary file/.exe and a real thing of beauty.

Was I assuming too much...or too little here? If so---

NEVER MIND :D

Stitcher
01-12-2005, 04:19 AM
Thank you both gurus for your replies,
I only know that FAT is located between the boot sector and the root directory and is automatically generated during formatting with FORMAT command. Its still so vague to me about how OS (correct ?) reads this command, I really need to see an easily understandable picture of how things work "inside computers"...


pop pop, your assumption is in the middle, not much not little :p , and thats why I say "thanks for your reply", and also means I KARE :D

Paul Komski
01-12-2005, 03:37 PM
The FATs are, as you say, between the boot sector and the root directory and can be examined with a disk hex editor. There are two of them - one being a replica of the other. There exact positions and size are dependent on the size of the partition and of various values stored in the partition boot sector (including the numbers of sectors per cluster). Each entry occupies one and a half bytes (3 nibbles) for FAT12 (typically seen on a floppy), two bytes for FAT16 and four bytes for FAT32. Their sequence represents the same sequence of all the clusters that start at the beginning of the root directory (with the exception possibly of the first two such clusters). They indicate whether the cluster that they represent is available, in use or bad. If the cluster is in use they provide the method for linking together all the elements of the file and they have a particular value when they represent a cluster that contains the end of the file.

Possibly the simplest way to play around with them and examine them is by formatting a floppy, examine it with a hex editor and then add one file to the floppy and go back and re-examine it. Etc, etc.

When the format program is run it scans the size of the partition, and rewrites a new partition boot sector and FATs. What it does to the root directory and the remaining data depends on whether it is a full or quick format and whether it is FAT or NTFS (or some other file system with many other third party formatters).

Hope that helps.