/usr/bin/dasdlist is in hercules 3.07-2.3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #!/bin/sh
#
# This command prints a track from a CKD DASD image file.
# It uses the Unix Octal Dump (od) command to firstly obtain
# the device geometry from the CKD header, and secondly to
# print the track in hexadecimal format.
#
filename=$1
cyl=$2
head=$3
if [ -z "$filename" ]; then
echo "Usage: dasdlist filename [cyl head]"
exit 1
fi
if [ ! -f $filename ]; then
echo "File $filename does not exist"
exit 1
fi
#
# Check the first 8 bytes of the header for valid CKD DASD image file
#
ckdid=`head -n 1 $filename | cut -c1-8`
if [ $ckdid != "CKD_P370" ]; then
echo "File $filename is not a CKD DASD image file"
exit 2
fi
#
# The next 8 bytes contain the tracks/cyl and track length constants
#
heads=`od -An -tu4 -j 8 -N 4 $filename`
trklen=`od -An -tu4 -j 12 -N 4 $filename`
heads=`expr $heads`
trklen=`expr $trklen`
echo "$filename $heads trks/cyl, $trklen bytes/trk"
#
# If cylinder number is not given then exit
#
if [ -z "$cyl" ] || [ -z "$head" ]; then
echo "To dump a track specify dasdlist $filename cyl head"
exit 0
fi
#
# Calculate the offset to the requested cylinder and track
#
offset=`expr 512 + '(' $cyl '*' $heads + $head ')' '*' $trklen`
num=`expr $trklen`
#
# Dump the requested track
#
echo "$filename Cyl $cyl Head $head"
echo "od -Ax -tx1 -j $offset -N $num $filename"
od -Ax -tx1 -j $offset -N $num $filename
|