DataMuseum.dk

Presents historical artifacts from the history of:

ICL Comet 32

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

See our Wiki for more about ICL Comet 32

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦ac72da4d2⟧ TextFile

    Length: 2829 (0xb0d)
    Types: TextFile
    Notes: UNIX file
    Names: »fdio.h«

Derivation

└─⟦26887b7e0⟧ Bits:30009717 Comet 32 harddisk image
    └─⟦28c352965⟧ »/a« UNIX Filesystem
        └─⟦this⟧ »usr/include/sys/fdio.h« 

TextFile

/*
 *  Floppy driver IO control.
 */

/*
 *  Call: ioctl(fd, command, &param).  Here fd is a file descriptor
 *  returned from an open call to a raw floppy device.  The commands
 *  are listed below:
 */

#define FDIOERROR	(('d'<<8)|1)	/* get last error */
#define FDIOCLEAR	(('d'<<8)|2)	/* clear last error */
#define FDIORESET	(('d'<<8)|3)	/* reset IO control state */
#define FDIOHARDRESET	(('d'<<8)|4)	/* hardware reset of MPS-1604 */
#define FDIORAMTEST	(('d'<<8)|5)	/* test the 6kB RAM on MPS-1604 */
#define FDIOREADY	(('d'<<8)|6)	/* test drive ready */
#define FDIORECAL	(('d'<<8)|7)	/* recalibrate */
#define FDIOFORMAT	(('d'<<8)|8)	/* format a diskette */
#define FDIOTEST	(('d'<<8)|9)	/* test all sectors on diskette */
#define FDIOSECTAB	(('d'<<8)|10)	/* select sector table (interleave) */
#define FDIOCONFIG	(('d'<<8)|11)	/* request configuration */
#define FDIOCOPYD	(('d'<<8)|12)	/* copy drives */

/*
 *  The third parameter is the address of a structure used to pass data
 *  to and from the driver.  Except for the 4 cases listed below it is
 *  not used and can be given as 0.
 *
 *  FDIOERROR returns full information on the last error on the drive
 *  in the following structure:
 */

struct fderror {
	unsigned char fde_code;		/* error code */
	int fde_block;			/* block address (-1 if not valid) */
	unsigned char fde_regs[8];	/* controller registers */
};

/*
 *  FDIOSECTAB and FDIOCONFIG take one parameter byte:
 *
 *  unsigned char sectab, config;
 *  ioctl(fd, FDIOSECTAB, &sectab)
 *  ioctl(fd, FDIOCONFIG, &config)
 *
 *  FDIOCOPYD takes two parameter bytes giving the source and destination:
 *
 *  unsigned char units[2];
 *  ioctl(fd, FDIOCOPYD, units)
 *
 *  For these 3 calls, any file descriptor referring to a raw floppy
 *  device can be used.
 */

/*
 *  Ioctl() returns -1 on all errors.  The variable errno is set to
 *  ENXIO or ENOTTY for bad fd, to EINVAL for illegal commands, to
 *  EFAULT for bad &param, and to EIO for floppy driver errors.  In the
 *  last case the FDIOERROR command can be used to get the error data. 
 *  The error codes are named below:
 */

#define FDEWRITEP	0x03	/* diskette write protected */
#define FDEREADY	0x04	/* drive not ready */
#define FDETRACKZ	0x06	/* no track 00 */
#define FDEBUSY		0x0e	/* format or copy in progress */
#define FDEID		0x10	/* CRC error in ID field */
#define FDEIDMARK	0x12	/* ID address mark not found */
#define FDEDATAMARK	0x13	/* DATA address mark not found */
#define FDERECORD	0x14	/* cylinder & head found but not record */
#define FDEBLOCK	0x19	/* CRC error in data field (bad block) */
#define FDECOMMAND	0x20	/* error in command */
#define FDEUNIT		0x21	/* illegal drive unit; bad sector table */
#define FDECOPY		0x24	/* copy of diskettes of different types */
#define FDERAM		0x30	/* RAM error (from RAM test) */