< RISC OS PRMs: Volume 5a: Chapter 113: CDs and CD-ROMs

RISCOS.com

www.riscos.com Technical Support:
Programmer's Reference Manual

 

CDs and CD-ROMs


Introduction

Support has been added to RISC OS 3.6 for CDs and CD-ROMs. This software was previously separately available, and was typically supplied in a ROM on the SCSI card used to interface to a SCSI-based CD-ROM drive.

The software provides a filing system with which you can access files on a CD-ROM that conforms to the widely used ISO 9660 standard. It also provides commands with which you can play audio CDs, starting, stopping and pausing wherever you like. You can read audio data directly from a CD, provided the CD-ROM drive you are using supports this facility.

CDs can store about 75 minutes of audio data. As CD-ROMs, they can be used to store about 660 MB of data, making CDs suitable for mass data applications and as an affordable publishing medium.

The future of CD-related modules

Acorn intend replacing all CD-related components of RISC OS in the next release. Because of this, the SWI interface provided by the CDFS and CDFSDriver modules will become obsolete, and so we do not document it here. If you wish to write applications that use these SWIs, you should:

  • Contact Acorn Computers for details of the SWIs.
  • Write your application so that code that calls the SWIs is separate from the rest of your application, and can be easily replaced in the future.

We do document the * Commands provided by the CDFS module, solely so that you can use them from the command line. These may also become obsolete in the future, and you should treat them in the same way as SWIs when writing applications.

You will also need details of these SWIs if you wish to write a soft-loadable driver to support a new type of CD-ROM drive under the current CD system. Again, you should contact Acorn Computers for further details.

CDFS

The CDFS module is responsible for interpreting the data on a CD-ROM that uses the ISO 9660 standard, and ensuring the RISC OS filing system is properly supported.

CDFS is implemented as a FileSwitch-based filing system rather than as a FileCore module, because some aspects of CD-ROMs such as directory size, disc size and filename length can exceed limitations imposed by FileCore. Consequently you can use the standard FileSwitch SWIs - such as OS_Byte, OS_File, OS_Find and OS_GBPB - and * Commands to read files and data. Obviously you cannot write to disc, as CDs are not a writable medium; CDFS is a read-only filing system, and gives an error if you make a call that attempts to write data.

Because CDFS supports standard FileSwitch calls, correctly written applications will be able to use the CDFS filing system without modification.

This 'standard FileSwitch interface' will remain supported in the next release of RISC OS.

* Commands


*Bye

Ends a CDFS session

Syntax

*Bye

Parameters

None

Use

*Bye ends a CDFS session by closing all files, unsetting all directories and libraries, forgetting all CD-ROM names and parking the heads of CD-ROM drives to their 'transit position' so that they can be moved without risking damage to the read head.

You should check that CDFS is the current filing system before you use this command, or alternatively if another filing system is your current one, you can type:

*CDFS:Bye

Example

*Bye

Related commands

*Close, *Dismount, *Shut, *ShutDown


*CDDevices

*CDDevices displays all the CD devices connected, and information about them

Syntax

*CDDevices

Parameters

None

Use

*CDDevices displays all the CD devices connected, their product name, capacity, firmware revision, and their SCSI ID (displayed as device, LUN, and card; or as zeroes for non-SCSI devices). In more detail:

Drive - is the logical drive number assigned by CDFS

Dev, Lun and Card - are the device ID, logical unit and card numbers that together make up the drive's SCSI address

Product - is a brief identification of the CD-ROM drive provided by its manufacturer

Capacity - is the total amount of information (both data and audio) on the CD currently in the drive, or 'Unknown' if there is no readable CD in the drive

Firmware - is the version of the manufacturer's firmware fitted to the drive.

Unrecognised drive types are omitted from the list.

The information returned is liable to change in future versions; you should not rely on its content or format.

Example

*CDDevices
Drive  Dev  LUN  Card Product              Capacity      Firmware
00     0    0    0    CD-ROM CR-571        413 Mbytes    1.0e

Related commands

None


*CDFS

Selects the CD-ROM Filing System as the current filing system

Syntax

*CDFS

Parameters

None

Use

*CDFS selects the CD-ROM Filing System as the filing system for subsequent operations. Remember that it is not necessary to switch filing systems if you use the full pathnames of objects. For example, you can refer to NetFS objects (on a file server, say) when CDFS is the current filing system.

Example

*CDFS

Related commands

*ADFS, *Net, *Ram, *ResourceFS


*CDSpeed

Displays or sets the read speed of a CD-ROM drive

Syntax

*CDSpeed [drive [speed]]

Parameters

drive - a valid CD-ROM drive number

speed - the new read speed for that drive:
1 - standard speed
2 - double speed
255 - maximum speed

Use

*CDSpeed displays or sets the read speed of the given CD-ROM drive, or of the current drive if none is specified. To set the speed, you must specify both the drive number and the new speed.

Note that many drives only support a single read speed; if you attempt to set their read speed, you will get an 'Invalid parameter' error.

Example

*CDSpeed
Current speed setting is 2

Related commands

None


*Configure CDROMBuffers

Sets the configured amount of memory reserved for CD-ROM buffering

Syntax

*Configure CDROMBuffers size[K]

Parameters

size - the size of memory to reserve, in kilobytes: can be 0, 8, 16, 32, 64, 128, 256 or 512

Use

*Configure CDROMBuffers sets the configured amount of memory reserved for CD-ROM buffering, in kilobytes. This can be 0K, 8K, 16K, 32K, 64K, 128K, 256K, or 512K. If you specify any other size, then the next lowest value will be set.

The buffer space is used for a number of tasks such as cacheing blocks of data (ie 2048 bytes) and disc specific information - but it is mostly used to cache directory information. This saves accessing a directory and all its parent directories each time a request is made from it. With the slow seek time of CD-ROMs, this saving gives a significant performance increase, especially for deeply nested directories.

The performance of CDFS very much depends on it having adequate buffer space available. The desirable amount depends on various things: in particular, CDFS caches information for each disc in use, so using multiple CDs requires extra buffer space. Also, discs holding more objects have more directory information to cache. As a rough guide, a buffer size of 16 Kbytes is normally adequate for a single average CD.

To save memory usage, CDFS does not load at boot time if the computer is configured to have zero CD-ROM drives, and so this command will not be available. However, you can always use the Configure application to change all CDFS configuration settings, even if CDFS itself is not loaded.

Example

*Configure CDROMBuffers 64K

Related commands

None


*Configure CDROMDrives

Sets the configured number of CD-ROM drives recognised at power on

Syntax

*Configure CDROMDrives n

Parameters

n - the number of CD-ROM drives, in the range 0 - 27

Use

*Configure CDROMDrives sets the configured number of CD-ROM drives recognised at power on.

To save memory usage, CDFS does not load at boot time if the computer is configured to have zero CD-ROM drives, and so this command will not be available. However, you can always use the Configure application to change all CDFS configuration settings, even if CDFS itself is not loaded.

Example

*Configure CDROMDrives 1

Related commands

*Configure Floppies, *Configure HardDiscs, *Configure IDEDiscs


*Dismount

Ensures that it is safe to finish using a CD-ROM

Syntax

*Dismount [disc_spec]

Parameters

disc_spec - the name of the CD-ROM or number of the CD-ROM drive

Use

*Dismount ensures that it is safe to finish using a CD-ROM by closing all its files, unsetting all its directories and libraries, forgetting its disc name, and parking its read head. If no CD-ROM is specified, the current CD-ROM is used as the default. *Dismount is useful before removing a particular CD-ROM; however, the *Shutdown command is usually to be preferred, especially when switching off the computer.

Example

*Dismount

Related commands

*Mount, *ShutDown


*Drive

Sets the current CD-ROM drive

Syntax

*Drive drive

Parameters

drive - the number of the CD-ROM drive, from 0 - 27

Use

*Drive sets the current CD-ROM drive if NoDir is set. Otherwise, *Drive has no meaning.

Example

*Drive 3

Related commands

*Dir, *NoDir


*Eject

Ejects the disc from a CD-ROM drive

Syntax

*Eject [drive]

Parameters

drive - a valid CD-ROM drive number

Use

*Eject ejects the disc from the given CD-ROM drive, or from the current drive if none is specified. This command will only work if the drawer has not been locked by the *Lock command (see *Lock), and is electronically operated.

Example

*Eject 0

Related commands

*Lock, *Unlock


*Lock

Locks the disc in a CD-ROM drive, disabling the Eject button

Syntax

*Lock [drive]

Parameters

drive - a valid CD-ROM drive number

Use

*Lock locks the disc in the given CD-ROM drive, disabling the Eject button. If no drive is specified, the current drive is locked. You must call the *Unlock command before the disc can again be ejected.

Example

*Lock 0

Related commands

*Unlock


*Mount

Prepares a CD-ROM for general use

Syntax

*Mount [disc_spec]

Parameters

disc_spec - the name of the CD-ROM or number of the CD-ROM drive

Use

*Mount prepares a CD-ROM for general use by setting the current directory to its root directory, setting the library directory (if it is currently unset) to $.Library, and unsetting the User Root Directory (URD). If no disc spec is given, the default CD-ROM drive is used. The command is preserved for the sake of compatibility with earlier Acorn operating systems, and ideally you should not use it.

Example

*Mount :VIDEOCLIP2

Related commands

*Dismount


*Play

Plays from the specified audio track to the end of the disc in a CD_ROM drive

Syntax

*Play track [drive]

Parameters

track - track from which to start playing, in the range 0 - 99

drive - a valid CD-ROM drive number

Use

*Play plays from the specified audio track to the end of the disc in the given CD_ROM drive, or in the current drive if none is specified. No data is transferred to the computer; playback uses the drive's digital to analogue circuits and audio output - which is typically via a jack socket, phono sockets or other in-line adaptors.

If the track number does not exist on the CD in the drive, you will get the error 'Number too small' or 'Number too big'. If you try to play a data track, you will get the error 'Cannot play that data'.

Example

*Play 9 0

Related commands

*PlayMSF, *Stop


*PlayList

Lists the tracks - whether audio or data - on the disc in a CD-ROM drive

Syntax

*PlayList [drive]

Parameters

drive - a valid CD-ROM drive number

Use

*PlayList lists the tracks - whether audio or data - on the disc in the given CD-ROM drive, together with their start time and the total CD time. If no drive is specified, the current disc's tracks are listed.

The start time is given as a 'Red Book address', in minutes, seconds, and frames (each of which is 1/75 of a second) from the start of the disc.

Example

*PlayList 0
Track number, contains, starts from MM:SS:FF
Track   01   is data    00:00:00
Track   02   is audio   23:24:65
Track   03   is audio   27:59:05
Total   03   track(s)   34:21:74

Related commands

None


*PlayMSF

Plays a piece of audio from the disc in a CD-ROM drive

Syntax

*PlayMSF mins:secs:frames mins:secs:frames [drive]

Parameters

mins - number of minutes from the start of the disc at which to start/stop playing

secs - number of seconds from the start of the disc at which to start/stop playing

frames - number of frames from the start of the disc at which to start/stop playing

drive - a valid CD-ROM drive number

Use

*PlayMSF plays a piece of audio from the disc in the given CD-ROM drive, or in the current drive if none is specified. The start and stop times time are specified as a 'Red Book address', in minutes, seconds, and frames (each of which is 1/75 of a second) from the start of the disc. The start time is the first of the two parameters.

Playing stops immediately a data track is encountered, so if the start time is in a data track this command will appear to do nothing. You will get an error if the start and/or end times lie outside the range of the CD.

Example

*PlayMSF 02:05:38 23:59:74

Related commands

*Play, *Stop


*Stop

Stops playing the disc in a CD-ROM drive

Syntax

*Stop [drive]

Parameters

drive - a valid CD-ROM drive number

Use

*Stop stops playing the disc in the given CD-ROM drive, or in the current drive if none is specified. If the drive is not currently playing, this command is ignored.

Example

*Stop 0

Related commands

*Play, *PlayMSF


*Supported

Lists the drive types recognised by CDFS

Syntax

*Supported

Parameters

None

Use

*Supported lists the drive types recognised by CDFS, and hence that are usable. The list only gives manufacturers' names, not model numbers.

RISC OS 3.6 nominally supports the following drives:

ATAPI Conformant drives
Chinon CDS-431
Hitachi CDR-3650/1650S and CDR-1750S
Philips CM212 and CDD521
Sony CDU-6111, CDU-6211, CDU-541 and CDU-561
Toshiba XM-3301 and XM-3401

However, since drives' firmware can change, you should not treat the above list as definitive. In particular, because the ATAPI standard is still in a state of flux, and not all drives conform to the standard anyway, you may find that not all so-called 'ATAPI' drives work with RISC OS 3.6. However, you may find some other drives made by the above manufacturers are sufficiently compatible to also work.

This call may not be supported in the future, or the information returned may change in content and/or format. You should therefore not use this call in applications or scripts.

Example

*Supported
SONY, LMS, TOSHIBA, HITACHI, CHINON
(LMS - Laser Magnetic Systems - is actually Philips)

Related commands

None


*Unlock

Re-enables the Eject button on a CD-ROM drive

Syntax

*Unlock [drive]

Parameters

drive - a valid CD-ROM drive number

Use

*Unlock re-enables the Eject button on the given CD-ROM drive, reversing the effect of any earlier *Lock command. If no drive is specified, the current drive is unlocked.

Example

*Unlock 0

Related commands

*Eject, *Lock


*WhichDisc

Displays the unique ID number for the disc in the current CD-ROM drive

Syntax

*WhichDisc

Parameters

None

Use

*WhichDisc displays the unique ID number for the disc in the current CD-ROM drive. The number is calculated from the information in the disc's TOC (as defined in the Red Book), therefore it is unlikely that two discs will have the same value.

Example

*WhichDisc
322279

Related commands

None

This edition Copyright © 3QD Developments Ltd 2015
Last Edit: Tue,03 Nov 2015