int FSformat( char mode, long int serialNumber, char * volumeID );
The FSformat function can be used to create a new boot sector on a device, based on the information in the master boot record. This function will first initialize the I/O pins and the device, and then attempts to read the master boot record. If the MBR cannot be loaded successfully, the function will fail. Next, if the 'mode' argument is specified as '0' the existing boot sector information will be loaded. If the 'mode' argument is '1' an entirely new boot sector will be constructed using the disk values from the master boot record. Once the boot sector has been successfully loaded/created, the locations of the FAT and root will be loaded from it, and they will be completely erased. If the user has specified a volumeID parameter, a VOLUME attribute entry will be created in the root directory to name the device.
The device must possess a valid master boot record.
Parameters |
Description |
mode |
|
serialNumber |
Serial number to write to the card |
volumeID |
Name of the card |
Return Values |
Description |
0 |
Format was successful |
Format was unsuccessful |
The FSerrno variable will be changed.