<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Joshua and Tim,<div><br></div><div>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.</div><div><br></div><div><div>Larry Baker<br>US Geological Survey<br>650-329-5608<br><a href="mailto:baker@usgs.gov">baker@usgs.gov</a><br></div><div><br class="webkit-block-placeholder"></div></div><div><br></div><div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000">ODS2 V2.0, 28 June 2005</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">Significant changes:</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">1. Addition of the SUBSTITUTE command to associate a file containing an ODS-2</font></div><div><font class="Apple-style-span" color="#000000">   image with a (arbitrary) device name.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">      SUBST                 lists all the virtual device names and files</font></div><div><font class="Apple-style-span" color="#000000">      SUBST device          lists the file for a single virtual device</font></div><div><font class="Apple-style-span" color="#000000">      SUBST device file     associates a file with a virtual device</font></div><div><font class="Apple-style-span" color="#000000">      SUBST device /DELETE  removes the virtual device-to-file association</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">   (E.g., can be used to read the ODS-2 virtual disks from a SIMH VAX simulator.</font></div><div><font class="Apple-style-span" color="#000000">   See the Computer History Simulation Project at simh.trailing-edge.com.)</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">   Due to the limitations of the Unix lseek() function, on most platforms an</font></div><div><font class="Apple-style-span" color="#000000">   ODS-2 image file cannot be larger than 2 GB.  The position within a file is</font></div><div><font class="Apple-style-span" color="#000000">   specified using an off_t offset, which is usually a 32-bit signed integer.</font></div><div><font class="Apple-style-span" color="#000000">   Use the STATISTICS command to see whether large files (>2GB) are suppported.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">   OpenVMS/Alpha V7.2 C RTL (SYS$LIBRARY:DECC$SHR.EXE) V7.2-1-04 and later</font></div><div><font class="Apple-style-span" color="#000000">   support 64-bit off_t file offsets.  <a href="http://BUILD.COM">BUILD.COM</a> examines the version of the</font></div><div><font class="Apple-style-span" color="#000000">   C RTL and compiles with /DEFINE=(_LARGEFILE) if 64-bit off_t is supported.</font></div><div><font class="Apple-style-span" color="#000000">   For OpenVMS/VAX, and OpenVMS/Alpha systems without 64-bit off_t support,</font></div><div><font class="Apple-style-span" color="#000000">   an attempt to open a file larger than 2 GB fails with mount error 10036</font></div><div><font class="Apple-style-span" color="#000000">   (SS$_OFFSET_TOO_BIG).</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">   On Windows 2000/XP, an ODS-2 image file is accessed using WIN32, which</font></div><div><font class="Apple-style-span" color="#000000">   supports 64-bit file offsets.  However, the FAT32 file system limits a file</font></div><div><font class="Apple-style-span" color="#000000">   to 2 GB; files on an NTFS file system can be any size.  (However, I have</font></div><div><font class="Apple-style-span" color="#000000">   only tested ods2.exe on a 435 MB ODS-2 image file.)</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">   On Unix (Linux, Mac OS X, Solaris, etc.), _FILE_OFFSET_BITS is defined to be</font></div><div><font class="Apple-style-span" color="#000000">   64 in phyunix.c.  (See <a href="http://www.unix.org/version2/whatsnew/lfs20mar.html">http://www.unix.org/version2/whatsnew/lfs20mar.html</a>,</font></div><div><font class="Apple-style-span" color="#000000">   section A.3.2.4.)  For systems that recognize this preprocessor macro, ODS-2</font></div><div><font class="Apple-style-span" color="#000000">   image files can be larger than 2 GB, assuming the underlying file system</font></div><div><font class="Apple-style-span" color="#000000">   supports files larger than 2 GB.  (See <a href="http://www.suse.de/~aj/linux_lfs.html">http://www.suse.de/~aj/linux_lfs.html</a>,</font></div><div><font class="Apple-style-span" color="#000000">   for example, for information on the versions of the Linux file systems that</font></div><div><font class="Apple-style-span" color="#000000">   support large files.)</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">2. Where it makes sense, you may quote a command argument, e.g., to specify</font></div><div><font class="Apple-style-span" color="#000000">   a Unix path name containing slashes.  (Otherwise, the slash begins a</font></div><div><font class="Apple-style-span" color="#000000">   command qualifier.)  Commands cannot be quoted.  A pair of " or ' quotes</font></div><div><font class="Apple-style-span" color="#000000">   must surround the entire command argument (there is no escape charcter),</font></div><div><font class="Apple-style-span" color="#000000">   or, for the MOUNT command, each volume label in the comma-separated list.</font></div><div><font class="Apple-style-span" color="#000000">   Device names and ODS-2 file names cannot be quoted.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000"><a href="http://build.com">build.com</a>:</font></div><div><font class="Apple-style-span" color="#000000">   Remove /Warn= compiler flag -- DECC's system include files give errors.</font></div><div><font class="Apple-style-span" color="#000000">   Force /Define=(NO_DOLLAR) compiler flag.</font></div><div><font class="Apple-style-span" color="#000000">   Force CC/VAXC on a VAX -- CC/DECC won't link on a VAX.</font></div><div><font class="Apple-style-span" color="#000000">   Use LNK$Library logical in place of vaxcrtl.tmp/option's file.</font></div><div><font class="Apple-style-span" color="#000000">   Use native VMS system services in place of vmstime.c functions.</font></div><div><font class="Apple-style-span" color="#000000">   Add /Define=(_LARGEFILE) if the OpenVMS/Alpha C RTL supports 64-bit off_t.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">makefile.*:</font></div><div><font class="Apple-style-span" color="#000000">   Remove -DVERSION= (it's hard-coded in ods2.c).</font></div><div><font class="Apple-style-span" color="#000000">   Use CC = gcc to force GNU C in place of the default cc compiler.</font></div><div><font class="Apple-style-span" color="#000000">   Don't bother with separate compilations (less clutter)</font></div><div><font class="Apple-style-span" color="#000000">   Add clean: $(RM) ods2 $(OBJS).</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">makefile.linux86:</font></div><div><font class="Apple-style-span" color="#000000">   New file: little-endian, default cc compiler.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">makefile.macosx:</font></div><div><font class="Apple-style-span" color="#000000">   New file: big-endian, default cc compiler.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">makefile.solaris:</font></div><div><font class="Apple-style-span" color="#000000">   Add CC = gcc.</font></div><div><font class="Apple-style-span" color="#000000">   Add DEFS = -DODS2_BIG_ENDIAN.</font></div><div><font class="Apple-style-span" color="#000000">   Change hard-coded gcc to $(CC).</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">makefile.solaris86:</font></div><div><font class="Apple-style-span" color="#000000">   New file: little-endian, gcc compiler.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">makefile.tru64:</font></div><div><font class="Apple-style-span" color="#000000">   Change hard-coded cc to $(CC).</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">makefile.unix:</font></div><div><font class="Apple-style-span" color="#000000">   Add DEFS = -DODS2_BIG_ENDIAN.</font></div><div><font class="Apple-style-span" color="#000000">   Change hard-coded gcc to $(CC).</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">makefile.unix86:</font></div><div><font class="Apple-style-span" color="#000000">   New file: little-endian, default cc compiler.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">*.h:</font></div><div><font class="Apple-style-span" color="#000000">   Add #include guards.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">access.h:</font></div><div><font class="Apple-style-span" color="#000000">   Change BIG_ENDIAN to ODS2_BIG_ENDIAN (gcc #defines BIG_ENDIAN by default in</font></div><div><font class="Apple-style-span" color="#000000">      various /usr/include/*.h files).</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">stsdef.h:</font></div><div><font class="Apple-style-span" color="#000000">   New file: #define STS$M_SUCCESS 1.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">ods2.h:</font></div><div><font class="Apple-style-span" color="#000000">   New file: global access for phyio routines to domount() options.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">*.c:</font></div><div><font class="Apple-style-span" color="#000000">   Use named constants in place of literals.</font></div><div><font class="Apple-style-span" color="#000000">   #include <stsdef.h> and #include "stsdef.h".</font></div><div><font class="Apple-style-span" color="#000000">   Remove #include <memory.h> (ANSI C mem functions are in <string.h>).</font></div><div><font class="Apple-style-span" color="#000000">   Conditionally #define TRUE and FALSE if not #define'd in <stdlib.h>.</font></div><div><font class="Apple-style-span" color="#000000">   Add visual separators (comments) to easily locate each function.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">access.c:</font></div><div><font class="Apple-style-span" color="#000000">   dismount() calls phyio_done() to release device resources (e.g., close</font></div><div><font class="Apple-style-span" color="#000000">   ODS-2 image file, deassign device I/O channel, etc.).</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">ods2.c:</font></div><div><font class="Apple-style-span" color="#000000">   #define MODULE_IDENT "V2.0".</font></div><div><font class="Apple-style-span" color="#000000">   Add #error assertions to verify command qualifiers with their bit masks.</font></div><div><font class="Apple-style-span" color="#000000">   Implement quoted arguments (paired " or ' quotes) in cmdsplit()</font></div><div><font class="Apple-style-span" color="#000000">      (there are no escape characters).</font></div><div><font class="Apple-style-span" color="#000000">   Add "substitute drive: file" to mount a disk image file vs. a device.</font></div><div><font class="Apple-style-span" color="#000000">   Remove VMSIO conditional code (it is incompatible with subst/mount).</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">rms.c</font></div><div><font class="Apple-style-span" color="#000000">   Fix table of file name component delimeters.</font></div><div><font class="Apple-style-span" color="#000000">   Fix cleanup of stale wildcard context in do_parse() ("nam$nam$l_wcc == 0"</font></div><div><font class="Apple-style-span" color="#000000">      changed to "nam$nam$l_wcc != NULL").</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">phynt.c:</font></div><div><font class="Apple-style-span" color="#000000">   Fix memcpy() in phyio_write() (it overwrote the buffer with the disk</font></div><div><font class="Apple-style-span" color="#000000">      contents instead of updating the disk with the buffer contents).</font></div><div><font class="Apple-style-span" color="#000000">   Eliminate struct CHANTAB; move struct CHANTAB fields to struct DEV in</font></div><div><font class="Apple-style-span" color="#000000">      device.h.</font></div><div><font class="Apple-style-span" color="#000000">   Use WIN32 file I/O to access ODS-2 image files.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">phyunix.c:</font></div><div><font class="Apple-style-span" color="#000000">   Change #include <strings.h> to #include <string.h>.</font></div><div><font class="Apple-style-span" color="#000000">   Add entry phyio_path() that returns the full path of it's file argument.</font></div><div><font class="Apple-style-span" color="#000000">      (The file may or may not exist; some systems consider it an error if the</font></div><div><font class="Apple-style-span" color="#000000">      file does not exist, others do not.)</font></div><div><font class="Apple-style-span" color="#000000">   Use POSIX file I/O to access ODS-2 image files.</font></div><div><font class="Apple-style-span" color="#000000">   #define _FILE_OFFSET_BITS 64 for large file support (64-bit off_t).</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">phyvms.c:</font></div><div><font class="Apple-style-span" color="#000000">   Use POSIX file I/O to access ODS-2 image files.</font></div><div><font class="Apple-style-span" color="#000000">   Return mount error SS$_OFFSET_TOO_BIG if ODS-2 file is greater than 2 GB and</font></div><div><font class="Apple-style-span" color="#000000">      sizeof( off_t ) is less than 64 bits.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">update.c:</font></div><div><font class="Apple-style-span" color="#000000">   Change BIG_ENDIAN to ODS2_BIG_ENDIAN (gcc #defines BIG_ENDIAN by default in</font></div><div><font class="Apple-style-span" color="#000000">      various /usr/include/*.h files).</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">virtual.*:</font></div><div><font class="Apple-style-span" color="#000000">   New files: implementation of substitute command/virtual devices.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">vmstime.*:</font></div><div><font class="Apple-style-span" color="#000000">   Change VMSTIME timadr to pVMSTIME timadr.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">=====</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">I found on Linux that access to a CD-ROM via /dev/cdrom (or /dev/hdd) works fine</font></div><div><font class="Apple-style-span" color="#000000">to read an ODS-2 CD written by an InfoServer, e.g., $> mount cdrom.</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">On Mac OS X, that is not the case.  I had to specify the partition (track?) as</font></div><div><font class="Apple-style-span" color="#000000">part of the device name, e.g., $> mount disk1s0 to open /dev/disk1s0.  (Be</font></div><div><font class="Apple-style-span" color="#000000">careful on Mac OS X: there is no /dev/cdrom that is soft-linked to the actual</font></div><div><font class="Apple-style-span" color="#000000">CD/DVD device name.  I do not know how to reliably determine the actual CD/DVD</font></div><div><font class="Apple-style-span" color="#000000">device name -- I use ls /dev/disk* and df, then eliminate the /dev/disk* devices</font></div><div><font class="Apple-style-span" color="#000000">that show up as mounted.  You could probably insert an ISO-9660 disk in the</font></div><div><font class="Apple-style-span" color="#000000">CD/DVD drive and use df to see what the CD/DVD device name is.)</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">=====</font></div><div><font class="Apple-style-span" color="#000000"><br></font></div><div><font class="Apple-style-span" color="#000000">Larry Baker</font></div><div><font class="Apple-style-span" color="#000000">US Geological Survey</font></div><div><font class="Apple-style-span" color="#000000"><a href="mailto:baker@usgs.gov">baker@usgs.gov</a></font></div></blockquote></div><div><div><br></div></div><div><div><br>
</div>
<br><div><div>On 3 Mar 2016, at 6:48 AM, <<a href="mailto:simh-request@trailing-edge.com">simh-request@trailing-edge.com</a>> <<a href="mailto:simh-request@trailing-edge.com">simh-request@trailing-edge.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: 'Helvetica Neue'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">Date: Thu, 3 Mar 2016 14:35:52 +0000<br>From: Joshua Overmiller <<a href="mailto:overmiller@gmail.com">overmiller@gmail.com</a>><br>To:<span class="Apple-converted-space"> </span><a href="mailto:simh@trailing-edge.com">simh@trailing-edge.com</a><br>Subject: [Simh] Mounting simh disk files in Linux<br>Message-ID:<br><span class="Apple-tab-span" style="white-space: pre; ">   </span><<a href="mailto:CALDuRfJg3k79c0rMv_7k5mR1zK6s1+9sT4hKDsJdqu4bzx-aKg@mail.gmail.com">CALDuRfJg3k79c0rMv_7k5mR1zK6s1+9sT4hKDsJdqu4bzx-aKg@mail.gmail.com</a>><br>Content-Type: text/plain; charset="utf-8"<br><br>I've built the ods2 tool and ods2reader from<span class="Apple-converted-space"> </span><a href="http://www.vms2linux.de/">http://www.vms2linux.de/</a><span class="Apple-converted-space"> </span>in<br>order to try to read the simh disk files.<br><br>However, trying "ods2 mount d0.dsk" responds with "Mount failed with 2312".<br>Trying "ods2reader -l d0:[000000]"  gives:<br>   d0:[000000] -- Bad block in file<br>   d0:[000000] --- Cant't read index file header on d0<br><br>d0.dsk corresponds to DAU0 which is a RA92 disk.<br><br>Note there were some warnings when building both tools, but they both build.<br><br>For ods2:<br><br>ods2.c: In function ‘main’:<br>ods2.c:1165:13: warning: ‘gets’ is deprecated (declared at<br>/usr/include/stdio.h:638) [-Wdeprecated-declarations]<br>            if (gets(str) == NULL) break;<br>ods2.o: In function `main':<br>ods2.c:(.text.startup+0x2d5): warning: the `gets' function is dangerous and<br>should not be used.<br><br>For ods2reader:<br>Various warnings about implicit declaraions of builtin functions strlen,<br>strcpy, and strcat.<br><br><br><br><br>More info to follow to get some insight into what my plans are.<br><br>My end goal is to migrate a physical MicroVAX 3100-90 VMS 5.5 system to<br>simh.<br>I've been playing around with learning the BACKUP utility and Stand-Alone<br>BACKUP under simh before I try anything out on the real system.  I can make<br>an image backup of the system disk to a SAVE_SET on another disk.  The<br>MicroVAX has the CMUIP installed so I can FTP the SAVE_SET off onto our<br>network.  I plan to write the SAVE_SET to an iso image for simh VAX to<br>mount and copy to a local disk.  I will then use BACKUP to restore the save<br>set to a local disk.<br><br>I will also want to get some files off the simh VAX.  Hence the need to<br>mount the simh disk image files.<br><br>I'm struggling with getting the networking running in simh, so I'm looking<br>into this route.  However, other suggestions for getting files out of the<br>simh disk image files are welcome.<br><br><br>Thanks,<br><br>Josh<br>.<br></span></span></blockquote></div><br></div></body></html>