HPlogo HP-UX Reference Volume 5 of 5 > f

floppy(7)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

floppy — direct flexible or ``floppy'' disk access

DESCRIPTION

Flexible disk devices are removable-media disk devices that are typically used to share data with other systems. Media types are identified by physical size (such as 3.5-inch and 5.25-inch), number of data surfaces (or sides), and data density. By convention, flexible disk devices are named using the same conventions as those used for other disk devices (see disk(7)).

Data can be stored on flexible disk media in a variety of logical formats. The capacity of these devices is generally too small to hold useful HP-UX file systems. Instead, DOS or LIF file systems (see dosif(4) and lif(4) for a detailed description of these file systems) are commonly used. Data can also be stored in an archive-utility format. For example, tar and cpio are commonly used to share data with other HP-UX systems (see tar(1) and cpio(1)).

Logical volumes are not supported on flexible disks. The floppy disk does not support partitions. Section zero (0) is the only accessible partition.

In addition to the various logical formats, data can be stored on flexible disk media in a variety of physical data formats called geometries. The following parameters are used to describe a flexible disk geometry:

heads

Number of surfaces (or sides) on the media that contain valid data.

tracks

Number of tracks on a single media surface or side (the term cylinders is sometimes also used). This value does not include spare tracks.

sectors

Number of sectors in a single track. The number of sectors that can fit on a track depends on the bit density (as controlled by transfer rate and media rotation rate) and the sector size.

sector size

Number of bytes in a logical sector. Since all I/O operations must be an integral number of sectors in length, this parameter also indicates the minimum character-special file I/O size.

transfer rate

Media data rate in Kbits per second. The transfer rate is an indirect means of representing bit density. Bit density is measured in bits per radian, and is the formal intra-track data density parameter for standard specification. Transfer rate is generally used to program flexible media devices and is therefore more appropriate for this interface. Since the media rotation rate for most flexible disk devices is standard, conversion between these two representations is straight-forward.

track density

Number of tracks per inch. Some low density formats can be supported on high-density drives by skipping tracks during head stepping.

data encoding

Encoding method used to store data. FM (frequency modulation) and MFM (modified frequency modulation) are the most common encoding methods.

The following table shows some useful flexible disk media geometries (without density information). The right-most column indicates which mediainit -f option should be used to format media to the indicated geometry (see mediainit(1M)).

Media TypeUseCapacityHeadsTracksSectorsSector Size-f
3.5in DS DD 630,784277162561
3.5in DS DD 655,3602801625621
3.5in DS DD 655,360280851226
3.5in DS DD 709,63227795122
3.5in DS DDDOS 720K737,280280951216
3.5in DS DD 788,480277510243
3.5in DS HD'DOS 1.2M1,228,8002801551226
3.5in DS HD' 1,261,5682778102422
3.5in DS HD 1,261,568277322561
3.5in DS HD 1,419,264277185122
3.5in DS HDDOS 1.44M1,474,5602801851216
3.5in DS HD 1,567,9602771010243
3.5in DS HD 1,638,40028010102423
5.25in DSDOS 360K368,64024095122
5.25in DS DD 655,360280851226
5.25in DS HDDOS 1.2M1,228,8002801551216
5.25in DS HD 1,261,5682778102424

The following table shows the density information for some standard flexible disk media.

MediaTypeBitDensityRPMTransferRateTrackDensityDataEncoding
3.5in DS DD7,958300250135MFM
3.5in DS HD'13,262360500135MFM
3.5in DS HD15,916300500135MFM
5.25in DS7,95830025048MFM
5.25in DS DD7,95830025096MFM
5.25in DS HD13,26236050096MFM

Abbreviations are interpreted as follows:

DS

Double-sided media

DD

Double-density media

HD

High-density media

HD'

High-density media (alternate media rotation rate)

Normally each open() call causes the device and/or floppy device driver to attempt to determine the geometry of the installed media. As a result, the current flexible disk geometry is set to the supported geometry that matches the physical data format on the media currently installed in the device. To maintain reasonable open times, not all possible media geometries are checked. Therefore, it is possible that a flexible disk medium may contain valid data even though its format is not recognized. This automatic geometry sensing functionality may be disabled in some drivers by use of the O_NDELAY flag in the open() call or device driver dependent minor numbers. The Series 800 does not support this flag.

The FLOPPY_GET_INFO ioctl indicates the characteristics and current status of a floppy device. Information for interpreting the media and data_encoding fields can be found in <sys/floppy.h>. The following macros are defined for decoding the status and valid fields. These macros return a non-zero (true) value for the associated conditions.

FLOPPY_NO_MEDIA(x)

/* Drive is empty */

FLOPPY_BLANK_MEDIA(x)

/* Media geometry is not recognizable */

FLOPPY_WRITE_PROT(x)

/* Media is write protected */

FLOPPY_MEDIA_CHANGED(x)

/* Media has changed since last status */

FLOPPY_HIGH_DENSITY(x)

/* Media has high density indication */

The argument x in the above macros refers to the status or valid fields of the FLOPPY_GET_INFO ioctl. Some floppy devices or floppy device drivers may be unable to determine some status information. The valid field indicates whether or not the corresponding status information is meaningful. Applying a macro to the valid field indicates whether or not the application of that same macro to the status field results in a valid device status.

The FLOPPY_GET_GEOMETRY ioctl can be used to determine the flexible disk device's current media geometry. Current geometry parameters are indicated in the fields of the resultant floppy_geometry structure.

The FLOPPY_SET_GEOMETRY ioctl can be used to specify the desired media geometry. Exclusive access to the device, obtained through use of the DIOC_EXCLUSIVE ioctl (see disk(7)), is required prior to setting the media geometry. Exclusive access is necessary to ensure that other applications are not affected. The Series 800 does not support this ioctl.

The FLOPPY_FORMAT_TRACK ioctl can be used to reformat a media track. Exclusive access to the device, obtained through use of the DIOC_EXCLUSIVE ioctl (see disk(7)), is required prior to reformatting to ensure that other applications are not affected. The Series 800 does not support this ioctl.

Flexible disk devices support the generic disk ioctls (see disk(7)), typically used for hard disk devices. Flexible disk device drivers may also support driver specific ioctls (see the appropriate driver manual section).

The header file <sys/floppy.h> has useful information for flexible-media device control. The following is included from <sys/floppy.h>:

/* ioctls for flexible (floppy) disk devices */ #define FLOPPY_GET_INFO _IOR('F', 1, struct floppy_info) #define FLOPPY_GET_GEOMETRY _IOR('F', 2, struct floppy_geom) #define FLOPPY_SET_GEOMETRY _IOW('F', 3, struct floppy_geom) #define FLOPPY_FORMAT_TRACK _IOW('F', 4, struct floppy_format) /* structure for FLOPPY_GET_INFO ioctl */ struct floppy_info { unsigned media; unsigned status; unsigned valid; }; /* structure for FLOPPY_GET_GEOMETRY and FLOPPY_SET_GEOMETRY ioctls */ struct floppy_geometry { unsigned heads; unsigned tracks; unsigned sectors; unsigned sector_size; unsigned transfer_rate; unsigned track_density; unsigned data_encoding; }; /* structure for FLOPPY_FORMAT_TRACK ioctl */ struct floppy_format { unsigned head; unsigned track; unsigned interleave; };

ERRORS

The following errors can be returned by a flexible-disk device-driver call:

[EACCES]

Required permission is denied for the the device or operation.

[ENXIO]

If resulting from an open call, this indicates there is no device at the specified address. For other calls, this indicates the specified address is out of range or the device can no longer be accessed.

[EINVAL]

From an open() call: the device is not a floppy device. For other calls: Invalid request or parameter.

[EIO]

I/O error (e.g., media defect or device communication problem).

WARNING

Media removal and/or replacement while the device is open is not supported. A floppy disk containing a mounted file system should not be removed prior to being unmounted. Removal of floppy disks containing mounted file systems is likely to result in file system errors, and system panics.

Reformatting flexible disk media from one geometry to another that differs only in that it has fewer tracks can cause the automatic geometry sensing functionality of open() to fail to recognize the new media geometry. Bulk erasing (degaussing) the media or formatting the media to a substantially different geometry prior to reformatting prevents automatic geometry sensing problems.

Single track formatting may not be supported by some floppy devices.

Some devices permit configuration for geometries which they are unable to support. The FLOPPY_SET_GEOMETRY ioctl for such a configuration may not result in an error. However, subsequent I/O operations will fail.

DEPENDENCIES

Series 700

Series 700 device special files reside in the directories /dev/rfloppy and /dev/floppy.

Series 800

A flexible disk can be opened with no media. However, capacity changes resulting from subsequent media changes will not be recognized. (See scsi_disk(7)).

Series 800 device special files reside in the directories /dev/rdsk and /dev/dsk.

The following table of Series 800 Flexible Disk Media shows the disk geometries supported. The media inserted in the drive is formatted depending on the presence or absence of the HD hole in the flexible disk cartridge. HD media is formatted as a 1.44M diskette and DD media is formatted as a 720K diskette.

Media TypeUseCapacityHeadsTracksSectorsSector Size
3.5in DS DDDOS 720K737,2802809512
3.5in DS HDDOS 1.44M1,474,56028018512

The following table shows the density information for the flexible disk media supported:

MediaTypeBitDensityRPMTransferRateTrackDensityDataEncoding
3.5in DS DD7,958300250135MFM
3.5in DS HD15,916300500135MFM

The FLOPPY_GET_INFO and FLOPPY_GET_GEOMETRY ioctls are supported on Series 800.

© Hewlett-Packard Development Company, L.P.