PTABLE(5)

NAME
ptable - format of partition table structures

SYNOPSIS
#include <dev/partition.h>

DESCRIPTION
The partition table structure contains a list of the partitions on the st506 device. This list describes each of the filesystem partitions held on the disc.

The structure of the partition table structure as given in the include file is:

    /*
     *	This is the format of the (now variable) partition table
     *	which is set up by the disc formatter.
     */
    struct	partition_table	{
    	unsigned	part_magic;		/*  Magic number  */
    	struct	{
    		unsigned  long	part_start;	/*  Abs cylinder number  */
    		unsigned  long	part_size;	/*  No of cyls  */
    		unsigned  int	part_flags;	/*  Status  */
    		char	part_desc[16];		/*  Descriptive text  */
    	}  part_tab[8];
    };
    #define	PART_MAGIC	0x70617274
    /*
     *	Standard partition numbers.
     */
    #define	PART_ROOT	0
    #define	PART_SWAP	1
    #define	PART_BOOT	6
    #define	PART_ALL	7
    /*
     *	Status flags
     */
    #define	PART_STAT_CHANGE	0x80000000	/*  Has been changed  */
    #define	PART_STAT_NUNIX  	0x40000000	/*  UNIX not allowed  */
    #define	PART_STAT_NARTHUR	0x20000000	/*  Arthur not allowed  */
    /*
     *	Location of word giving ADFS partition size in cylinders.
     */
    #define	ADFS_GEOM_SECTOR 	0xC00
    struct	adfs_geom_sector	{
    	char		spare1[0x1B8];
    	unsigned  short	lowcurrentcyl;
    	unsigned  short	precompcyl;
    	unsigned  long	parkaddress;
    	unsigned  char	l2_secsize;
    	unsigned  char	secspertrack;
    	unsigned  char	heads;
    	char		spare2[0x1D0-0x1C3];
    	long		discsize;
    	char		spare3[0x1FC-0x1D4];
    	long		adfs_part_size_loc;
    };
    #define	ADFS_PART_CYLS(X) 	(((X) >> 8) & 0x0000ffff)
    #define	ADFS_PART_FMT(X) 	((X) & 0x0000000f)
    /*
     *	This format (type 1).
     */
    #define	ADFS_PART_FMT_TYPE1 	1
    /*
     *	Error codes ORed into return code.
     */
    #define	PART_FORMAT_ERROR 	1
    #define	PART_OVERLAP_ERROR 	2

The partition table and bad block list are contained in the same RISC iX system cylinder. This cylinder also provides the replacement sectors for the bad blocks. The location of this cylinder is held in the `adfs_part_size_loc' field in the `adfs_geom_sector'. This gives the size of the ADFS partition in cylinders. The RISC iX system cylinder is the last cylinder of the ADFS partition.

Two copies of each structure are held in the system cylinder for security.
    sector 0    1st partition table copy
    sector 1    2nd partition table copy
    sector 2    1st bad block list copy
    sector 3    1st bad block list copy
    sector 4    2nd bad block list copy
    sector 5    2nd bad block list copy
    sector 6    start of bad block replacement sectors

SEE ALSO
bbutil(8), bblist(5)