cckd man page

cckd — Hercules Compressed Ckd Dasd image file

Description

Hercules Dasd image file that emulates IBM mainframe Dasd devices on a (usually) non-mainframe platform. Specified in the Hercules configuration file (default name hercules.cnf) to describe the Dasd devices Hercules is to emulate. Also specified as input and/or output file to several Hercules utilities. Hercules compressed Dasd devices are frequently referred to as Cckd. Hercules uncompressed Dasd devices are frequently referred to as Ckd. Hercules Ckd Dasd image files are largely compatible with P/390 AWS Dasd files.

Technical Overview

The following provides a technical overview of Cckd internal structures. Except as indicated below, data in the following structures is stored in the byte order indicated by the Cdevhdr.options CCKD_BIGENDIAN bit (the 0x02 bit). This bit is 1 when data is big-endian byte order, 0 when data is little-endian byte order.

Devhdr

occupies the first 512 bytes of a Ckd or Cckd Dasd file. The Devhdr contains the device type and the number of heads per cylinder. Its contents are the same whether the Dasd image is compressed (Cckd) or not (Ckd). Described by the CKDDASD_DEVHDR struct; 512 bytes in size.

Cdevhdr

immediately follows the Devhdr, and contains fields describing the number of L1ENTs in the L1tab, the number of L2ENTs in each L2tab, and anchors the free space chain. Described by the CCKDDASD_DEVHDR struct; 512 bytes in size.

L1tab

immediately follows the Cdevhdr, and consists of L1ENT entries, each of which points to an L2tab. Each L1ENT is an U32 (4 bytes) offset into the Cckd Dasd file. The Cdevhdr numl1tab field describes how many L1ENTs are in the L1tab. L1ENTs are described by the CCKD_L1ENT typedef; the L1tab is of variable size. Conceptually each L1ENT describes cdevhdr.numl2tab tracks.

L2tab

is pointed to by an L1ENT, and is composed of L2ENT entries, the number of which is described by the Cdevhdr numl2tab field; currently 256 L2ENTs in each L2tab. L2ENTs contain the offset to the Trkhdr, and the combined length of the Trkhdr and (optionally) compressed track data. The Cdevhdr numl2tab field describes how many L2ENTs are in each L2tab. Currently, there are 256 L2ENTs in each L2tab. Described by the CCKD_L2ENT struct; (256 * 8) bytes in size. Conceptually each L2ENT describes one track.

Freeblk

describes free space in the Cckd Dasd image, anchored by the Cdevhdr free field. Consists of a 4 byte offset to the next free space (or zero for end of free space chain), and a 4 byte length of the free space (which length includes the 8 bytes occupied by the Freeblk itself), followed by zero or more bytes of residual data. Described by the first 8 bytes of the CCKD_FREEBLK struct; 8 bytes in size.

Trkhdr

Occurs once at the beginning of each track. contains flag (one byte), CC (two bytes), and HH (two bytes) of the track. When the flag byte = 0x00, Trkhdr is the same as the Home Address on real Dasd. Flag bits are described in hercules.h, and are of the format nlllllcc where n=1 for new track header format, lllll is used for track recovery purposes, and cc describes the track compression algorithm. The compression algorithms are: B'00' = uncompressed, B'01' = zlib, B'10' = bzip2, B'11' is currently invalid. Data in Trkhdr is stored in big-endian byte order. Described by the CKDDASD_TRKHDR struct; 5 bytes in size.

COUNT field

8 bytes, containing CC (two bytes), HH (two bytes), R (one byte), KL (one byte), and DL (two bytes). CC is the (relative zero) cylinder number. HH is the (relative zero) head number. R is the (relative zero) record number on the track. KL is the key length; if zero no key is present. DL is the length of the data record. Data in the COUNT field is stored in big-endian byte order. Described by the CKDDASD_RECHDR struct; 8 bytes in size.

KEY field

if present, KL bytes of record key; immediately follows the COUNT field. Byte order is not a factor for the KEY field; to the extent it is examined by Hercules code it is simply a byte stream. Size varies.

DATA field.

if present, DL bytes of record data; immediately follows the KEY field for keyed record, else immediately follows the COUNT field for unkeyed records. Byte order is not a factor for the DATA field; to the extent it is examined by Hercules code it is simply a byte stream. Size varies.

Glossary

Ckd

Count, Key, Data - contents of an track. Also refers to the Hercules uncompressed Dasd image file.

Cckd

Compressed Count, Key, Data - compressed contents of a track. Also refers to the Hercules compressed Dasd image file.

Dasd

Direct Access Storage Device - term the IBM mainframe world uses to refer to hard drives.

Eot

End Of Track - indicated by 8X'FF' in the COUNT field.

See Also

http://www.hercules-390.org/ the Hercules emulator homepage.
http://www.hercules-390.org/cckddasd.ht… which describes
the Hercules Cckd Dasd facility.
http://www.hercules-390.org/hercconf.ht… which describes
the Hercules configuration file.

History

2003-02-07 originally written by James M. Morrison

Referenced By

cckddiag(1), dasdseq(1).

2003-02-03