"Formatting" is done by writing a new file system.
Could be : 'mkdosfs' or 'mkfs.ext2'.
Get a list with : 'ls -l /sbin/mk*
Example command : # mkfs.vfat /dev/sdc1
Information about the commands, e.g. : 'man mkdosfs'
And the source code, if you wish, download it,
.. then you can read the code.
.....
|