VxWorks Reference Manual : Libraries

nec765Fd

NAME

nec765Fd - NEC 765 floppy disk device driver

ROUTINES

fdDrv( ) - initialize the floppy disk driver
fdDevCreate( ) - create a device for a floppy disk
fdRawio( ) - provide raw I/O access

DESCRIPTION

This is the driver for the NEC 765 Floppy Chip used on the PC 386/486.

USER-CALLABLE ROUTINES

Most of the routines in this driver are accessible only through the I/O system. However, two routines must be called directly: fdDrv( ) to initialize the driver, and fdDevCreate( ) to create devices. Before the driver can be used, it must be initialized by calling fdDrv( ). This routine should be called exactly once, before any reads, writes, or calls to fdDevCreate( ). Normally, it is called from usrRoot( ) in usrConfig.c.

The routine fdRawio( ) allows physical I/O access. Its first argument is a drive number, 0 to 3; the second argument is a type of diskette; the third argument is a pointer to the FD_RAW structure, which is defined in nec765Fd.h.

Interleaving is not supported when the driver formats.

Two types of diskettes are currently supported: 3.5" 2HD 1.44MB and 5.25" 2HD 1.2MB. You can add additional diskette types to the fdTypes[] table in sysLib.c.

SEE ALSO

nec765Fd, VxWorks Programmer's Guide: I/O System


Libraries : Routines

fdDrv( )

NAME

fdDrv( ) - initialize the floppy disk driver

SYNOPSIS

STATUS fdDrv
    (
    int vector, /* interrupt vector */
    int level   /* interrupt level */
    )

DESCRIPTION

This routine initializes the floppy driver, sets up interrupt vectors, and performs hardware initialization of the floppy chip.

This routine should be called exactly once, before any reads, writes, or calls to fdDevCreate( ). Normally, it is called by usrRoot( ) in usrConfig.c.

RETURNS

OK.

SEE ALSO

nec765Fd, fdDevCreate( ), fdRawio( )


Libraries : Routines

fdDevCreate( )

NAME

fdDevCreate( ) - create a device for a floppy disk

SYNOPSIS

BLK_DEV *fdDevCreate
    (
    int drive,    /* driver number of floppy disk (0 - 3) */
    int fdType,   /* type of floppy disk */
    int nBlocks,  /* device size in blocks (0 = whole disk) */
    int blkOffset /* offset from start of device */
    )

DESCRIPTION

This routine creates a device for a specified floppy disk.

The drive parameter is the drive number of the floppy disk; valid values are 0 to 3.

The fdType parameter specifies the type of diskette, which is described in the structure table fdTypes[] in sysLib.c. fdType is an index to the table. Currently the table contains two diskette types:

Members of the fdTypes[] structure are:

    int  sectors;       /* no of sectors */
    int  sectorsTrack;  /* sectors per track */
    int  heads;         /* no of heads */
    int  cylinders;     /* no of cylinders */
    int  secSize;       /* bytes per sector, 128 << secSize */
    char gap1;          /* gap1 size for read, write */
    char gap2;          /* gap2 size for format */
    char dataRate;      /* data transfer rate */
    char stepRate;      /* stepping rate */
    char headUnload;    /* head unload time */
    char headLoad;      /* head load time */
    char mfm;           /* MFM bit for read, write, format */
    char sk;            /* SK bit for read */
    char *name;         /* name */
The nBlocks parameter specifies the size of the device, in blocks. If nBlocks is zero, the whole disk is used.

The blkOffset parameter specifies an offset, in blocks, from the start of the device to be used when writing or reading the floppy disk. This offset is added to the block numbers passed by the file system during disk accesses. (VxWorks file systems always use block numbers beginning at zero for the start of a device.) Normally, blkOffset is 0.

RETURNS

A pointer to a block device structure (BLK_DEV) or NULL if memory cannot be allocated for the device structure.

SEE ALSO

nec765Fd, fdDrv( ), fdRawio( ), dosFsMkfs( ), dosFsDevInit( ), rt11FsDevInit( ), rt11FsMkfs( ), rawFsDevInit( )


Libraries : Routines

fdRawio( )

NAME

fdRawio( ) - provide raw I/O access

SYNOPSIS

STATUS fdRawio
    (
    int      drive,  /* drive number of floppy disk (0 - 3) */
    int      fdType, /* type of floppy disk */
    FD_RAW * pFdRaw  /* pointer to FD_RAW structure */
    )

DESCRIPTION

This routine is called when the raw I/O access is necessary.

The drive parameter is the drive number of the floppy disk; valid values are 0 to 3.

The fdType parameter specifies the type of diskette, which is described in the structure table fdTypes[] in sysLib.c. fdType is an index to the table. Currently the table contains two diskette types:

The pFdRaw is a pointer to the structure FD_RAW, defined in nec765Fd.h

RETURNS

OK or ERROR.

SEE ALSO

nec765Fd, fdDrv( ), fdDevCreate( )