Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cdrom(7) — Motorola System V 88k Release 4 Version 4.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

disk(7)

floppy(7)

intro(7)

cdrom(7)  —  SPECIAL FILES AND DEVICES

NAME

cdrom − CDROM device support

DESRIPTION

CDROM disk drives perform like hard disk drives except for the following:

Read only
CDROM disks are read-only devices. Any attempt to write to a CDROM disk results in an error (EROFS). 

2048 Byte Blocks
CDROM drives are accessed in multiples of 2048 bytes. All raw transfers must be aligned on 2048-byte boundaries and have a transfer byte count that is a multiple of 2048 bytes. If either of these conditions is not met, the I/O results in an error (EIO). 

Slicing
If a CDROM disk has a valid Motorola Volume ID, the Volume Table of Contents (VTOC) reads from the disk. If the CDROM disk does not have a valid volume ID, the VTOC consists of two slices: slice zero and slice seven. Slice zero is the first slice on a boot disk which always contains root.  Slice seven represents the whole disk, whether it contains root or not. 

Door Locking
When no process currently has the CDROM drive open and it is being opened for the first time, the media-eject button on the drive becomes disabled until the last close, if the CDROM drive has a locking door.

Presence of Media
If there is no CDROM in the drive, an open attempt results in an error (ENXIO). 

IOCTL COMMANDS

CDROMs support several ioctl(2) functions on the character or raw devices.  These functions permit control beyond the normal open(2), close(2), read(2), and write(2) system calls.  All ioctl(2) operations take the form ioctl (fildes, command, ∗arg).  Any attempt to utilize ioctl(2) functions not listed below cause an EINVAL error to be returned. 

The operations supported by CDROMs are listed below in alphabetical order. 

DKGETCFG
Get parameters associated with the disk and store them in the dkconfig structure referenced by arg.  The disk is not accessed by this command. 

DKGETINFO
Get parameters associated with the disk and store them in the dkblk0 structure referenced by arg.  The disk is not accessed by this command. 

DKGETSLC
Get the VTOC information for a disk and return the information in a structure of type struct motorola_vtoc (defined in sys/vtoc.h) referenced by arg.  While the number of supported slices is determined by the number of slices defined in the ddefs file, all disks are expected to support 16 slices.  The disk is not accessed by this command. 

DKINQUIRY
Return the SCSI INQUIRY data for the device; it is only valid for SCSI CDROMs. This ioctl can be done on any device that the calling process has open.  The SCSI INQUIRY data for the device is copied into the struct inquiry structure pointed to by arg.  The struct inquiry structure is defined in sys/dk.h. 

DKREADCAP
Return the SCSI READ CAPACITY data for the device; it is only valid for SCSI CDROMs. This ioctl can be done on any disk or CDROM device that the calling process has open.  The SCSI READ CAPACITY data for the device is copied into the struct readcap structure pointed to by arg.  The struct readcap structure is defined in sys/dk.h.  Note that the SCSI READ CAPACITY command returns the number of the last logical block on the media.  This ioctl adds one to that number so that it represents the actual capacity of the device (logical block numbers start at zero). 

DKTRAY_OPEN
Cause the CDROM door to open after processing the last close (when no process has the drive open). The arg parameter is not used. 

V_GETSSZ
Return the physical sector size of the CDROM. The arg parameter specifies a structure of type io_arg (defined in sys/vtoc.h).  The sectst and datasz members of the io_arg structure are ignored.  The memaddr member of the structure points to the address of an integer which contains the sector size after a successful operation. 

V_PDREAD
Read the Physical Description Area of the disk. The arg parameter specifies a structure of type io_arg (defined in sys/vtoc.h).  The sectst and datasz members of the io_arg structure are ignored.  The memaddr member of the io_arg structure points to the address of a structure of type pdsector (defined in sys/vtoc.h) which contain the requested data upon successful completion. 

V_PDWRITE
Write the Physical Description Area of the disk. This command always returns EROFS.  The arg parameter specifies a structure of type pdinfo (defined in sys/vtoc.h). 

V_PREAD
Read physical sectors. This interface assumes that sectors are 512 bytes in length so the driver is responsible for mapping the requested block(s) to the correct portion of the correct sector on the CDROM regardless of the actual physical sector size. The arg parameter specifies a structure of type io_arg (defined in sys/vtoc.h).  The sectst member of the io_arg structure contains the starting sector number and the datasz member contains the number of sectors.  The memaddr member of the io_arg structure points to the address of a sufficiently large area which contains the requested data upon successful completion. 

V_PWRITE
Write physical sectors. This command always returns EROFS.  The arg parameter specifies a structure of type io_arg (defined in sys/vtoc.h). 

V_RVTOC
Read the VTOC from the disk. The arg parameter specifies a structure of type io_arg (defined in sys/vtoc.h).  The sectst and datasz members of the io_arg structure are ignored.  The memaddr member of the io_arg structure points to the address of a structure of type vtoc (defined in sys/vtoc.h) which contains the requested data upon successful completion. 

V_WVTOC
Write the VTOC to the disk. This command always returns EROFS.  The arg parameter specifies a structure of type vtoc (defined in sys/vtoc.h). 

SEE ALSO

disk(7), floppy(7), intro(7)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026