|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 8729 (0x2219) Types: TextFile Notes: UNIX file Names: »vtoc.h«
└─⟦a6ab2eb36⟧ Bits:30004042/kconfig3.imd SW95705I 386/ix Multi-user Release 1.2 └─⟦a6ab2eb36⟧ UNIX Filesystem └─⟦this⟧ »kc/new/usr/include/sys/vtoc.h«
/* 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.15 - 88/05/08" #define V_NUMPAR 16 /* maximum number of partitions */ #define VTOC_SANE 0x600DDEEE /* Indicates a sane VTOC */ #define V_VERSION 0x01 /* layout version number */ /* 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 /* Unmountable partition */ #define V_RONLY 0x10 /* Read only (except by IOCTL) */ #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 */ /* 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_GETERR (VIOC|7) /* Get last error */ #define V_EXERR (VIOC|8) /* Save extended errors */ #define V_NOEXERR (VIOC|9) /* Don't save extended errors (def) */ /* 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*/ }; 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 */ } ; /* Flags for Add Bad Sector command */ #define V_ABS_NEAR 1 /* Assign closest alternate available */ /* 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: */ unchar dp0_ctltype; /* Controller type (see below) */ unchar dp0_ctlflags; /* Controller-specific flags */ ushort dp0_secovhd; /* Controller's per-sector overhead */ } 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_ctltype dp_psense.dp0_ctl.dp0_ctltype #define dp_ctlflags dp_psense.dp0_ctl.dp0_ctlflags #define dp_secovhd dp_psense.dp0_ctl.dp0_secovhd /* 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 values of dp_ctltype are for different * controllers to allow user programs to do special stuff for them. * The flags bits are genericized below. */ #define DPCT_ST506 0x00 /* Stock AT controller */ #define DPCT_AD_ESDI 0x01 /* Adaptec "Norton" ESDI controller */ #define DPCT_AD_RLL 0x02 /* Adaptec "Eddie" RLL controller */ #define DPCT_AD_ARLL 0x03 /* Adaptec "Casper" ARLL controller */ #define DPT_CTLADAP 0x03 /* mask for Adaptec controllers */ /* Values for dp_ctlflags: */ #define DPCF_VALID 0x01 /* # of heads, cyls were gotten from drive. If not set, we're using defaults */ #define DPCF_SKEW 0x02 /* first sector of each track is skewed from index mark by <head#> physical sectors */ #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 */