Tuesday, May 3, 2016

Converting our QIC-extracted files to SimH Tape Format: Minicom Utility

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


A few days ago I found the reason why you are getting "invalid magtape record length, PC: 00377 (JMP 377)".
I succeeded in getting file01.bin to load into simH.
The trick is in the format of the binary file.

SimH requires actual tape image in the bin file. That means each "record" has to have a header and sometimes a trailer, depending on which format tape you use.  The default is SIMH format. But the .bin files you extracted are just the data from the tape, not a tape image with its extra stuff.

In SimH you can change formats using "SET MTA0 FORMAT=<format>" where <format> is one of several options. See SIMH docs.

So I wrote a PHP script that read the file01.bin file, created a SIMH format header and trailer (Little Endian format), and wrote a new file "file01.mta". I think I also had to convert the binary from big endian to little endian in the process.

When I did the attach command "ATT MTA0 file01.mta" and "BOOT MTA" it loaded and bootstrapped itself to higher memory.

Of course it didn't get very far in execution, because file01.bin uses device 42 for the tape drive. SIMH expects device 22. Plus the commands for the tape drive are very different from the standard, so it would not work to simply change the device codes in the .mta file. For that reason alone, it won't make much sense to pursue the collection of files that were numbered file01.bin to file24.bin.

Applying this logic to minicomdiskutility, we should be able to get further by reformatting the tape into SIMH format.

What has stopped me so far from doing this is trying to figure out where the file boundaries are in the utility. That one big file contains multiple tape files or segments, each one loading separately as requested in the menu. Unless I can figure out the boundaries, I can't reformat the tape.

Do you still have the ability to read the physical QIC tape? If so, could it be re-read one file at a time instead of dumping the entire tape into one .bin ?



"MinicomDiskUtility.mta successfully boots in SimH !

I converted the MinicomDiskUtility.bin into a SIMH compatable tape file of a single record 8196 bytes long.

The little endian part for both the record length and data was tricky, but it now works!"

Here is the PHP program that David wrote to accomplish this:

$filename = "f:\\www\\nova\\MinicomDiskUtility.bin";
$outputFile = "f:\\www\\nova\\MinicomDiskUtility.mta";

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

// loop thru file
$eof = pack('V', 65535);

while (true) {
$contents = fread($input, 8192);
if (feof($input)) break;
$data = unpack( 'S*wds', $contents);
$endian = '';
foreach ($data as $word) {
$endian .= pack('v',$word);
$recsize = pack('V', strlen($endian) );
} // end while



Now keep in mind, we have two distinctly separate systems here.

This process works for the Minicom Utility, which is part of what we call "System 2".

Will it work for our "System 1"?  We will try it and let you know...

I should also run a Linux CMP of the files.

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

No comments:

Post a Comment