cdrtools/vms/vms_notes.txt

759 lines
26 KiB
Plaintext
Raw Normal View History

2025-06-15 04:19:58 +08:00
==========================================
Cdrtools Version 2.01 (2.01.01a22) for VMS
==========================================
========================================================================
Functional changes for VMS. 2006-11-13 SMS.
--------------------------------------------
------------------------------------------------------------------------
This kit includes MMS/MMK product builders which are new for cdrtools
version 2.x. Objects, object libraries, executables, and any other
system-specific files should now be placed into system-specific
subdirectories in the source tree, such as [.ALPHA], [.IA64], or [.VAX].
If the large-file option is specifed (non-VAX), [.ALPHAL] or [.IA64L].
(See below for details.)
Command-line case is preserved by all programs if SET PROCESS
/PARSE_STYLE = EXTENDED is in effect (non-VAX, where C run-time library
support exists). This obviates quoting upper-case options.
All programs now have an exit handler to restore process base
priority ("nice(0)"). CDRECORD (and CDDA2WAV?) normally raise it (where
privileges allow), but did not previously restore it. The
priority-raising scheme is now a build-time option, which may be
specified in the VMS section of [.INCLUDE.SCHILY]XMCONFIG.H. Older
cdrtools versions always used "nice(-20)". Now, an OS-specific nice()
value may be selected, or an actual VMS process base priority value may
be specified. The current default is to set the priority to 16, the
lowest real-time priority value on VMS.
CDDA2WAV, CDRECORD, MKISOFS, and READCD now use some VMS-specific
parameters on open operations for major files. This typically enables
double buffers, read-ahead, write-behind, and larger extend quantities.
Users who do not override the RMS defaults (SET RMS_DEFAULT) should see
significant I/O speed improvements. Users may override the new default
parameters using SET RMS_DEFAULT explicitly to set different ones.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MKISOFS Changes
---------------
- New "-E" option to show ISO 9660 header (Environment) information.
This shows, for example, ".mkisofsrc" file data not explicitly specified
on the command line. The "-v" option now also shows whether
".mkisofsrc" was used. These changes are enabled by defining the C
macro "SMS", which is done by the by the VMS builders. (Look for "SMS"
in [.MKISOFS]DESCRIP_SRC.MMS.)
- ODS5 extended file name support (not well tested).
- Various bug fixes. (See below for details.)
- The new MKISOFS option, "-find", must be enabled at build time.
See notes below.
MKISOFS "-find"
---------------
The new MKISOFS option, "-find" has not been well tested. It is
enabled at build time by defining the MMS/MMK macro FIND. See comments
in [.VMS]DESCRIP.MMS.
- The "-exec" operator does not work, as its implementation involves
fork().
- The "-name" pattern matching code is UNIX-oriented, so it's case
sensitive, and there's no default for version numbers. For
example, "-name ab.*" will _not_ match "AB.C;1" (case), and "-name
*.C" will not match "AB.C;1" (version). A name pattern like
"[aA][bB].C;*" would match any version of "ab.C", "aB.C", "Ab.C",
or "AB.C". On an ODS2 file system, specifying all-upper-case names
is sufficient to deal with this case sensitivity, but more care is
needed for ODS5.
- The unusual implementation of inodes in the VMS C RTL will probably
defeat inode-related features ("-inum", "%i"). Beginning with VMS
V8.2 or so, building with the MMS macro STD_STAT defined may help
by switching to a more POSIX-compatible inode implementation, but
enabling this feature may change the behavior of the stat()
function in all programs in this collection, so it could cause problems
anywhere. Also, STD_STAT probably requires large-file support
(LARGE), and is not available on VAX.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MKISOFS Diagnostic Programs
---------------------------
There are some diagnostic programs related to ISO-9660 file systems
hidden in the [.MKISOFS.DIAG] directory. Executables for the working
ones should be created in the same directory as MKISOFS.EXE, and
suitable foreign-command symbols may be created for them, if desired.
(See Foreign-Command Symbols, below.) The working ones are:
- isodebug print mkisofs debug info from ISO-9660 image.
- isoinfo perform directory like listings of iso9660 images.
- isovfy verify the integrity of an iso9660 image.
Not yet working (due to UNIX screen handling, at least) are the more
interactive programs:
- isodump display the contents of iso9660 images.
- devdump display the contents of device or filesystem images.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VMS CD/DVD Device Specification
-------------------------------
In this release, a CD/DVD drive may be specified using a normal VMS
device name (physical or logical). For example, "dev=dkb500" or
"dev=cdrw" (where "cdrw" is a logical name which has been defined to
identify an appropriate device). As in previous cdrecord/cdrtools
versions, the old standard cdrecord/cdrtools "bus,target,lun" format is
also allowed (with some changes to the mapping from previous releases).
That is, "dev=bus,tgt,lun" (where "bus", "tgt", and "lun" are integers),
rather than a simple VMS device name. The "dev=bus,tgt,lun"
specification is translated into a VMS device name as shown below.
bus: 0 1 2 3 4 5 6 7
dka dkb dkc dkd gka gkb gkc gkd (SCSI disk, SCSI generic)
8 9 10 11 12 13 14 15
dqa dqb dqc dqd dqe dqf dqg dqh (ATAPI)
16 17 18 19 20 21 22 23
dna dnb dnc dnd dne dnf dng dnh (USB)
tgt: SCSI ID (always zero for ATAPI devices)
lun: SCSI LUN (normally 0 for SCSI, zero or one for ATAPI)
For example, "dev=1,5,0" specifies DKB500, and "dev=8,0,0" specifies
DQA0. If a SCSI adapter beyond "D" is needed, the simplest method would
be to specify the actual VMS device name instead of using the
"bus,tgt,lun" scheme. However, to use the "bus,tgt,lun" scheme in such
a case, one could specify some nonexistent GK device (like "dev=7,1,1"),
and then define a logical name to redirect the phony device name (here,
GKD101) back to the real device. For example, if the CD/DVD drive were
DKF300:
$ define GKD101 DKF300
$ cdrecord dev=7,1,1 -prcap
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GKDRIVER
--------
Some VAX systems (with older hardware and/or older VMS versions) will
need to use (or work better if they use) the GKDRIVER generic SCSI
driver for the CD/DVD drive, instead of the usual DKDRIVER SCSI disk
driver. The indicating symptom might be an I/O failure like this:
cdda2wav: invalid argument. Cannot send SCSI cmd via ioctl
%SYSTEM-?-BADPARAM, bad parameter value
or many (recoverable) errors like this:
cdda2wav: not owner. ReadCD MMC 12: scsi sendcmd: retryable error
One way to select an alternate device driver involves editing
SYS$MANAGER:SYCONFIG.COM to control which driver is used for the CD/DVD
device. The suggested changes shown below do three things:
1. Prevent all the system devices from being automatically
configured (because that would connect the CD/DVD device using
the default DKDRIVER),
2. Arrange to specify GKDRIVER for the CD/DVD device(s), and then
3. Automatically configure all the other devices.
The first change is to uncomment this line in SYCONFIG.COM:
$! STARTUP$AUTOCONFIGURE_ALL == 0
This prevents SYS$STARTUP:VMS$DEVICE_STARTUP.COM from configuring any
devices. Then (also in SYCONFIG.COM), add the appropriate SYSGEN
commands to do the configuration as desired. (Refer to
VMS$DEVICE_STARTUP.COM to ensure that all the desirable things which it
would normally do are moved into SYCONFIG.COM.) In this example, the
CD/DVD drive is on the "A" SCSI adapter at SCSI ID 5 (normally DKA500):
$ mcr sysgen
! Do the normal tasks from SYS$STARTUP:VMS$DEVICE_STARTUP.COM.
connect fta0 /noadapter /drivername = ftdriver
connect mpa0 /noadapter /drivername = pipedriver
! Connect the CD-R/RW drive using the generic SCSI driver.
connect gka500 /noadapter
! Auto-configure everything (else).
autoconfigure all
exit
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Foreign-Command Symbols
-----------------------
Also, as in previous cdrecord/cdrtools versions, it's usual to define
foreign-command symbols for the programs. It may be helpful to gather
the various program executables from their individual directories, and
put them all into some more convenient directory.
CDDA2WAV :== $ dev:[dir]CDDA2WAV.EXE
CDRECORD :== $ dev:[dir]CDRECORD.EXE
MKISOFS :== $ dev:[dir]MKISOFS.EXE
READCD :== $ dev:[dir]READCD.EXE
Symbol definitions like these could be added to the system-wide
SYS$MANAGER:SYLOGIN.COM procedure, to a user's SYS$LOGIN:LOGIN.COM
procedure, to or to some other convenient procedure, as appropriate.
Alternatively, the DCL$PATH logical name can be defined to include
the directory (or directories) where these programs are located.
========================================================================
Build procedure for VMS. 2006-10-20 SMS.
-----------------------------------------
------------------------------------------------------------------------
Source Tree Preparation
-----------------------
The original source tree contains some symbolic links to various
header files (apparently to avoid having to tell the C compiler where to
find them). VMSTAR extracts these links as one-line text files which
say something like:
*** This file is a link to <path_to_actual_file>
The VMS builders are able to find the header files in their original
locations (using /INCLUDE), and these link files only cause problems for
the VMS builders.
If VMSTAR is used to recreate the source tree, then the procedure
[.VMS]DISCARD_LINK_FILES.COM should be run ("@") to rename the header
link files from "XXX.h" to "XXX.h_link":
@ [.vms]discard_link_files.com
Link files other than those for the header files should be harmless, and
are not affected by this action.
If a VMS-oriented Zip archive is used instead of a UNIX-oriented
"tar" archive to recreate the source tree, then this procedure should be
unnecessary (but harmless).
To use a VMS-modified source kit on a UNIX system, run
"vms/vms_name_fix.sh" to restore the non-lower-case file names, and then
run "vms/restore_file_links.sh" to find the link files, and replace them
with appropriate symbolic links.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Local Customization
-------------------
Some program features may be enabled or disabled in a local
configuration file, [.VMS]DESCRIP_LOCAL.MMS. (A template file is
preserved as [.VMS]DESCRIP_LOCAL.MMS_TEMPLATE.) Comments in the file
explain the options (briefly), and how to enable or disable them.
Currently, this file affects only some features in the audio
extraction program, cdda2wav.
This file should be edited as desired before building the products.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Building the Products
---------------------
MMS/MMK product builders are distributed throughout the source tree,
and in the [.VMS] directory:
[.vms]append_version.com
[.vms]collect_deps.com
[.vms]vax_old.opt
[...]descrip*.mms
Any older *.COM procedures which may still be found in the source tree
are obsolete, and should not be used.
In the simplest case, build the products so:
SET DEFAULT [.VMS]
MMS ! Or MMK. See below for more options.
MMK or old versions of MMS may need to have additional macros defined
on the command line, but helpful messages should explain what to do
when. (Old MMS versions on VAX may need MMS$ARCH_NAME. MMK will
probably need MMSDESCRIPTION_FILE.)
Details of the build options are explained in [.VMS]DESCRIP.MMS.
Some popular targets and options include:
MMS CLEAN
MMS CLEAN_ALL
MMS CLEAN_EXE
MMS CLEAN_OLB
MMS /MACRO = (LIST=1)
MMS /MACRO = (LARGE=1) ! Non-VAX. Important for DVD support,
! where files bigger than 2GB are likely.
Inside the major subdirectories, "MMS /DESCRIP = [-.VMS] [...]"
should work.
To (re-)generate the source dependency ("[...]DESCRIP_DEPS.MMS")
files, MMS (V3.5 or newer?) is needed:
MMS /EXTENDED /DESCRIPTION = descrip_mkdeps.mms /SKIP
To save time during program development, when these are changing often,
it helps to save the intermediate .MMSD files (output from CC
/MMS_DEPENDENCIES), so:
MMS /EXTENDED /DESCRIPTION = descrip_mkdeps.mms /MACRO = NOSKIP=1
For details, see the comments in [.VMS]DESCRIP_MKDEPS.MMS.
Linking on old VMS VAX versions may generate warnings:
%LINK-W-MULPSC, conflicting attributes for psect LIB$INITIALIZE
in module LIB$INITIALIZE file SYS$COMMON:[SYSLIB]STARLET.OLB;
A LINK options file ([.VMS]VAX_OLD.OPT) is supplied which should help.
Try adding '/MACRO = ("LINKOPTS=[-.VMS]VAX_OLD.OPT/OPTIONS")' to the
MMS/MMK command.
The cdrtools programs use C run-time library features which were not
available before VMS V7.0. Building on VMS versions earlier than V7.0
is possible using the "backport library" features provided by DEC C V5.6
and later compilers. The details are described in the file
SYS$LIBRARY:DECC$CRTL.README, which is supplied with these compilers.
This file also describes the options available to deal with time zones
and the newer UTC-based time functions.
The builders (specifically, the .FIRST actions in
[.VMS]DESCRIP_SRC_CMN.MMS) check the VMS version, and, if it is pre-V7,
define the logical names DECC$CRTLMAP (as SYS$LIBRARY:DECC$CRTL.EXE) and
LNK$LIBRARY (as SYS$LIBRARY:DECC$CRTL.OLB), unless the user has already
defined them. This should persuade the compiler to use a suitably high
value for __CRTL_VER when compiling, and a suitably complete C RTL when
linking. Environments with non-default configurations may require
changes from the code supplied, but it should be possible to confine any
needed changes to this one region.
In case of problems with the builders or the products, it's often
helpful to include various software version data (VMS, C compiler, C
RTL) in any problem report. The source kit includes a short program to
make this easier. A normal build should create the executable:
[.LIBVMS.<arch>]DECC_VER.EXE
When reporting any problems, please run this program, and include its
output in the problem report. If problems with the build cause a
failure before this executable is built, a more limited build in the
[.LIBVMS] directory may have a better chance:
set default [.libvms]
mms /descrip = [-.vms] [... any other options ...]
========================================================================
Source changes for VMS. 2006-12-04 SMS.
----------------------------------------
------------------------------------------------------------------------
[.cdda2wav]cdda2wav.c
Changed to use the NICE and NICE_PRIO macros (defined in
[.include.schily]xmconfig.h), in code currently disabled.
Added VMS-specific open() parameters for access callback function.
[.cdda2wav]interface.c
Changed to skip bus scan on VMS.
[.cdda2wav]lconfig.h_vms (NEW)
General update according to [.cdda2wav]lconfig.h_in.
Added conditionality for HAVE_STRCASECMP.
[.cdda2wav]vms.c (NEW)
Set up initialization (non-VAX) to set DECC$* variables.
------------------------------------------------------------------------
[.cdrecord]cdrecord.c
Adjusted VMS-specific #include directives.
INSERT_YOUR_EMAIL_ADDRESS_HERE
Changed to skip bus scan on VMS.
Changed to use the NICE and NICE_PRIO macros (defined in
[.include.schily]xmconfig.h).
Minor spelling corrections.
[.cdrecord]vms.c (NEW)
Set up exit handler to restore base process priority.
Set up initialization (non-VAX) to set DECC$* variables.
[.cdrecord]xio.c
Added VMS-specific open() parameters for access callback function.
------------------------------------------------------------------------
[.include.schily]align.h
Changed to "#include <align.h>", even if SCHILY_BUILD is not defined.
[.include.schily]avoffset.h
Changed to "#include <avoffset.h>", even if SCHILY_BUILD is not
defined.
[.include.schily]device.h
Added VMS-specific major() and minor() macros.
[.include.schily]schily.h
Added "#ifndef _OPENFD_SRC" conditionality around "#define _openfd
_openfd64" in the "#if defined(HAVE_LARGEFILES)" section.
[.include.schily]stat.h
Added macros for old-style VMS inode data structures.
[.include.schily]time.h
Added "struct timeval" declaration for VMS systems which lack it.
[.include.schily]xconfig.h
Removed "will go away soon" VMS-specific code.
Changed "<xmconfig.h>" to "<schilly/xmconfig.h>" in a "#include"
directive.
[.include.schily]xmconfig.h
Removed some explicit VMS dependence, as the builders now define the
USE_STATIC_CONF macro.
Added macros to substitute libschily *printf() functions for the
corresponding VMS C RTL functions.
Defined macro HAVE_DIRENT_D_INO.
Defined VMS-specific NICE and NICE_PRIO macros for better control of
process priority boosting, and added default definitions for non-VMS
systems.
Defined macros _OPENFD_SRC and _openfd to switch to a VMS-specific
replacement for _openfd(). Defined a VMS-specific O_BINARY flag value
for internal use.
------------------------------------------------------------------------
[.libfind]fetchdir.c
Added code for VMS directory names.
Added code for old-style VMS inode data structures.
[.libfind]find.c
Added a type cast to clear a QUESTCOMPARE1 compiler complaint.
Added code for old-style VMS inode data structures.
[.libfind]find_list.c
Added "#include <schily/stat.h>" to get "struct stat" declared before
it's used.
Added code for old-style VMS inode data structures.
[.libfind]names.c
Changed the definition of namegid() to agree with the prototype when
gid_t is "short".
[.libfind]walk.c
Added a VMS-specific declaration of "statfun".
Added code for VMS directory names.
Added code for old-style VMS inode data structures.
------------------------------------------------------------------------
[.libscg]scsi-vms.c
Corrected some cases where errno or a returned status value was not
set properly.
Changed to use the device-specific "gk_chan" variable (in the
"scg_local" structure), instead of the (now removed) global "gk_chan"
variable.
Added support for simple VMS device names (instead of requiring
"bus,target,lun" notation).
Added an explicit check for privileges DIAGNOSE and PHY_IO.
Added a check to avoid molesting mounted disk devices.
Added an IA64-specific work-around for a system crash (MACHINECHK) on
IA64. (EHH.)
[.libscg]scsierrs.c
Added type casts to clear PTRMISMATCH compiler complaints.
[.libscg]scsihelp.c
Changed a message to say "VMS" instead of "UNIX" on VMS.
------------------------------------------------------------------------
[.libschily]format.c
Changed to avoid redefining the USE_LONGLONG macro.
[.libschily]gethostid.c
Added "#include <schily/schily.h>" to get the prototype of
seterrno().
[.libschily]saveargs.c
Changed to simplify the full VMS path for argv[ 0] to just the
program name.
[.libschily]snprintf.c
Changed "snprintf" macro handling to allow an OS-specific definition
in [.include]mconfig.h.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[.libschily.stdio]filewrite.c
Changed "fwrite(buf, 1, len, f)" to "fwrite(buf, len, 1, f)" to get
one record of length "len", instead of "len" records of length one,
which repairs the appearance of some error messages when the program
output is directed to a file with variable-length record format (as with
SET HOST /LOG).
------------------------------------------------------------------------
[.libvms] (NEW)
[.libvms]decc_ver.c
Diagnostic program to report various software version data (VMS, C
compiler, C RTL).
[.libvms]vms_init.c
Exit handler.
Process priority setting (nice() replacement).
DECC$* initialization.
RMS default parameter sensing.
Access callback function.
[.libvms]vms_init.h
Header file for vms_init.c.
[.libvms]vms_misc.c
VMS-specific _openfd() replacement function, openfd_vms().
Conditional str[n]casecmp() function.
ODS5 extended file name infrastructure.
[.libvms]vms_misc.h
Header file for vms_misc.c.
------------------------------------------------------------------------
[.mkisofs]defaults.h
Renamed to [.mkisofs]mdefaults.h to avoid confusion with
[.cdrecord]defaults.h.
[.mkisofs]mkisofs.c
Added VMS-specific fopen() parameters for access callback function.
Added "-E" option for ISO 9660 header (environment) display.
("#ifdef SMS", enabled by the VMS builders.)
Changed to notify user of use or non-use of init file with "-E" or
"-v". ("#ifdef SMS", enabled by the VMS builders.)
Changed not to use "/" as a separator when forming the ".mkisofsrc"
init file path in VMS.
Changed to use "/" for CD paths instead of PATH_SEPARATOR, which is
different (']') for VMS.
Changed to tolerate blank lines in the init file.
Changed to use "NLA0:" instead of "/dev/null" on VMS.
[.mkisofs]mkisofs.h
Changed '#include "defaults.h"' to '#include "mdefaults.h"'.
Added a prototype for the new function, write_one_file_progress().
[.mkisofs]multi.c
Removed unnecessary VMS-specific #include directives.
[.mkisofs]name.c
Changed to use a header file definition of the ".DIR;1" string, and
to make a case-insensitive comparison with it to accomodate ODS5
extended file names.
[.mkisofs]tree.c
Adjusted VMS-specific #include directives.
Added one more use of "vms_path_fixup()", needed with new C RTL.
Added some code to remove caret escape characters from ODS5 extended
file names. (Not well tested.)
[.mkisofs]vms.c
Removed code for functions now in the C RTL or no longer used:
closedir. getopt, opendir, readdir, [VMS_]stat, strdup.
Set up initialization (non-VAX) to set DECC$* variables.
Changed vms_path_fixup() and RMS I/O functions to cope with ODS5
extended file names.
Changed vms_write_one_file() to use the same progress messages as
write_one_file().
Added functions for VMS-UNIX name conversion.
[.mkisofs]vms.h
Removed code for functions now in the C RTL or no longer used.
Added macro kit for NAML structure for ODS5 extended file names.
Added function prototypes for path_unix_vms(), vms_dir_fixup(),
vms_path_fixdown()vms_path_fixup() and vms_write_one_file().
[.mkisofs]walk.c
Added code for VMS directory names.
[.mkisofs]write.c
Separated progress message code into a new function,
write_one_file_progress(), now used by both vms_write_one_file() and
write_one_file().
Changed a relational operator to clear a QUESTCOMPARE compiler
complaint.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[.mkisofs.diag]dump.c
[.mkisofs.diag]isodebug.c
[.mkisofs.diag]isodump.c
[.mkisofs.diag]isoinfo.c
[.mkisofs.diag]isovfy.c
Removed explicit directories from "#include" directives. (With the
change from [.mkisofs]defaults.h to [.mkisofs]mdefaults.h, this change
should work everywhere.)
In isoinfo.c, added code for old-style VMS inode data structures.
[.mkisofs.diag]vms_diag.c (NEW)
Set up initialization (non-VAX) to set DECC$* variables.
------------------------------------------------------------------------
[.readcd]readcd.c
Changed to skip bus scan on VMS.
[.readcd]vms.c (NEW)
Set up initialization (non-VAX) to set DECC$* variables.
------------------------------------------------------------------------
[.scgcheck]scgcheck.c
Changed to skip bus scan on VMS.
Minor spelling corrections.
[.scgcheck]vms.c (NEW)
Set up initialization (non-VAX) to set DECC$* variables.
------------------------------------------------------------------------
[.vms] (NEW)
[.vms]append_version.com
Command procedure used to extract a version number from cdrecord.c,
for use in other programs.
[.vms]collect_deps.com
Command procedure used to collect individual generated MMS dependency
files, making the dependency paths relative.
[.vms]descrip.mms
Main MMS description file.
[.vms]descrip_local.mms
Local customization MMS description file.
[.vms]descrip_local.mms_template
Template for the local customization MMS description file.
[.vms]descrip_mkdeps.mms
Dependency generation MMS description file.
[.vms]descrip_src.mms
Source MMS description file.
[.vms]descrip_src_cmn.mms
Common source MMS description file.
[.vms]descrip_src_flags.mms
Compiler and linker flags MMS description file.
[.vms]discard_link_files.com
Command procedure used to locate and rename troublesome header link
files which may be created by VMSTAR.
[.vms]restore_file_links.sh
Shell script to restore symbolic links which VMSTAR replaced by text
files.
[.vms]stream_lf.fdl
File Definition Language file used to create generated header files
with Stream_LF record format.
[.vms]vax_old.opt
Link options file used to reduce LINK warning messages on old VMS
versions.
[.vms]vms_name_fix.sh
Shell script to restore non-lower-case file names which an ODS2 file
system and Zip archiving converted to lower case.
[.vms]vms_notes.txt
This file.
------------------------------------------------------------------------
========================================================================