The primary difference between devio and other command line utilities, such as dd and cat, is that it is not stream based - it writes directly into the object rather than reading and writing a stream of data.
At present devio must be built from the CVS source. The devio project page on SourceForge contains the information needed to access the CVS source tree. The source is built using the widely uses GNU autoconf tools. When building from CVS you must have a full set of these tools installed. You may then build using the following sequence of commands:
This creates the devio program in the src sub-directory, it can be installed (by default into /sbin) by typing make install.
devio is controlled by a sequence of commands given on the devio command line. These commands support a number of different operations:
The command syntax is designed to be easy to parse, reducing the size of devio, but is consequently somewhat cryptic. By default the devio build compiles in help. devio with no arguments outputs a very basic usage message.
devio -h commands
Gives a list of the commands. For more information, including examples, read the devio manual.
IO in devio is optimised for reading and writing sections of block devices. The main consideration is to restrict all accesses to the device to whole device blocks aligned to a device block boundary. Standard stdio implementations do the same thing, however this is not guaranteed by the stdio API. In addition devio performs all write operations as read-modify-write, with the write only being done if the modify really changed some data. This is important with flash (MTD) devices where a write requires an erase and reduces the life of the flash device.
devio write operations are fully synced, using the fdatasync(2) system call, and fully checked for error conditions.
The additional features of the devio commands are intended to facilitate operations where it is necessary to interpret information contained within the device. This frequently happens during system bootstrap of embedded systems where the flash memory contains important configuration data.