Subject: Dual File Structure CD for RT-11

From: "Jerome H. Fine" <[email-masked]>
Date: Mon Mar 3 22:39:01 2003

I don't know how many people might be interested, but I have finally
been successful in creating a Bootable RT-11 CD which also has
the standard ISO file structure.  However, the really key point is
that none of the files on the CD are duplicated.

On the other hand, I am unable to test the CD that I just burned
using real DEC  PDP-11 hardware since I have never tried very
hard to find and successfully test a CD-ROM drive with a SCSI
host adapter on the Qbus PDP-11 which is available for such
purposes.  But, using the Full Commercial Ersatz-11 running
under Windows 98 SE, I just did the commands:
MOUNT  DU0:  SCSI0:
BOOT  DU0:

I assume that if I had a suitable real DEC PDP-11 system with
a SCSI  CD-ROM drive, the exercise would work there as well
since I know that others have been successful with an RT-11
ONLY  CD that boots on real DEC  PDP-11 hardware.

Since many of you reading this who don't know much about RT-11
will likely be confused, let me describe very briefly how I started.
I first took 4 RT-11  RL02 bootable images or DSK files, each being
20450 blocks long.  Since only the first 5000 to 6000 blocks of each
file contained useful non-zero information, I reduced each image to the
size that did not contain any blocks with all zeros so that all 4 RL02
images would fit into a single RT-11 partitions of 65536 blocks.   I
then
used Nero Burning under Windows 98 SE to copy all 4 RL02 images
to a CD which had the standard ISO file structure after which I copied
24612 blocks from the CD-RW to a file under Windows 98 SE:
Blocks 0 to 63               -  All zeros
Blocks 64 to 99             -  Standard ISO file structure
Blocks 100 to 24599     - The 4 files
Blocks 24600 to 24603 - Extra information for the standard ISO file
structure
Blocks 24604 to 24611 - All zeros
The first file from block 100 to block 5192 was the RL02 bootable
image for V5.03 of RT-11.

There is one technical problem I have not solved - the current
test was done with a CD with an image that is identical to a
file of 24612 decimal blocks - which is less than one full RT-11
partition.  If I am going to be able to use a CD with more than
65536 decimal blocks of files (i.e. more than one full RT-11
partition), I will have to solve one critical problem.  I must find
a method of preventing any files under the standard ISO file
structure from using any CD sectors that fall in the first 16 that
start on a multiple of 16384 sectors (of 2048 bytes which is
how a CD is written for those users who might not know).
These number correspond to the first 64 blocks that start on
a multiple of 65536 blocks (of 512 bytes) on a hard disk drive
which corresponds to each RT-11 partition.

Before I describe the details, note that the method is probably
useful ONLY when the CD contains a limited number of large
files.  This is because the RT-11 directory on the CD must be
mostly constructed by hand at the present time.

The first step is to create an exact copy of a CD which has been
burned with the desired DSK files.  This image file can be
created using PUTR to specify the exact size plus E11 and RT-11
to copy all the blocks from the CD to the image file.

The critical reason that everything works seems to be a rather
fortunate use of the mutually exclusive areas by the RT-11 file
structure and the standard ISO file structure.  While RT-11
requires the first 64 blocks (of 512 bytes) for the boot blocks
and file structure, the standard ISO file structure uses the next
9 sectors from sector 16 to sector 24 (of 2048 bytes) which
allows the RT-11 DSK files to start at block number 100 or
sector number 25.  All that is required (from the RT-11 file
structure for the RT-11 DSK file that is in the first RT-11
partition) is to copy the RT-11 file structure (ONLY - i.e. just
blocks zero to where the directory segments stop) to the start
of the image file (which is initially identical to the ISO file
structure CD image with the DSK files placed on the CD
using standard CD burning software - in my case I used
Nero Burning on a CD-RW so that I need not toss the CD).

I produced that image file by using E11 and RT-11 to copy
the CD-RW image to an existing file under Windows 98 SE.
In my test, since I chose the first DSK file which started at
block 100, the next step was to add 100 to the starting block
number in each directory segment.  The final step was to then
select the monitor that I wanted to boot and write the correct
boot programs into block zero and 2 through 5 of the image
file.  All of the extra steps were easily accomplished using
E11 and RT-11.

The following summary probably helps:
RT-11 file structure:  Blocks 0 to 63, Sectors 0 to 15
ISO file structure:      Blocks 64 to 99, Sectors 16 to 24
RT-11 files:               Blocks 100 to 65535 for partition zero
ISO files:                   Sectors 25 to end of CD
To create an RT-11 bootable CD, I copied the original CD
image to a Windows 98 SE file on the hard disk.  I then copied
did an INIT  DU0:/VOLUME under RT-11 after which is copied
blocks 106, 107, 108, 109, 110 and 111 to blocks 6,7,8,9,10,11.
The SIPP was used to add 100 (144 octal) to the fifth word in
blocks 6, 8 and 10.  The last step was to use the RT-11 command
COPY/BOOT  DU0:RT11XM.SYS  DU0:

I then had to use the "Burn Image" option under Nero Burning to
transfer the complete file back to the CD (after I had erased the files
of course) since I do not have any software to write just the first
3 CD sectors.

One other aspect is also permitted under RT-11.  Since every
RT-11 directory segment contains the starting block number
in the fifth word, it is possible to have the ISO file that is a
bootable RT-11 image of some device referenced both by
each file AND as a single DSK file starting with a new directory
segment at the end of all the individual files.  In my actual test
example, there were FOUR bootable DSK files under the ISO
file structure (within RT-11 partition zero).  The first 3 RT-11
directory segments (starting in block 6 of the CD) contained
file headers for 206 files.  An additional directory segment was
then added (manually one word at a time with SIPP) which
had an empty area starting at block 100 with sufficient space
for the FOUR bootable DSK files.  CREATE was then used
to set up the file headers one at a time.  Obviously RT-11
is being "fooled", but it does work!

The net result is that it is possible to use the same files under
BOTH the standard ISO file structure AND the RT-11 file
structure.

While all of the above was done on a Pentium system running
Windows 98 SE, Nero Burning, Ersatz-11, PUTR and RT-11,
I am confident that other operating systems and software
utilities would also be successful.  The actual concepts are
really very simple.  Implementation of the test case did take
almost a week since I made a lot of mistakes along the way.
But at this point, I could duplicate a second test in a few hours.

If there are any questions, I will be glad to answer them.

I do have one request.  Does anyone know how or if it might be
possible to write a program that can take the image of the CD
after it is copied to a file on the hard disk and copy all the data
to a second slightly bigger file.  The key requirement would be
that the blocks at multiples of 65536 (where RT-11 partitions
start - actually 64 blocks in each of the 20 possible RT-11
partitions) would be left empty.  I would imagine that a simple
FORTRAN program could do this if the ISO file structure is
known since all that would be required would be to change
those parameters which specify the sector number where the
file starts - AND move the associated file up in the CD image
in the destination file so that 16 sectors starting at multiples of
16384 sectors are left empty.

Sincerely yours,

Jerome Fine
--
If you attempted to send a reply and the original e-mail
address has been discontinued due a high volume of junk
e-mail, then the semi-permanent e-mail address can be
obtained by replacing the four characters preceding the
'at' with the four digits of the current year.

---

From: "Antonio Carlini" <[email-masked]>
Date: Wed Mar 5 06:02:25 2003

> The critical reason that everything works seems to be a 
> rather fortunate use of the mutually exclusive areas by the 
> RT-11 file structure and the standard ISO file structure.  

I'm pretty certain that at least one VMS engineer participated
in the standards process for ISO9660. I've also heard that, as
a result, this ability to have ISO9660 and A.N.Other file 
structure not tread on each other is NOT an accident! Of
course, said engineer was almost certainly thinking of ODS
rather than the RT-11 file structure (does that have a name?).

If you look at http://support.tditx.com/~odsiso/index.html
you'll find a toolset that allows you to do something
similar with ODS-2 and ISO9660 i.e. have 600MB+ of data
accessible in native for both via an ISO9660 directory
structure and via an ODS-2 structure. It works (IIRC) by
building the ISO9660 image using mkfsiso and then analysing
mkfsiso's log file to find where the files are and creating
the mapping info that ODS-2 needs (or it may be the other
way around - it's been a while since I used it).

So you *may* be able to automate (or semi-automate) your
existing process.

It does look like ODS-2 and RT-11 FS cannot co-exist, however,
since they both want to use the 64 blocks at the start of
the image, unless it's possible that the unnecessary fields in
each of those two formats can be persuaded to step out
of each others way. Do you have any details about exactly
what RT-11 requires in that area? Maybe a disk that boots
on PDP-11, VAX (VMS), Alpha (VMS) and PC is possible 
after all :-) 

Antonio
 
-- 

---------------
Antonio Carlini             [email-masked]

---

From: "Jerome H. Fine" <[email-masked]>
Date: Wed Mar 5 06:04:03 2003

>Antonio Carlini wrote:

> rather than the RT-11 file structure (does that have a name?).

Jerome Fine replies:

Since RT-11 and ODS might not have had the same requirements,
then I suppose it might still have been "rather fortunate" that RT-11
needs those same 64 blocks.

As for the name of the "RT-11 file structure", I suppose that is what
everyone else calls it as well.  The overall details are simple for
RT-11
Partition ZERO:
Block 0 - Secondary boot block (the same as will ALL PDP-11 systems)
Block 1 - Directory information
Block 2,3,4,5 - Tertiary boot blocks
Blocks 6 => 67 - 31 Directory Segments (2 blocks per directory segment)

> way around - it's been a while since I used it).

Unfortunately, RT-11 devices are a MAXIMUM of 32 MBytes
or 64536 blocks.  Thus, the same RT-11 file structure MUST
be repeated every 65536 blocks and requires those 64 (actually
68 blocks, although as few as 8 blocks are sufficient since ONLY
ONE directory segment is mandatory for each RT-11 file structure)
blocks at the start of every RT-11 partition which starts at every
multiple of 65536 blocks.  Thus a CD can have about 20 RT-11
partitions - depending on how full the CD is with files.

As I asked, I need to be able to make those 68 blocks available
by some means.

On the other hand, I doubt that it would work very well with a CD
like the RT-11 Freeware CD which has over 21,000 files in over
900 directories.  The only really useful situation would be with
a limited number of (for RT-11) large files, probably each being
on average about 500 blocks which is about 120 files per RT-11
file directory.  Since all RT-11 binary distributions were about
5000 blocks or larger starting with V4.00 in 1980, a CD with
RT-11 distributions would be ideal if there was more than 300 MBytes
of distributions and the standard ISO9660 file structure was used
along with the RT-11 files structure.  In particular, starting with
V5.00
of RT-11 up to V5.07 of RT-11, there were about 17 unique binary
distributions for a total of over 100,000 blocks.  That is only about
50 MBytes, but when the layered products are added along with the
source code, I suspect the total would be more than 300 MBytes,
although less than 600 MBytes that ONE  CD can manage.

> So you *may* be able to automate (or semi-automate) your

What I am looking for is some method of leaving 64 blocks
at the start of every RT-11 partition (every 65536 blocks or
16384 sectors).  Note that in most cases, my choice for an
RT-11 distribution would be an RL02 image which can hold
a maximum of 20450 blocks.  I would then TRUNCATE the
unused blocks (usually all zeros) at the end and thus save
about 14000 blocks for each binary distribution or DSK file
even though the boot blocks would remain for an RL02 in
blocks 0, 2, 3, 4 and 5 of the RT-11 file directory.

With only a small number of RT-11 DSK distribution files,
it would be relatively easy to set up the RT-11 file directory
for each RT-11 partition for the small number of CDs that
might be produced.

> on PDP-11, VAX (VMS), Alpha (VMS) and PC is possible

It seems VERY unlikely.  The first 8 blocks of the RT-11
file structure are very specific.  On the other hand, if you
don't restrict the operating system that the PC is running,
when I used the CD that was produced, I was able to boot
from the CD using RT-11 running under Ersatz-11 running
under Windows 98 SE.  I am also sure that it will be possible
to use the same CD and boot on a real DEC  PDP-11.

As I asked before, does anyone know if the source code
for mkisofs.exe could be modified so that when the files
are set up in the standard ISO9660 file structure, the
first 64 blocks at the start of every RT-11 partition  (every
65536 blocks) can be left empty?  OR, a standalone program
could be written to take a CD image and move the files and
adjust the pointers so that the same result is produced.

Sincerely yours,

Jerome Fine