Printed 1/6/92 Page 1
TPD(5spp) RISC/os Reference Manual TPD(5spp)
NAME
tpd - format of MIPS boot tape directories
SYNOPSIS
#include <saio/tpd.h>
DESCRIPTION
Boot tapes that can be read by the MIPS PROM monitor contain
a directory that allows the commands and records on the tape
to load by name rather than by physical record number. Boot
tapes are produced by the command mkboottape(8).
A boot tape consists of a number of physical tape files,
where each file may optionally contain a tpd directory
describing the contents of that physical file. The PROM
monitor provides a syntax for referencing a named record on
a boot tape (see the MIPS PROM MONITOR documentation).
All binary values in the tpd directory are 2's complement,
big-endian regardless of target machine. The tpd checksum
is calculated by first zeroing the td_cksum field, then 2's
complement summing all 32 bit words in the struct tp_dir and
then assigning the 2's complement of the cksum to td_cksum.
Thus the checksum is verified by resumming the header and
verifying the sum to be zero. Each tape record is
TP_BLKSIZE bytes long, trailing bytes in a tape block (after
the end of the directory or an end of file) are unspecified
(although they should be zero). All files start on a tape
block boundry; the start of a particular file may be found
by skipping backward to the beginning of the file containing
the tape directory and then skipping forward tp_lbn records.
The format of the tpd directory is:
#define TP_NAMESIZE 16
#define TP_NENTRIES 20
#define TP_BLKSIZE 512
#define TP_MAGIC 0xaced1234
#ifdef LANGUAGE_C
/*
* tape directory entry
*/
struct tp_entry {
char te_name[TP_NAMESIZE]; /* file name */
unsigned te_lbn; /* tp record num */
/* 0 is tp_dir */
unsigned te_nbytes; /* file byte count */
};
/*
* boot tape directory block
Printed 1/6/92 Page 1
TPD(5spp) RISC/os Reference Manual TPD(5spp)
* WARNING: must not be larger than 512 bytes!
*/
struct tp_dir {
unsigned td_magic;
unsigned td_cksum; /* csum of tp_dir */
unsigned td_spare1;
unsigned td_spare2;
unsigned td_spare3;
unsigned td_spare4;
unsigned td_spare5;
unsigned td_spare6;
struct tp_entry td_entry[TP_NENTRIES]; /* directory */
};
union tp_header {
char th_block[TP_BLKSIZE];
struct tp_dir th_td;
};
#endif LANGUAGE_C
te_name is a null-terminated string. The td_magic field
contains TP_MAGIC to help verify the presence of a header.
RESTRICTIONS
SEE ALSO
mkboottape(8)
MIPS System Programmers Package Guide
Page 2 Printed 1/6/92