RK05 Images

304 views
Skip to first unread message

Roger Smith

unread,
Dec 11, 2015, 11:21:33 AM12/11/15
to PiDP-8
Does anyone have any pointers to useful information on the structure of RK05 directories, which blocks do they occupy in the image and what the format of the entries are?

I have a number of RK05 images which look ok in that they are the correct length, but I'd like to look at their directories and the file contents on my desktop before trying to mount them under simh.

Any help appreciated, I'm running linux on the desktop, so Windows or Mac stuff won't be useful.
Roger

Rick Murphy

unread,
Dec 11, 2015, 6:21:26 PM12/11/15
to Roger Smith, PiDP-8
OS/8 File structure is pretty arcane.

From the OS/8 Software Support Manual:
To maintain records of the files on a device, OS/8 allocates blocks  1 through  6  of  each  file  structured  device  as the file directory.
Entries in this directory inform the system of  the  name,  size,  and location  of  each  file,  including all empty files and the tentative file, if one exists.  For a detailed description of the entries in the file directory, see Appendix A.

Note that "blocks" are 256 12-bit words long (512 six-bit bytes long).

Appendix A says:
     Blocks 1 through 6 on all file structured devices are reserved for the
     file  directory  of  that  device.   Six  blocks are always allocated,
     though all are not necessarily active at any given time.  To  minimize
     the  number  of  directory  reads and writes necessary, OS/8 fills one
     directory block completely before overflowing  onto  a  second  block.
     Thus  the user with only a few files can perform directory LOOKUPs and
     ENTERs faster than one with many files.

     The directory blocks are each structured according  to  the  following
     format:
                              ENTRY
                  +--------------------------------+
               0  | MINUS THE NUMBER OF ENTRIES    |
                  | IN THIS SEGMENT                |
                  +--------------------------------+
               1  | THE STARTING BLOCK NUMBER      |
                  | OF THE FIRST FILE IN THIS      |
                  | SEGMENT                        |
                  +--------------------------------+

               2  | LINK TO NEXT SEGMENT-ZERO      |
                  | IF NO NEXT SEGMENT             |
                  +--------------------------------+
               3  | FLAG WORD-POINTS TO LAST WORD  |
                  | OF TENTATIVE FILE ENTRY IN     |
                  | THIS SEGMENT                   |
                  | DIRECTORY SEGMENTS ARE ALWAYS  |
                  | LOADED INTO LOCATIONS 11400    |
                  | TO 117777 BY THE USR; THIS     |
                  | POINTER IS EITHER 0 OR BETWEEN |
                  | 1400 TO 1777.                  |
                  +--------------------------------+
               4  | MINUS THE NUMBER OF            |
                  | ADDITIONAL INFORMATION WORDS.  |
                  | THE NUMBER OF ADDITIONAL       |
                  | INFORMATION WORDS SPECIFIED    |
                  | MUST BE THE SAME IN ALL        |
                  | DIRECTORY SEGMENTS             |
                  +--------------------------------+
               5  | BEGINNING OF FILE ENTRIES      |

                  +--------------------------------+
               .  |                                |
               .  ~                                ~
               .  |                                |
                  +--------------------------------+
               377| END OF DIRECTORY BLOCK         |
               (8)+--------------------------------+


     A.1.1  Directory Entries

     There are three types of file directory entries.  They  are  PERMANENT
     FILE  ENTRY,  EMPTY FILE ENTRY, and TENTATIVE FILE ENTRY.  A permanent
     file entry appears as follows:

           Location       Contents                    Notes
         +-------------------------------+
       0 | FILE NAME      FILE NAME      |\
         | CHARACTER 1    CHARACTER 2    | |
         +-------------------------------+ |
       1 | FILE NAME      FILE NAME      | |
         | CHARACTER 3    CHARACTER 4    | |  THE FILE NAME AND EXTENSION
         +-------------------------------+  > ARE PACKED IN SIXBIT ASCII
       2 | FILE NAME      FILE NAME      | |  (i.e., "A" would be 01)
         | CHARACTER 5    CHARACTER 6    | |
         +-------------------------------+ |
       3 | FILE EXTENSION FILE EXTENSION | |
         | CHARACTER 1    CHARACTER 2    |/
         +-------------------------------+
         |                               |\
         |                               | |  N, THE NUMBER OF ADDITIONAL
         +-------------------------------+ |  INFORMATION WORDS, IS GIVEN
         |      ADDITIONAL               | |  BY WORD 4 OF THE DIRECTORY
         ~      INFORMATION              ~  > HEADER.  WORD 4 OF THE ENTRY
         |      WORDS                    | |  IS EITHER 0 OR THE CREATION
         +-------------------------------+ |  DATE OF THE FILE.
         |                               | |
     N+3 |                               |/
         +-------------------------------+
         |                               |
     N+4 | MINUS FILE LENGTH IN BLOCKS   |
         +-------------------------------+
                                      NOTE
                    If word 3 is zero, the given file has  a
                    null extension.


     An empty file entry appears as follows:

                             Location      Contents
                           +-----------------------------+
                         0 | ENTRY IS ALWAYS 0000        |
                           +-----------------------------+
                         1 | MINUS THE NUMBER OF BLOCKS  |
                           | IN THIS EMPTY FILE          |
                           +-----------------------------+
     A.1.3  Sample Directory

     The initial directory written when the OS/8 system is built  looks  as
     follows:

                                      A-3

                              OS/8 FILE STRUCTURES


        Location       Contents                    Notes
                     +----------+
                / 0  |   7776   |       TWO ENTRIES
                | 1  |   0070   |       FILE STORAGE STARTS AT BLOCK 70(8)*
        HEADER <  2  |   0000   |       NO ADDITIONAL DIRECTORY SEGMENTS
                | 3  |   0000   |       NO TENTATIVE FILES.
                \ 4  |   7777   |       ONE ADDITIONAL INFORMATION WORD
                     +----------+
               /  5  |   0102   |  \
               |  6  |   2314   |   >  FILE NAME IS "ABSLDR"
     PERMANENT /  7  |   0422   |  /
         FILE  \ 10  |   2326   |       FILE EXTENSION IS SV
        ENTRY  | 11  |   5370   |       DATE IS 10/31/70
               \ 12  |   7773   |       LENGTH IS FIVE BLOCKS
                     +----------+
        EMPTY  / 13  |   0000   |       EMPTY FILE
         FILE <      |          |
        ENTRY  \ 14  |   6534   |       LENGTH IS 1244(8) (676(10))BLOCKS -
                     +----------+       THIS IS DEPENDENT ON THE SYSTEM
                     |          |       DEVICE USED.  676 IS THE VALUE
                     ~          ~       FOR A DECTAPE SYSTEM
                     |          |
              377(8) +----------+
                                 *This leaves room for the OS/8 System
                                 Areas

--
You received this message because you are subscribed to the Google Groups "PiDP-8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-8+un...@googlegroups.com.
To post to this group, send email to pid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-8/aefd5664-9e4b-4e53-954a-b857c8b512b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Rick Murphy, CISSP-ISSAP, K1MU/4, Annandale VA USA

Roger Smith

unread,
Dec 12, 2015, 6:31:02 AM12/12/15
to PiDP-8
Many thanks to all who helped, I now have enough information to proceed to the next step.
For the terminally curious, what I am trying to do is to work on downloaded RK05 images on my desktop, before trying them out on the Pi. This way I can do basic sanity checks, like :-

Is this in fact an RK05 image?
Are all blocks accounted for - either in a file or in free space?
What are the directory entries - to build up a list of files and lengths (and later hashes to check against a known good list of versions)
And stuff like that. Eventually I'd like to be able to pull a file straight out of the RK05 image and run it through a disassembler to see what it really does.

On a good image you could do most if not all of this, but on my desktop I can do it faster and more thoroughly and don't get stopped by errors.
May or may not work in the end, but it keeps me out of trouble.
Roger

Steve Tockey

unread,
Dec 13, 2015, 6:38:44 PM12/13/15
to PiDP-8

Roger,
A bit of additional info, in case it might be useful. First, yes, blocks 1-6 are directory blocks. As well, keep in mind that files are stored contiguously on the disk. Another tidbit is that block 0 is the boot block on system disks. The boot block will probably be useless gibberish on a non-system disk, but bootable disks need block 0. The OS/8 run time image also sits in reserved blocks on a bootable system disk. If memory serves, it occupies something like blocks 10-77 but don't quote me on that. Just know that some number of blocks on a system disk are allocated to OS/8 system stuff.

An RK05 disk has two "sides" (it's really inner and outer cylinders but it's easy to think of it as being on sides) in OS/8. One side will be known as RKAx: and the other side will be known as RKBx:. An empty RK05 "side" that's not a system disk should have 3192 free blocks on it.

When/if you can access the disks in OS/8, the program FUTIL (File UTILity) is a great tool for poking around the disk image itself. Documentation is available online at: http://www.pdp8.net/os/os8/futil.shtml. I've recovered many an accidentally-deleted file with FUTIL. Just be really, really careful with it because you can also corrupt a directory pretty easily with it if you don't keep an eye on what you're doing.


-- steve

Roger Smith

unread,
Dec 15, 2015, 7:57:29 AM12/15/15
to PiDP-8
Yes. I've been tentatively exploring with futil, basically I make a copy of the image under inspection and mount that as a scratch monkey, then when I make a mistake and it all goes pear shaped and runny I can go back, take a fresh copy and make a different mistake this time.
So far I've had OS/8, TSS/8 and ETOS up and running just to check that most of the bits are there, had a little play with Fortran, Algol and Lisp, oh the joys of retrocomputing, more "Forward to the Past" than "Back to the Future", but still you have to admire the fact that they could get a compiler into 4k or 8k.
Roger
Reply all
Reply to author
Forward
0 new messages