Thursday, May 5, 2016

LU0 "Work"

This page is a part of the "Understanding IRIS" collection.  Many thanks to David Takle, for figuring this out, and sharing this with us:

------------------------------------------------------------------

Just wanted to update you on how far I've gotten.

1. I stripped off the utility from the front of a .bin that contained LU0 (can't remember which file that was right now). Creating a file I called LU0x.bin, which was a pure LU0 in SimH DKP format.

2. when I tried to attach LU0x.bin to SimH, it turned out to have the wrong byte order (endian problem).

3. So I converted LU0x.bin to LU0x.dkp (see convert program below) with the correct endian order.

4. I can now attach LU0x.dkp to SimH and BOOT. It reads block zero in, copies it up to 24000 octal, and then hangs trying to read in REX because the disk driver is all wrong.

I've attached LU0x.dkp for your amusement. It's IRIS v. 7.5, based on the PZ and DEFS I've taken from it.

If we can rewrite the disk drivers, we will have a running system!

<?php
//
$filename = "f:\\www\\nova\\LU0x.bin";
$outputFile = "f:\\www\\nova\\LU0x.dkp";

$input = fopen($filename, "rb");
$output = fopen($outputFile, "wb");

// loop thru file
while (true) {
$contents = fread($input, 512);
if (feof($input)) break;
$data = unpack( 'n*', $contents);
$endian = '';
foreach ($data as $word) {
$endian .= pack('v',$word);
}
fwrite($output,$endian);
} // end while
fclose($input);
fclose($output);

?>
----------------------------------------------------------

My next projects are ... (as time permits)

1. to decode enough of REX and CONFIG to see what drivers are already there

2. to either pick one of those or write a new one that is SimH compatible

3. load that driver into the correct REX location

4. use parts of that driver to modify the boot sector to read in REX

5. BOOT !!



Looks like it's going to happen. Just a matter of time and brain cells.



~David

----------------------------------------------------------

More headway today.....

( Honestly, I need to be working .... but this is so much more fun! )

I pulled CONFIG off the LU0 and converted it to an assembler listing so I could browse through it.

Turns out it contains at least a dozen disk drivers, and what looks like their related boot sector drivers.

One of them appears to be a DIABLO 31 written with device 33, using standard DG controller logic !!

This may well be the driver we have been looking for.

Sometime soon I am going to try pulling the driver from CONFIG and writing it into REX, and patch the boot sector as well.

Then we will see if we can BOOT this thing.


~David

----------------------------------------------------------

So, I asked David: When you say "I pulled CONFIG off the LU0 and converted it to an assembler listing".  Where did you find it?  Here is his reply:

The trick is to go through the data according to some predictable patterns.
First, take a look at the DEFS text file. It contains a section called something like "Header Block Displacements".
From there you will see that a file header contains the name of the file, the owner, creation date, etc.

Then at displacement 0177 (leading zero means octal here) the header contains its own disc address, and if it is a random file (non-contiguous) the displacements from 0200 to 0377 contain the block addresses of the file itself. (the exception would be if a file was an "extended" file over 128 blocks long, in which case 0200-0377 contain block numbers of blocks which are filled with the actual file block addresses -- but these are relatively rare).

So now we need to locate the header block for a given file, say "CONFIG".
First, the INDEX header is fixed at block 01, which is at 0400 in LU0. That means that LU0 from 0600 to 0777 contain the block addresses for the INDEX itself (only 0600-0613 are used).

If we take each one and multiply it by 0400, we can read the 0400 words starting at each of those locations as if they were part of INDEX. The format of INDEX data is quite simple, as every 010 words is a "record". Words 000-006 of a record are the text name of the file (which is why they max out at 13 or 14 char) and word 007 is the header block address. If word 000 in a 'record' is equal to 000, then the entry is blank or has been deleted. Scanning thru INDEX blocks will eventually lead you to the record for CONFIG, and therefore the header block of CONFIG.

At that point you can calculate the location of the CONFIG header in LU0 and then find the blocks that make up the file.

~David

I wrote a script to do a complete INDEX listing.
Now you can see what's on the LU0.

All Header block addresses are in octal.

; f:\www\nova\LU0\index-f.bin
     1  INDEX
     2  REX
    20  DMAP
    31  DISCSUBS
     3  ACCOUNTS
  2001  PLOAD
   144  SCOPE
  2010  BYE
  2020  DSP
   161  CONFIG
  2267  IPL
  2227  $MMUX
  2273  UT.MT.BACKDOWN
  2741  LCMDIAG1.1
  2764  TTY
  2765  TERMVT100
  2770  PTP
  2771  PTM
  2230  $DEC
  2776  LPTM
  3002  LPTP
  3003  LPTDIAGDRIVER
  3010  COM.A
  3011  COM.D
  3020  TERMTV912.75
  3021  MTAS
  3025  LCM
   252  ASM
  3026  LPTL.O
  3033  TERMADM2.75
  3036  TERMADM3.75
  3037  TERMB100
  3042  TERMDGC.75
  3043  TERMDM1520.75
  3046  TERMDM1521.75
  3047  TERMH2000
  3052  TERMH1500
  3053  O.DMSTB
  2301  MTCOPY
  3066  TERMINET
  3067  TERMACT5.75
  3072  TERMADDS25.75
  3073  LPTP51
  3076  TERMVT52
  2034  CHANGE
  2041  CLEANUP
  2055  CLEANUPX
  2071  CONVERT
  2100  COPY
  2117  FORMAT
  2123  INSTALL
  2134  KILL
   330  L.LCMDEFS
  2137  LCMACTIVATE
  2143  LCMMODIFY
  2151  MAIL
   143  MESSAGES
  2154  PORT
  2160  PROTECT
  3103  DBUGMK8
  2175  QUERY
  3104  RADOC
  3115  RADSC
  3116  RCDTC
  2205  REHASH
  2211  REMOVE
   162  SAVE
  2214  SHUTDOWN
  2221  VERIFY
   243  LIBR
  2244  $PHA
   263  EDIT
   166  RUNMAT
   201  BASIC
   217  RUN
  1603  A1B2C314
   331  USERID
  3120  TAPEWRITE
   335  R75DEFS
   351  R75PZ
   414  RMDTC.1021
  3126  TERMDIAL80.75
  3127  DISCUTILITY
   421  LCM.PARAMS
  1610  ACCOUNTLIST
  2314  PE
  2315  ALOAD
   425  ERRFILE
  2327  BASICTEST
  2346  BUILDXF
  2347  EXERCISER
  2372  EXTRAPORT
  2142  GUIDE
  2403  GUIDE.LPT
  2424  GUIDE.LU
  3163  TERMADM1.75
  2440  LCMCHECK
  2441  LCMCONFIGURE
  2500  LPTDIAG
  2526  LPTDIAG2
  2546  LPTDIAG3
  2547  LPTDIAG4
  2573  MTUTL
   431  DOC.00101
  2600  SETTIME
  2601  TAPETESTSW
  2611  UTILITY
  3164  MUX300DP.110
  3201  MUX310DP.062
  3202  MTA0
  2631  UT.MT.BKDWN.OL
  3216  RTC
  3217  RTDXCB
  3222  PTR
  2632  GUIDE.BLOCKCPY
  3223  LPTD
  3230  DBUGPT
  2656  CHECKSUM
  1711  LU1
   437  SYMBOLS
  2676  RECEIVE
   456  LPT.DT
   463  DOC.00001
   467  C8
  3231  LPTL.BAD.40123
   275  SWR.DOCDIR
  3241  DDCOPYCT
   473  BT.
  3275  LPT.O
  2677  PM
  1644  LPT
   316  SWR.POINTER
  3300  BOOT
  2250  $TERM.AMP
  2254  $LPT
  3301  HELPS
  2706  OFF
  2707  BACKUP
  2712  PAE
  2713  BB
   320  SWR.KEYWORDS
  2717  IN
  3311  LPTHIGH
  3312  MK8
  2255  $HELPS
  2224  SWRVER
  2721  MENU
  2722  SWAPPROG
  1703  SW
  3324  HELPS.OLD
  3325  TERM.AMP.OLD
  3336  TERMS.OLD
  2266  $TERMS
  3337  TERMTV950.75
  2732  AS.UT06
  2245  $LPTL
  1720  LU2
  3446  HL1
  3477  HL3
  3520  HL2
  3600  N.FILECOPY
  3601  SORTTESTER114
  3617  $LPT2
  3441  $LPT1
  1611  N.SUPERBLD
  3343  SWR.LIBR
  1725  HEX.AMP
  1746  HEX.TERMS
  1761  HEX.HELPS
  3352  TERMS
  2737  TO00
  3353  DGMX


And, here is David's PHP program for extracting this information:

<?php
//
$filename = "f:\\www\\nova\\LU0\\index-f.bin";
$outputFile = "f:\\www\\nova\\LU0\\index-list.txt";
//
$listing = '';
$alpha = '................................'
. ' !"#$%&' . "'" . '()*+,-./0123456789:;<=>?@'
. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`'
. 'abcdefghijklmnopqrstuvwxyz{|}~.';
//
$handle = fopen($filename, "rb");
$finfo = '; ' . $filename;
echo $finfo;
//
// loop thru file
$listing = "\r\n" . $finfo . "\r\n";
while (true) {
$contents = fread($handle, 16);
if (feof($handle)) break;
$data = unpack ( 'n*', $contents );  // 'v*' or 'n*' depending on endian order
if ($data[1] == 0) continue;  // empty record
$char = unpack ( 'C*', $contents );
$name = '';
for ($x=1; $x<=14; $x++) {
$c = $char[$x];
if ($c == 0) break;
$name .= showbyte($c);
}
$rda = decoct($data[8]);
$len = strlen($rda);
$showRDA = substr('      ',0, 6-$len) . $rda;
$listing .= $showRDA . '  ' . $name . "\r\n";
} // end while
fclose($handle);
$fp = fopen($outputFile, "w");
fwrite($fp,$listing);
fclose($fp);


function showbyte($dc) {
global $alpha, $name;
if ($dc >=128) $dc = $dc - 128;
$name .= substr($alpha, $dc, 1);
}

?>

This page is a part of the "Understanding IRIS" collection.  

No comments:

Post a Comment