The ultimate purpose of a file system device is to hold data. Consequently, two major operations that can occur on a device are the reading and writing of individual sectors. Five additional operations can be performed which affect not just individual sectors, but the whole device:
- A device can be opened. During the opening of a device, it is initialized and its characteristics are determined (sector size, number of sectors, vendor).
- A device can be partitioned. Partitioning divides the final unallocated portion of the device into two parts, so that a volume could be located on each (see Partitions).
- A device can be low-level formatted. Some device must be low-level formatted before being used.
- A device can be (high-level) formatted. (High-level) formatting writes the control information for a file system to a device so that a volume on it can be mounted. Essentially, (high-level) formatting is the process of creating a volume on an empty device or partition.
- A device can be closed. During the closing of a device, it is uninitialized (if necessary) and associated structures are freed.
These operations and the corresponding API functions are discussed in this section. For information about using device names, see µC/FS Device and Volume Names.