OpenMPE CD access library Version E.01.00 28 Jan 2004 Keven Miller ============================================================================ This library provides procedures to access a CD drive on an HP3000. They are in Privileged mode (PM). In order for this XL to be executed, it must reside in a group with PM capability. Your program does not have to have PM. I would be grateful to hear of any instances where these procedures return -1 on an error, and what the conditions might be that lead to the error. You may contact me at either of these email addresses: Kevenm@exegesys.com Kevenm@reeltapetransfer.com At this time HP has not documented the CD routines, and therefore has asked that this source not be made public. But I am willing to make improvementsto this library! This library supports access to one CD drive at time, selected with the omcdmount procedure. To access another drive, you must call omcdmount again, and all subsequent CD procedure calls will access the new drive. You can leave a CD mounted when your program ends, leaving it ready for the next accessor. However, you will have to dismount the CD before you can eject it. Below is a list of known error numbers. Although I have only seen these: -2,-5 (omcdmount), -6 (omcddismount), -5,-7 (omcdread). -1 CD ldev unknown -2 CD already mounted -3 CD volume invalid -4 CD format unknown -5 CD read access failed -6 CD not mounted -7 CD read timed out -8 CD unknown lowlevel error I have added these error numbers. omcdread: if the data parameter is NULL or 0. Not yet sure how to check if it is invalid. 99 Data buffer is NULL (0) or invalid Sometimes MPE has trouble with loading (physically inserting) a CD, and ejects it back out. It may take 2-3 tries before it accepts it. A blank CD is ejected. An audio CD loads, but when attempting to mount, the console reports the following, VOLUME PHYSICALLY DISMOUNTED FOR LDEV 5 (AVR 22) AVR FAILURE ON LDEV 5 STATUS=FFFF0071,# 40 (AVR 6) and omcdmount returns error -5. When an ISO-9660 CD is loaded, the console reports the following, VOLUME PHYSICALLY DISMOUNTED FOR LDEV 5 (AVR 22) UNKNOWN VOLUME MOUNTED ON LDEV 5 (AVR 15) and omcdmount returns 0 with the CD mounted. I wish I had software control to load and eject the CD. Also to be notified on a loaded, ejected, mounted, dismounted event. Historic notes: Much like HP identifies is newer intrinsics with a leading "HP", I chose to use om for OpenMPE. I always see versions of A.xx.xx and B.xx.xx, but not much further. Due to the odd (or is it even) spelling of my name, I gained a nickname of "E", which I chose to start the version. But if you don't like that, just take it as a version from openmpE. Written in HP-C, developed on a 918RX MPE/iX 6.0 pp2. =========================================================================== integer = omcddismount ( status ) returns 1 the currently mounted CD has been dismounted. 0 there was no mounted CD. -1 an error occurred. status A 2-element halfword integer array which returns the status of the procedure. The first element contains an error number and the second contains the subsystem identifier. You may specify a 0 or NULL pointer and only get the return value. =========================================================================== integer = omcderr ( status, message ) returns byte-length of the message specified by the error number in status. 0 there was no error. status A 2-element halfword integer array where the first element contains an error number and the second element contains the subsystem identifier, 522. message A record that returns a message specified by the error number in status. No message will be greater than 72 bytes long. =========================================================================== integer = omcdmount ( ldev, status ) returns 1 a CD was mounted 0 a CD on this ldev was already mounted -1 an error occurred. ldev An integer by value specifying the device number of a CD drive. status A 2-element halfword integer array which returns the status of the procedure. The first element contains an error number and the second contains the subsystem identifier. You may specify a 0 or NULL pointer and only get the return value. =========================================================================== integer = omcdread ( sector, numsects, data, status ) returns 1 the CD was read successfully. 0 a timeout occurred while reading the CD. -1 an error occurred. sector An integer by value specifying the starting sector to read. numsects An integer by value specifying the number of sectors to read. data A record to contain the CD data. status A 2-element halfword integer array which returns the status of the procedure. The first element contains an error number and the second contains the subsystem identifier. You may specify a 0 or NULL pointer and only get the return value. An ISO-9660 formatted CD sector size is 2048 bytes. =========================================================================== integer = omcdvolname ( volumename ) returns the device number of the mounted CD used in this library. volumename A 32-byte record that returns the mounted CD volume name. You may specify a NULL (0) pointer and only get the return value. If no CD is mounted, the return value is 0, and a 7-byte version of the CD library is returned in volumename. ===========================================================================