DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦f9c7ff822⟧ TextFile

    Length: 11100 (0x2b5c)
    Types: TextFile
    Notes: UNIX file
    Names: »vtoc.h«

Derivation

└─⟦5fb5a153b⟧ Bits:30004042/hpdd.imd SW95705I 386/ix Multi-user Release 1.2
└─⟦5fb5a153b⟧ UNIX Filesystem
    └─⟦this⟧ »hp/new/usr/include/sys/vtoc.h« 

TextFile

/*	Copyright (c) 1987 AT&T	*/
/*	  All Rights Reserved  	*/

/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
/*	The copyright notice above does not evidence any   	*/
/*	actual or intended publication of such source code.	*/

/*
 * VTOC.H
 */
#ident  "@(#)vtoc.h	1.14 - 88/03/15"

#define V_NUMPAR        16              /* maximum number of partitions */

#define VTOC_SANE       0x600DDEEE      /* Indicates a sane VTOC */
#define V_VERSION       0x02            /* layout version number */

/*
 * V_VERSION HISTORY:
 *      1  --   Initial release
 *      2  --   Added V_REMAP flag to p_flag field so that alternate sector
 *              mapping could be enabled/disabled on a per-partition basis.
 *              Driver turns this bit on for all partitions (except 0) for
 *              a version 1 VTOC.
 *              (386/ix release 1.1, DLP)
 */

/* Partition identification tags */
#define V_BOOT		0x01		/* Boot partition */
#define V_ROOT		0x02		/* Root filesystem */
#define V_SWAP		0x03		/* Swap filesystem */
#define V_USR		0x04		/* Usr filesystem */
#define V_BACKUP	0x05		/* full disk */
#define V_ALTS          0x06            /* alternate sector space */
#define V_OTHER         0x07            /* non-unix space */

/* Partition permission flags */
#define V_UNMNT         0x01            /* non-mountable partition */
#define V_RONLY         0x10            /* Read only (except by IOCTL) */
#define V_REMAP         0x20            /* do alternate sector mapping */
#define V_OPEN          0x100           /* Partition open (for driver use) */
#define V_VALID         0x200           /* Partition is valid to use */
#define V_VOMASK        0x300           /* mask for open and valid */

/* Sanity word for the physical description area */
#define VALID_PD		0xCA5E600D

struct partition	{
	ushort p_tag;           /*ID tag of partition*/
	ushort p_flag;          /*permision flags*/
	daddr_t p_start;        /*physical start sector no of partition*/
	long p_size;            /*# of physical sectors in partition*/
};

struct vtoc {
	unsigned long v_sanity;			/*to verify vtoc sanity*/
	unsigned long v_version;		/*layout version*/
	char v_volume[8];			/*volume name*/
	ushort v_nparts;			/*number of partitions*/
	ushort  v_pad;                          /*pad for 286 compiler*/
	unsigned long v_reserved[10];		/*free space*/
	struct partition v_part[V_NUMPAR];	/*partition headers*/
};



struct pdinfo	{
	unsigned long driveid;		/*identifies the device type*/
	unsigned long sanity;		/*verifies device sanity*/
	unsigned long version;		/*version number*/
	char serial[12];		/*serial number of the device*/
	unsigned long cyls;		/*number of cylinders per drive*/
	unsigned long tracks;		/*number tracks per cylinder*/
	unsigned long sectors;		/*number sectors per track*/
	unsigned long bytes;		/*number of bytes per sector*/
	unsigned long logicalst;	/*sector address of logical sector 0*/
	unsigned long errlogst;		/*sector address of error log area*/
	unsigned long errlogsz;		/*size in bytes of error log area*/
	unsigned long mfgst;		/*sector address of mfg. defect info*/
	unsigned long mfgsz;		/*size in bytes of mfg. defect info*/
	unsigned long defectst;		/*sector address of the defect map*/
	unsigned long defectsz;		/*size in bytes of defect map*/
	unsigned long relno;		/*number of relocation areas*/
	unsigned long relst;		/*sector address of relocation area*/
	unsigned long relsz;		/*size in sectors of relocation area*/
	unsigned long relnext;		/*address of next avail reloc sector*/
/* the previous items are left intact from AT&T's 3b2 pdinfo.  Following
   are added for the 80386 port */
	unsigned long vtoc_ptr;         /*byte offset of vtoc block*/
	unsigned short vtoc_len;        /*byte length of vtoc block*/
	unsigned short vtoc_pad;        /* pad for 16-bit machine alignment */
	unsigned long alt_ptr;          /*byte offset of alternates table*/
	unsigned short alt_len;         /*byte length of alternates table*/
};

/* driver ioctl() commands */
#define VIOC            ('V'<<8)
#define V_CONFIG        (VIOC|1)        /* Configure Drive */
#define V_REMOUNT       (VIOC|2)        /* Remount Drive */
#define V_ADDBAD        (VIOC|3)        /* Add Bad Sector */
#define V_GETPARMS      (VIOC|4)        /* Get drive/partition parameters */
#define V_FORMAT        (VIOC|5)        /* Format track(s) */
#define	V_PDLOC		(VIOC|6)	/* Ask driver where pdinfo is on disk */
#define V_EXERRCTL      (VIOC|7)        /* Extended Error Control (arg is ON/OFF) */
#define V_GETERR        (VIOC|8)        /* Get extended error value */
#define V_RETRYCTL      (VIOC|9)        /* Retry control (arg is ON/OFF) */
#define V_DEFECTS       (VIOC|10)       /* Get defect list from drive */
#define V_FMTDRV        (VIOC|11)       /* Format entire drive (NOTE: This */
					/* is only valid if DPCF_NOTRKFMT */
					/* is set in dp_drvflags of V_GETPARMS */
					/* data for partition 0 of drive) */

/* buffer for Get Defect List return.  Pointer at an array of these structs
 * should be in ia_def.defs on IOCTL call.  On return, ia_def.ndef of these
 * entries (max 50 currently, but could expand later on) will have been
 * filled in. */

struct  v_defect
	{
	ushort  def_cylin;              /* cylinder number of defect */
	ushort  def_offset;             /* byte offset from index */
	ushort  def_len;                /* defect length in bits */
	};

/* the structures used for passing arguments to IOCTL.  This union is used
 * for all non-int types of arguments */

union   io_arg {
	struct  {
		ushort  ncyl;           /* number of cylinders on drive */
		unsigned char nhead;    /* number of heads/cyl */
		unsigned char nsec;     /* number of sectors/track */
		ushort  secsiz;         /* number of bytes/sector */
		} ia_cd;                /* used for Configure Drive cmd */
	struct  {
		ushort  flags;          /* flags (see below) */
		daddr_t bad_sector;     /* absolute sector number */
		daddr_t new_sector;     /* RETURNED alternate sect assigned */
		} ia_abs;               /* used for Add Bad Sector cmd */
	struct  {
		ushort  start_trk;      /* first track # */
		ushort  num_trks;       /* number of tracks to format */
		ushort  intlv;          /* interleave factor */
		} ia_fmt;               /* used for Format Tracks cmd */
	ushort  ia_fmtdrv_intlv;        /* used for Format Drive command */
	struct  {
		ushort  head;           /* Head number */
		ushort  ndef;           /* RETURNED number of defects on head */
		struct v_defect *defs;  /* pointer at defects buffer */
		} ia_def;               /* used for Get Defect List cmd */
} ;

/* Flags for Add Bad Sector command */
#define V_ABS_NEAR      1       /* Assign closest alternate available */

/* int-style arg for V_EXERRCTL */
#define V_EXERR_ON      1L      /* Turn extended error code acquisition ON */
#define V_EXERR_OFF     2L      /* Turn extended error code acquisition OFF (default) */

/* int-style arg for V_RETRYCTL */
#define V_RETRY_ON      1L      /* Turn ECC and Retries ON (default) */
#define V_RETRY_OFF     2L      /* Turn ECC and Retries OFF */

/* data structure returned by the Get Parameters ioctl: */

struct  disk_parms {
	char    dp_type;                /* Disk type (see below) */
	unchar  dp_heads;               /* Number of heads */
	ushort  dp_cyls;                /* Number of cylinders */
	unchar  dp_sectors;             /* Number of sectors/track */
	ushort  dp_secsiz;              /* Number of bytes/sector */
					/* for this partition: */
	ushort  dp_ptag;                /* Partition tag */
	ushort  dp_pflag;               /* Partition flag */
	union   {                       /* value depends on partition # */
		struct  {               /* returned for partition 0: */
		uint dp0_secovhd   : 8; /* Controller's per-sector overhead */
		uint dp0_rsrvdcyls : 3; /* # of reserved cylinders from total */
		uint dp0_intlv     : 4; /* Interleave factor (0 if unknown) */
		uint dp0_skew      : 3; /* Sector skew factor (per head) */
					/* Meaningful only if dp0_intlv == 1 */
					/* If intlv == 1 & skew == 0, unknown */
		uint dp0_ctlflags  : 14; /* Controller-specific flags */
			} dp0_ctl;
		daddr_t dp1_pstartsec;  /* returned for any other partition */
		} dp_psense;
	daddr_t dp_pnumsec;             /* Number of sectors */
	};

/* to make getting at things in the union (above) make some kind of sense */

#define dp_pstartsec    dp_psense.dp1_pstartsec
#define dp_rsrvdcyls    dp_psense.dp0_ctl.dp0_rsrvdcyls
#define dp_ctlflags     dp_psense.dp0_ctl.dp0_ctlflags
#define dp_secovhd      dp_psense.dp0_ctl.dp0_secovhd
#define dp_interleave   dp_psense.dp0_ctl.dp0_intlv
#define dp_skew         dp_psense.dp0_ctl.dp0_skew

/* Disk types for disk_parms.dp_type: */
#define DPT_WINI        1               /* Winchester disk */
#define DPT_FLOPPY      2               /* Floppy */
#define DPT_OTHER       3               /* Other type of disk */
#define DPT_NOTDISK     0               /* Not a disk device */

/* For partition 0 (which always starts at physical sector 0) various
 * other information is encoded in the dp0_ctl structure which is used
 * instead of dp_pstartsec.  The value of dp0_rsrvdcyls should be
 * SUBTRACTED from dp_cyls before any calculations are done.
 * The flags bits are genericized below. */

/* Values for dp_ctlflags: */
#define DPCF_NOTRKFMT   0x02    /* Controller cannot format individual tracks
				   Only the entire drive can be formatted */
#define DPCF_BADMAP     0x04    /* Bad sector map is available from drive */
#define DPCF_CHGHEADS   0x08    /* Legal to change the number of heads */
#define DPCF_CHGSECTS   0x10    /* Legal to change the number of sectors/track */
#define DPCF_CHGCYLS    0x20    /* Legal to change the number of cylinders */
#define DPCF_CHGSECSIZ  0x40    /* Legal to change the sector size */
#define DPCF_NOALTS     0x80    /* No software alternates support */

#ifdef	IOCTL_ERROR
/* Errors which may be retrieved with an ioctl when IOCTL_ERROR is used.  */

/* Error message types */

#define	FD_NOARGS	0		/* No arguments are applicable */
#define	FD_TRKERR	1		/* Track number is applicable */
#define	FD_BLKERR	2		/* Block number is applicable */

#define	FD_ENOERROR	0		/* No error */
#define	FD_ECMDTIMEOUT	1		/* command timeout */
#define	FD_ESTATIMEOUT	2		/* status timeout */
#define	FD_EBUSY	3		/* busy */
#define	FD_EMISSDADDR	4		/* Missing data address mark */
#define	FD_EBADCYL	5		/* Cylinder marked bad */
#define	FD_EWRONGCYL	6		/* Seek error (wrong cylinder) */
#define	FD_ECANTREAD	7		/* Uncorrectable data read */
#define	FD_EBADSECTOR	8		/* Sector marked bad */
#define	FD_EMISSHADDR	9		/* Missing header address mark */
#define	FD_EWRITEPROT	10		/* Write protected */
#define	FD_ESECNOTFND	11		/* Sector not found */
#define	FD_EDATAOVRUN	12		/* Data overrun */
#define	FD_EHCANTREAD	13		/* Header read error */
#define	FD_ILLSECT	14		/* Illegal sector */
#define	FD_EDOOROPEN	15		/* Door open */

typedef	struct lasterr_t {
	char	number;
	char	type;
	union	{
		int	trk;
		int	blk;
	} arg1;
} lasterr_t;
#endif	/* IOCTL_ERROR */