NAME | SYNOPSIS | FEATURES | DESCRIPTION | ATTRIBUTES | SEE ALSO
#include <sys/flashctl.h>
FLASH
Note that use of this functionality requires the flash device be a supported Flite 1.2 device.
The flash device provides both a block device interface and a character device interface.
The block device interface can be used to mount a file system stored on the flash. It must also be used to perform the fsck_dos(1M) utility. I/O operations using the block device interface are buffered within the IOM
buffer cache.
The raw device interface may be used to read and write to the device as well to perform disklabel and newfs_dos operations. However, this mechanism bypasses the IOM
buffer cache. Moreover, I/O operations on the raw device must be sector aligned (512 bytes) for both the seek pointer and the size. Otherwise an error is returned to the read() or write() system calls.
Both drivers may be used to perform the following specific ioctl() system calls on the flash:
is used to perform defragmentation of the flash device in order to increase the number of physical flash sectors immediately writable. The system call is as follows: ioctlfdFLASH_DEFRAGMENT(int*)&value() where fd is an open file descriptor associated to the flash device and value is a pointer to an integer. This integer must be set prior to the call. It specifies the number of sectors which the user would like to have immediately writable. Upon completion, if no error occured, the integer pointed to by the ioctl third argument is updated with the current number of available and writeable sectors.
is used to tell the flash device driver that a range of physical sectors which have been previously written, and are therefore supposed to be busy, are now available again for writing. The system call is as follows: ioctlfdFLASH_SECTORETTE&delsect() where fd is an open file descriptor associated to the flash device and delsect is a pointer to a structure whose type is: flash_delsect_t
. This structure has two fields: start which tells the system which is the number of the first sector to delete and count which tells the system how many sectors should be deleted starting at sector start. This last ioctl() is used internally by the file system when a file is removed, and by the fsck_dos(1M) utility when it returns a sector to the free list. This ioctl() should be used with care.
allows you to format the flash device.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | ATTRIBUTES | SEE ALSO