[Simh] Simh Digest, Vol 146, Issue 4

Larry Baker baker at usgs.gov
Thu Mar 3 13:59:48 EST 2016


Joshua and Tim,

Over ten years ago I modified the DECUS ODS2 Reader written by Paul Nankervis and Hunter Goatley.  Below are my notes in an aareadme.two file I found.  BEWARE: it looks like the Mac OS version was done when Macs were PowerPCs, thus it is big endian.  If anyone wants my code, let me know.

Larry Baker
US Geological Survey
650-329-5608
baker at usgs.gov


> ODS2 V2.0, 28 June 2005
> 
> Significant changes:
> 
> 1. Addition of the SUBSTITUTE command to associate a file containing an ODS-2
>    image with a (arbitrary) device name.
> 
>       SUBST                 lists all the virtual device names and files
>       SUBST device          lists the file for a single virtual device
>       SUBST device file     associates a file with a virtual device
>       SUBST device /DELETE  removes the virtual device-to-file association
> 
>    (E.g., can be used to read the ODS-2 virtual disks from a SIMH VAX simulator.
>    See the Computer History Simulation Project at simh.trailing-edge.com.)
> 
>    Due to the limitations of the Unix lseek() function, on most platforms an
>    ODS-2 image file cannot be larger than 2 GB.  The position within a file is
>    specified using an off_t offset, which is usually a 32-bit signed integer.
>    Use the STATISTICS command to see whether large files (>2GB) are suppported.
> 
>    OpenVMS/Alpha V7.2 C RTL (SYS$LIBRARY:DECC$SHR.EXE) V7.2-1-04 and later
>    support 64-bit off_t file offsets.  BUILD.COM examines the version of the
>    C RTL and compiles with /DEFINE=(_LARGEFILE) if 64-bit off_t is supported.
>    For OpenVMS/VAX, and OpenVMS/Alpha systems without 64-bit off_t support,
>    an attempt to open a file larger than 2 GB fails with mount error 10036
>    (SS$_OFFSET_TOO_BIG).
> 
>    On Windows 2000/XP, an ODS-2 image file is accessed using WIN32, which
>    supports 64-bit file offsets.  However, the FAT32 file system limits a file
>    to 2 GB; files on an NTFS file system can be any size.  (However, I have
>    only tested ods2.exe on a 435 MB ODS-2 image file.)
> 
>    On Unix (Linux, Mac OS X, Solaris, etc.), _FILE_OFFSET_BITS is defined to be
>    64 in phyunix.c.  (See http://www.unix.org/version2/whatsnew/lfs20mar.html,
>    section A.3.2.4.)  For systems that recognize this preprocessor macro, ODS-2
>    image files can be larger than 2 GB, assuming the underlying file system
>    supports files larger than 2 GB.  (See http://www.suse.de/~aj/linux_lfs.html,
>    for example, for information on the versions of the Linux file systems that
>    support large files.)
> 
> 2. Where it makes sense, you may quote a command argument, e.g., to specify
>    a Unix path name containing slashes.  (Otherwise, the slash begins a
>    command qualifier.)  Commands cannot be quoted.  A pair of " or ' quotes
>    must surround the entire command argument (there is no escape charcter),
>    or, for the MOUNT command, each volume label in the comma-separated list.
>    Device names and ODS-2 file names cannot be quoted.
> 
> build.com:
>    Remove /Warn= compiler flag -- DECC's system include files give errors.
>    Force /Define=(NO_DOLLAR) compiler flag.
>    Force CC/VAXC on a VAX -- CC/DECC won't link on a VAX.
>    Use LNK$Library logical in place of vaxcrtl.tmp/option's file.
>    Use native VMS system services in place of vmstime.c functions.
>    Add /Define=(_LARGEFILE) if the OpenVMS/Alpha C RTL supports 64-bit off_t.
> 
> makefile.*:
>    Remove -DVERSION= (it's hard-coded in ods2.c).
>    Use CC = gcc to force GNU C in place of the default cc compiler.
>    Don't bother with separate compilations (less clutter)
>    Add clean: $(RM) ods2 $(OBJS).
> 
> makefile.linux86:
>    New file: little-endian, default cc compiler.
> 
> makefile.macosx:
>    New file: big-endian, default cc compiler.
> 
> makefile.solaris:
>    Add CC = gcc.
>    Add DEFS = -DODS2_BIG_ENDIAN.
>    Change hard-coded gcc to $(CC).
> 
> makefile.solaris86:
>    New file: little-endian, gcc compiler.
> 
> makefile.tru64:
>    Change hard-coded cc to $(CC).
> 
> makefile.unix:
>    Add DEFS = -DODS2_BIG_ENDIAN.
>    Change hard-coded gcc to $(CC).
> 
> makefile.unix86:
>    New file: little-endian, default cc compiler.
> 
> *.h:
>    Add #include guards.
> 
> access.h:
>    Change BIG_ENDIAN to ODS2_BIG_ENDIAN (gcc #defines BIG_ENDIAN by default in
>       various /usr/include/*.h files).
> 
> stsdef.h:
>    New file: #define STS$M_SUCCESS 1.
> 
> ods2.h:
>    New file: global access for phyio routines to domount() options.
> 
> *.c:
>    Use named constants in place of literals.
>    #include <stsdef.h> and #include "stsdef.h".
>    Remove #include <memory.h> (ANSI C mem functions are in <string.h>).
>    Conditionally #define TRUE and FALSE if not #define'd in <stdlib.h>.
>    Add visual separators (comments) to easily locate each function.
> 
> access.c:
>    dismount() calls phyio_done() to release device resources (e.g., close
>    ODS-2 image file, deassign device I/O channel, etc.).
> 
> ods2.c:
>    #define MODULE_IDENT "V2.0".
>    Add #error assertions to verify command qualifiers with their bit masks.
>    Implement quoted arguments (paired " or ' quotes) in cmdsplit()
>       (there are no escape characters).
>    Add "substitute drive: file" to mount a disk image file vs. a device.
>    Remove VMSIO conditional code (it is incompatible with subst/mount).
> 
> rms.c
>    Fix table of file name component delimeters.
>    Fix cleanup of stale wildcard context in do_parse() ("nam$nam$l_wcc == 0"
>       changed to "nam$nam$l_wcc != NULL").
> 
> phynt.c:
>    Fix memcpy() in phyio_write() (it overwrote the buffer with the disk
>       contents instead of updating the disk with the buffer contents).
>    Eliminate struct CHANTAB; move struct CHANTAB fields to struct DEV in
>       device.h.
>    Use WIN32 file I/O to access ODS-2 image files.
> 
> phyunix.c:
>    Change #include <strings.h> to #include <string.h>.
>    Add entry phyio_path() that returns the full path of it's file argument.
>       (The file may or may not exist; some systems consider it an error if the
>       file does not exist, others do not.)
>    Use POSIX file I/O to access ODS-2 image files.
>    #define _FILE_OFFSET_BITS 64 for large file support (64-bit off_t).
> 
> phyvms.c:
>    Use POSIX file I/O to access ODS-2 image files.
>    Return mount error SS$_OFFSET_TOO_BIG if ODS-2 file is greater than 2 GB and
>       sizeof( off_t ) is less than 64 bits.
> 
> update.c:
>    Change BIG_ENDIAN to ODS2_BIG_ENDIAN (gcc #defines BIG_ENDIAN by default in
>       various /usr/include/*.h files).
> 
> virtual.*:
>    New files: implementation of substitute command/virtual devices.
> 
> vmstime.*:
>    Change VMSTIME timadr to pVMSTIME timadr.
> 
> =====
> 
> I found on Linux that access to a CD-ROM via /dev/cdrom (or /dev/hdd) works fine
> to read an ODS-2 CD written by an InfoServer, e.g., $> mount cdrom.
> 
> On Mac OS X, that is not the case.  I had to specify the partition (track?) as
> part of the device name, e.g., $> mount disk1s0 to open /dev/disk1s0.  (Be
> careful on Mac OS X: there is no /dev/cdrom that is soft-linked to the actual
> CD/DVD device name.  I do not know how to reliably determine the actual CD/DVD
> device name -- I use ls /dev/disk* and df, then eliminate the /dev/disk* devices
> that show up as mounted.  You could probably insert an ISO-9660 disk in the
> CD/DVD drive and use df to see what the CD/DVD device name is.)
> 
> =====
> 
> Larry Baker
> US Geological Survey
> baker at usgs.gov




On 3 Mar 2016, at 6:48 AM, <simh-request at trailing-edge.com> <simh-request at trailing-edge.com> wrote:

> Date: Thu, 3 Mar 2016 14:35:52 +0000
> From: Joshua Overmiller <overmiller at gmail.com>
> To: simh at trailing-edge.com
> Subject: [Simh] Mounting simh disk files in Linux
> Message-ID:
> 	<CALDuRfJg3k79c0rMv_7k5mR1zK6s1+9sT4hKDsJdqu4bzx-aKg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> I've built the ods2 tool and ods2reader from http://www.vms2linux.de/ in
> order to try to read the simh disk files.
> 
> However, trying "ods2 mount d0.dsk" responds with "Mount failed with 2312".
> Trying "ods2reader -l d0:[000000]"  gives:
>    d0:[000000] -- Bad block in file
>    d0:[000000] --- Cant't read index file header on d0
> 
> d0.dsk corresponds to DAU0 which is a RA92 disk.
> 
> Note there were some warnings when building both tools, but they both build.
> 
> For ods2:
> 
> ods2.c: In function ‘main’:
> ods2.c:1165:13: warning: ‘gets’ is deprecated (declared at
> /usr/include/stdio.h:638) [-Wdeprecated-declarations]
>             if (gets(str) == NULL) break;
> ods2.o: In function `main':
> ods2.c:(.text.startup+0x2d5): warning: the `gets' function is dangerous and
> should not be used.
> 
> For ods2reader:
> Various warnings about implicit declaraions of builtin functions strlen,
> strcpy, and strcat.
> 
> 
> 
> 
> More info to follow to get some insight into what my plans are.
> 
> My end goal is to migrate a physical MicroVAX 3100-90 VMS 5.5 system to
> simh.
> I've been playing around with learning the BACKUP utility and Stand-Alone
> BACKUP under simh before I try anything out on the real system.  I can make
> an image backup of the system disk to a SAVE_SET on another disk.  The
> MicroVAX has the CMUIP installed so I can FTP the SAVE_SET off onto our
> network.  I plan to write the SAVE_SET to an iso image for simh VAX to
> mount and copy to a local disk.  I will then use BACKUP to restore the save
> set to a local disk.
> 
> I will also want to get some files off the simh VAX.  Hence the need to
> mount the simh disk image files.
> 
> I'm struggling with getting the networking running in simh, so I'm looking
> into this route.  However, other suggestions for getting files out of the
> simh disk image files are welcome.
> 
> 
> Thanks,
> 
> Josh
> .

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20160303/3e84b1be/attachment-0001.html>


More information about the Simh mailing list