Forgive my confusion, then--but why is the VAU map address given as a sector number instead of a VAU number in the label sector? The catalog is give a 2-byte VAU number in the label, after all. Since the VAU size is also given in the label, a sector number is easily calculated from that.
I don't know
for certain why they coded those like that.
A sector number is what the low-level read/write primitive routines use.
VAU# is a layer above, concerned with files. - I can really only image it was coder convenience, when the Catalog is opened during mount as a file.
Also, maybe these values allowed the recovery program an easier task and a way to perform consistency checks. The VAU sector pointer + the VAU sector count could be related to the Catalog VRVN using the VAU size from the label. I would suspect, hey - no almost bet that the volume recovery code would perform checks on the consistency of these numbers.
The two check bytes. - Easy
To calculate set them both to 0xff. Then count the number of zero bits in the label sector.
//
// The volume label is checked with a simple checksum. This sum is calculated
// by setting the checksum bytes to 0xff, then counting the number of 0 bits
// in the sector. This value is stored in bytes 0x20..0x21. Validation is performed
// similarly.
//
// This routine checks that the sum in the label block is correct, based on the
// Z80 (PLM???) code.
//
bool COS6Volume::ValidateLabel( )
{
UINT BitCount = 0;
BYTE csum [ 2 ];
csum [ 0 ] = m_Buffer.Data [ 0x20 ];
csum [ 1 ] = m_Buffer.Data [ 0x21 ];
WORD sum = csum [ 0 ] + ( csum [ 1 ] << 8 );
m_Buffer.Data [ 0x20 ] = 0xff;
m_Buffer.Data [ 0x21 ] = 0xff;
//
// Count the zero bits in the block
//
for ( int i = 0; i < 256; i++ )
{
BYTE b = m_Buffer.Data [ i ];
for ( BYTE j = 0; j < 8; j++ )
{
if ( 0 == ( b & 0x80 ) )
BitCount++;
b <<= 1;
}
}
// Put checksum back, just in case.
m_Buffer.Data [ 0x20 ] = csum [ 0 ];
m_Buffer.Data [ 0x21 ] = csum [ 1 ];
return BitCount == sum;
}