2.2 addon-manager 2.4 project-setup
Simics Reference Manual  /  2 Command-Line Tools and Programs  / 

2.3 craff

SYNOPSIS

craff [options] [input-file ...]

DESCRIPTION

The compressed random access file format is used by Simics’s image module to handle sparse block data. The craff command line utility can be used to create and manipulate craff files.

The default operation is to merge the input files, each of which can be either in craff format, fixed-type VHD format, VHDX format, or raw files (e.g., disk or memory dumps) and to output the merged result to an output file. The order of the input files is important: data from later input files override earlier files. Since craff files can have holes (gaps) in them, data from earlier files can propagate to the result.

Each file argument is on the form filename[,start[,size[,offset]]] where start, size and offset are optional numerical parameters as follows:

start
Where the input file data should be placed in the output. If omitted, zero is assumed.
size
How much to use from the input file. By default, all data to the end of the file is used.
offset
Where in the input file to read the data. If omitted, zero is assumed.

For example, the argument myfile.craff,300,100,700 will take 100 bytes at offset 700 from myfile.craff and place them at offset 300 in the output.

OPTIONS

-o, --output=FILE

Specifies the output file name. Without this option, output will go to craff.out. A hyphen (-) means standard output, and implies -q. Writing to standard output is only possible in raw format (-d) or when writing a content map (-l).

-d, --decompress

Causes the output to be an ordinary (raw) file. The default is to output in the craff format. When this option is given, any holes in the output are filled with zero bytes.

--vhd

Causes the output to be in VHD (Windows Virtual Hard Disk) format. The generated file is always of the “Fixed hard disk” (non-sparse) type, holes filled with zero bytes.

--create=SIZE

Create a zero filled image of the specified size without using any input files.

-l, --content-map

Writes a human-readable map of the input files to the output. Blocks are marked D where data is present, and . (dot) where not.

-D, --diff

Instead of merging the input files, output the difference between the input files as a craff file. There must be exactly two input files. The output is the file that, when merged with the first file, would result in the second file. The input files may be in craff or raw format.

-z, --zero-fill-gaps

Fills gaps with zero bytes and marks them as present. Without this option, a gap in all input files will remain a gap in the output file.

-Z, --omit-zero-blocks

Treats blocks that consist entirely of zero bytes as empty in the output (i.e., they will be output as holes).

-b, --block-size=SIZE

Specifies the output block size in bytes. The size must be a power of 2, and may be specified in kilobytes using ‘k’ as a suffix. Without this option, the block size will be the smallest of the input files’ block sizes.

This is the smallest unit of storage in a craff file. Larger values compress better, but will waste more space if only part of the block is present. A block size of at least 4k is recommended.

-s, --sub-block-size=SIZE

Specifies the output sub-block size in bytes. The size must be a power of 2, and may be specified in kilobytes using ‘k’ as a suffix. Without this option, the block size will be the smallest of the input files’ sub-block sizes.

This is the smallest unit of granularity in a craff file. Smaller values allow more fine-grained control of what data is present, but use more space. For disk dumps, the sector size is useful (often 512 bytes); for memory dumps, use the page size (such as 4k or 8k).

-i, --dir-entries=N

Specifies the number of entries in each directory node. Must be a power of 2.

-c, --compression=COMPRESSION

Specifies the compression type: none or zlib. No compression is faster but zlib makes the files smaller.

-e, --extract=START

Extracts a block to the output file. The extracted block starts at file offset START and the size is given by --extract-block-size. The output is in raw format.

-w, --extract-block-size=SIZE

Size of block to extract with --extract.

-r, --resize=SIZE

Create an output file of the specified size, zero padding it if the input files are shorter than this size or truncating it if they are longer.

--verify

Verify the integrity of the input files.

-n, --info

Displays file information for each of the input files to the standard output.

-q, --quiet

Suppresses the progress indicator.

-v, --version

Displays version information of the craff utility itself.

-h, --help

Displays a summary of the command line options.

2.2 addon-manager 2.4 project-setup