LisaList2

Advanced search  

News:

2022.06.03 added links to LisaList1 and LisaFAQ to the General Category

Pages: [1]   Go Down

Author Topic: Sun20 Formatting Issues  (Read 10943 times)

AlexTheCat123

  • Sr. Member
  • ****
  • Karma: +68/-1
  • Offline Offline
  • Posts: 228
Sun20 Formatting Issues
« on: July 01, 2023, 03:04:26 pm »

I just got my hands on a Sun20 drive (firmware revision F) and it was working just fine, but I was curious about the drive's LLF-ing serial interface, so I tried formatting it in an attempt to document the LLF process.

Interestingly enough, according to the source code, the firmware will only jump to this diagnostic interface program if it detects an error when starting up, so I just unplugged the MFM data cable to make it give an error and then plugged it back in after getting into the diagnostic mode. After I got connected to to the drive over serial, I ran the F and F! commands to format the data tracks and the system track, respectively, but now I think I might've killed the drive by doing this. Whenever I power cycle the drive, I get an "Error reading system track" message over the serial port and it refuses to accept any commands from a Lisa. After looking through the source code a bit, it seems like this "system track" is the drive's spare table, so it's definitely important!

After looking through the source code some more, I noticed that many of the diagnostic routines seem to be unfinished (or just missing altogether) and that the more involved looking format routine that asks for the number of cylinders, heads, sectors, and a few other things (the F and F! commands don't ask for any of this stuff) never gets called at all because there's a JB instruction that just jumps over it if the drive encounters an error (which will always be the case when entering diag mode).

So I patched the ROM by replacing that JB with a few NOPs just to see if that formatting routine would work. Now it gave me a "No drives online..." error (which seems to be a lie because it can clearly talk to the drive in future steps) instead of the "Error reading system track" message, but sure enough, it let me enter all of the drive's parameters and then basically did the same things that the F and F! commands did (as well as verifying the data track format, which the F command doesn't seem to do).

All of those steps in the formatter seem to work just fine, but then it says "Error in writing system track" when it moves onto the step that actually tries to write a ProFile spare table into the system track. And I'm still stuck with the same "Error reading system track" message when I power cycle the drive with that JB instruction added back in. I'm not knowledgeable enough to try and troubleshoot/fix the formatting routines in the ROM, so does anyone have any insight into formatting these things? Am I just stuck with a dead drive or is there some way to recover from this? I'm going to feel so bad if I killed it as a result of my little experiment!
« Last Edit: July 01, 2023, 03:08:01 pm by AlexTheCat123 »
Logged

compu_85

  • Sr. Member
  • ****
  • Karma: +68/-0
  • Offline Offline
  • Posts: 250
Re: Sun20 Formatting Issues
« Reply #1 on: July 01, 2023, 03:39:03 pm »

If someone else has a working SUN drive and access to an MFM Emulator, the disk could at least be read in so the control tracks could be understood.

Looking on Bitsavers, seems like there are at least 2 revisions of the Sun MFM board.

I see there's a rezero system track command, RZ!. Perhaps start there? Does the burn in test do anything?

-J
Logged

blusnowkitty

  • Sr. Member
  • ****
  • Karma: +75/-0
  • Offline Offline
  • Posts: 255
Re: Sun20 Formatting Issues
« Reply #2 on: July 01, 2023, 04:14:43 pm »

A lot of the Sun20 disks I've seen on eBay listings have used the Kalok KL-230 drive, which according to history was one of the worst, most bottom of the barrel drives you could get back in the day. Is yours a Kalok? It may not have been your fault, the drives are just that unreliable.
Logged
You haven't lived until you've heard the sound of a Sony 400k drive.

sigma7

  • Administrator
  • Sr. Member
  • *****
  • Karma: +150/-1
  • Offline Offline
  • Posts: 398
  • Warning: Memory errors found. Verify comments.
Re: Sun20 Formatting Issues
« Reply #3 on: July 01, 2023, 04:41:31 pm »

If you haven't already reviewed this thread, have a look:

Sun20 Questions/Revival

In particular, note the "subtract 2" quirk.
Logged
Warning: Memory errors found. ECC non-functional. Verify comments if accuracy is important to you.

AlexTheCat123

  • Sr. Member
  • ****
  • Karma: +68/-1
  • Offline Offline
  • Posts: 228
Re: Sun20 Formatting Issues
« Reply #4 on: July 01, 2023, 05:03:22 pm »

Quote
Looking on Bitsavers, seems like there are at least 2 revisions of the Sun MFM board.

I've got the older??? revision that has the three OMTI PLCC chips instead of just one.

Quote
I see there's a rezero system track command, RZ!. Perhaps start there? Does the burn in test do anything?

The RZ! command works fine, but the formatter seems to automatically recal to the system track before formatting, so unfortunately that command doesn't really help with getting it to format.

And the burn-in test starts off okay, but it gets stuck on step 5 (reading the data tracks). Looking at the source code, it seems to just get stuck in an infinite loop on this step. And power-cycling the drive after getting through those first few steps of the burn-in test still yields the same error. Also, that burn-in test never asks for cylinders, heads, sectors, or anything else, so it just seems like it just runs the regular F and F! commands instead of that special formatter.

Quote
A lot of the Sun20 disks I've seen on eBay listings have used the Kalok KL-230 drive, which according to history was one of the worst, most bottom of the barrel drives you could get back in the day. Is yours a Kalok?

Luckily, my drive is a Kyocera KC-20B, so I don't think the drive itself is at fault here. It seems like it's just the formatting that's screwed up.

Quote
If you haven't already reviewed this thread, have a look:

Sun20 Questions/Revival

In particular, note the "subtract 2" quirk.

I already took a look at that thread and unfortunately, none of those suggestions seemed to help. And, despite what that thread says, it seems like you have to enter numbers in decimal instead of hex. It just gives the "oooh,oooh" error and makes you start over if you enter any digit that's not 0-9. I tried both capital and lowercase letters, but neither worked.

Does the Helmut Post guy from that thread who was working on the LLF procedure have a different revision of the ROM by chance? He seemed to be able to get things to work (and he could presumably get into the formatter without having to get rid of that JB instruction), so maybe the ROM revision matters? I've tried both D and F and they both fail the same way. I also tried revision C, but it doesn't do anything at all, so I'm guessing that it's only intended for use with the other revision of the control board.
Logged

sigma7

  • Administrator
  • Sr. Member
  • *****
  • Karma: +150/-1
  • Offline Offline
  • Posts: 398
  • Warning: Memory errors found. Verify comments.
Re: Sun20 Formatting Issues
« Reply #5 on: July 01, 2023, 05:52:42 pm »

Found this email of 11/10/2005 from Larry Parks (now deceased)

>Hi James,
>     I think I have located the problem. The problem is in the
>Proms source code that has something to do with the Sectors
>entry.  By varying the numbers below to see what would give
>me "Hard Disk Install Complete... Ready for MacWorks" or
>" > 30 defects"....   In all cases I had to enter Hex 12 for Sector
>to get anywhere.  Per your information this entry should be
>Hex 10  for 17 sectors ( 0 to 16 ) only.
>
>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>&Lisa Diagnostic Utility Routines Rev. F
>No drives online.....
>Last cylinder number                0266 to 0268   (614 to 616 cyc)
>Number of heads                        4  or  5 only      (4 or 5 heads)
>Number of sectors                       0012  only        (18 sectors )
>Precompensation cylinder      0080 to 0128       (128 to 296)
>Lun status byte                             0000  only                ( 0 )
>Flag byte                                       0000  only                ( 0 )
>Interleave number                         1 to 3 only             (1 to 3)
>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Larry was very knowledgable about some things (had been a telephone engineer or something like that), but it was difficult communicating with him so the details above may not be as they seem.

We went back and forth about the hex vs decimal vs octal input question and the answer never became clear, so you may need to review the code AND experiment with different styles of input for different parameters if your version is different.

I was told personally about the "subtract 2" thing by Richard (sorry if I've got his name wrong... who seemed second only to Bob at Sun Remarketing), but I've never had a Sun20 so no personal experience with it.
« Last Edit: July 01, 2023, 06:42:47 pm by sigma7 »
Logged
Warning: Memory errors found. ECC non-functional. Verify comments if accuracy is important to you.

sigma7

  • Administrator
  • Sr. Member
  • *****
  • Karma: +150/-1
  • Offline Offline
  • Posts: 398
  • Warning: Memory errors found. Verify comments.
Re: Sun20 Formatting Issues
« Reply #6 on: July 01, 2023, 06:50:58 pm »

Larry noted that the power supply traces on the Sun Remarketing MFM controller board were inadequate, so had beefed them up (presumably by adding jumper wires at strategic locations in the power nets).

It was rumoured that some (maybe all) SR boards were assembled as piece work by staff in their spare time, with varying levels of success. Re-soldering questionable joints may help in some cases.
Logged
Warning: Memory errors found. ECC non-functional. Verify comments if accuracy is important to you.

AlexTheCat123

  • Sr. Member
  • ****
  • Karma: +68/-1
  • Offline Offline
  • Posts: 228
Re: Sun20 Formatting Issues
« Reply #7 on: July 02, 2023, 12:20:29 pm »

That's really interesting! The stuff that Larry says there contradicts what I've found through testing.

After looking through the code some more, it's pretty clear that everything needs to be entered in decimal. And for further proof of this, I entered the number of cylinders as both 266 (hex) and 614 (decimal) and the hex number caused the heads to only sweep over roughly 1/3 of the disk (which would make sense if it expected a decimal number), while the decimal number made it sweep over the entire surface of the disk as it formatted.

Also, it's interesting that he has to enter 4 or 5 heads and 18 sectors to get things to work. My drive will give the "greater than 30 defects" error message if I use a number of heads greater than 3 or a number of sectors greater than 16. My drive (and presumably his drive) has four heads (0-3) and seventeen sectors per track (0-16), so entering 3 and 16 makes sense to me. But I have no idea how he was able to get it to work with his numbers.

It looks like we're both using revision F, so these discrepancies are a bit weird! I wonder what's going on here? Also, was he able to get into the formatter without removing that JB instruction? If so, then something's definitely not making sense here! From what I've seen in the code (and confirmed through testing), it will only enter diag mode if an error flag is set, so therefore that jump (which jumps if the error flag is set) will always be taken after entering diag mode and thus you should never be able to get access to the formatter without removing it.
Logged

sigma7

  • Administrator
  • Sr. Member
  • *****
  • Karma: +150/-1
  • Offline Offline
  • Posts: 398
  • Warning: Memory errors found. Verify comments.
Re: Sun20 Formatting Issues
« Reply #8 on: July 02, 2023, 05:24:10 pm »

Perhaps Larry had a different type of drive and/or perhaps the error flag wasn't set, so the JB instruction wasn't a problem?

FWIW, IIRC, Richard said that one must use the F! command.

It is also quite possible that it didn't work with those numbers; for whatever reason, some of my communications with him were contradictory or unexplainable as if translated incorrectly.

He reported some kind of issue due to his terminal program configured at first to send <CR><LF> instead of only <CR>. It read as though making the adjustment to send <CR> only was key to getting further, but again it wasn't clear... I would have thought it would work or not, but maybe the <LF> doesn't interfere with some parameters and does others.
Logged
Warning: Memory errors found. ECC non-functional. Verify comments if accuracy is important to you.

AlexTheCat123

  • Sr. Member
  • ****
  • Karma: +68/-1
  • Offline Offline
  • Posts: 228
Re: Sun20 Formatting Issues
« Reply #9 on: July 02, 2023, 06:47:56 pm »

Maybe Larry did have another type of drive, but from what I understand, the error flag had to have been set for him too. The controller will only enter diagnostic mode (meaning it will accept commands over serial) if it detects an error (indicated by that error flag) with the drive during initialization, so it seems as if the flag would always be set and therefore the jump would always be taken when diag mode starts up. But maybe I'm just interpreting something wrong.

I've tried both F and F! and neither seems to work for me. F is supposed to format the data tracks and F! is supposed to format the system track (aka the spare table), but I'm not sure how they're able to do that given that they never ask for any of your drive's parameters.

I was having weird issues thanks to my terminal software sending CR LF too, but luckily I figured that out really early in the process and switched it to only send CR. But sadly, that had no effect on my other problems.
Logged

AlexTheCat123

  • Sr. Member
  • ****
  • Karma: +68/-1
  • Offline Offline
  • Posts: 228
Re: Sun20 Formatting Issues
« Reply #10 on: July 13, 2023, 10:51:58 am »

Well, I finally figured it out! It took a lot of work to get everything working, so I'll share the entire formatting process and common issues that might show up while trying to format a drive. And I was also able to get my hands on the 1 PLCC chip version of the controller, so I was able to experiment with that one too!

Connect the 3-pin header on the front of the drive to a USB to serial adapter (or to your Lisa's serial port if you want to have some fun with LisaTerminal!) so that you can access the drive's diagnostic interface. From left to right, the three pins on the header are GND, TX, and RX. Note that, contrary to information that I read somewhere else, the serial interface does NOT use TTL logic levels, so it's completely safe to hook it up to a USB to RS-232 serial adapter. Set your terminal software for 2400 baud and CR line endings.

Now burn one of the attached patched ROMs to a 27128 EPROM and install that in place of your controller's original ROM. Use the revision C ROM if you have the controller with one PLCC chip and the revision D ROM if you have the controller with three PLCCs. The ROMs have been patched to enter the formatter every time the diagnostic interface loads (the original ROM will skip over the formatter if an error flag is set, but this error flag is always set when we enter diagnostic mode, so the formatter never runs) and also prints out the welcome message without waiting on the user to send a CR first.

The drive will only enter diagnostic mode and print something out over serial if it's unable to read the system track from the disk. So a working (or semi-working) drive might never enter diag mode without some help. If you aren't getting the welcome message in your terminal software, try unplugging the MFM data cable to make the controller fail to access the drive. Of course, plug this cable back in once the diagnostic interface loads.

It can take up to 20 seconds from power-on for the diagnostic interface to print the welcome message (or even longer if the disk is completely dead), so be patient!

The formatter should now ask you for your drive's parameters. The following snippet shows the interface and the values that should be entered at all of the prompts.

Code: [Select]
Lisa Diagnostic Utility Routines Rev. D
No drives online.....
Enter Last cylinder number -2 613
Enter Number of heads -1 3
Enter Number of sectors -1 16
Enter Precompensation cylinder -1 299
Enter Lun status byte 0
Enter Flag byte 0
Enter Interleave Factor 2

Initializing the system track
Formatting unit....
Drive rezeroing..
Enter Defect list .. Null input to exit

Head

Is the above input(s) ok ? (yes/no) Y


Drive rezeroing..
Verifying data tracks.. Please be patient
Drive rezeroing..
Drive rezeroing.. (this second rezeroing message only appears on the three-chip controller)
Initializing the lisa system track
Hard disk install complete.. Ready for MacWorks
RESTARTING SYSTEM !!!!

Note that the "Enter defect list" code is broken and won't let you enter defects, so just send a CR when it asks you to enter defects and confirm that the empty list is correct by pressing Y.

If your drive has been previously formatted by some other system (like a PC) or the Sun20 format is just super corrupted, the formatter will probably fail at the very first step with an "Error in initializing the system track" message. If this happens, you'll be dumped straight into an "&" prompt where you can enter commands. Enter the commands "RZ!", "F!", "RZ", and "F" in that order (all of these are really quick except for the F command, which takes a couple of minutes) and then send a ctrl+R to reboot the controller once they've executed. Now the formatter should come up again and you should be able to proceed through the format successfully.

The drive's stepper motor will make a ticking sound during the "Formatting unit..." and "Verifying data tracks.. Please be patient" steps. If the ticking during data track verification is a lot slower than the ticking during the formatting step, it probably means that your disk is bad.

After the formatter says that the drive is ready for MacWorks and reboots the controller, the drive should be ready for use. Since the format presumably succeeded, you shouldn't get anything over serial anymore whenever you power up the controller. And it's fine to switch back to the original ROMs now that the disk has been formatted!

The formatting procedure is identical for both the 1-chip and 3-chip versions of the controller and a drive formatted on one controller seems to be transferrable to the other, at least in terms of the low-level formatting itself. The actual user data that's stored on the disk will be garbage if you move the drive from one controller to the other, but you can just overwrite it with new data if you want. Note that the spare table will be corrupted too and there's no way to rewrite the spare table without formatting the drive with the controller that it's actually going to be used with, so swapping formatted drives between controllers should probably only be used as a diagnostic aid.

And as we would expect, the controller will work with pretty much any 20MB MFM drive. I've tried it with every 20MB drive that I have and they all worked perfectly!

I hope this is helpful to others who are trying to get their Sun drives up and running!
Logged

patrick

  • Sr. Member
  • ****
  • Karma: +88/-0
  • Offline Offline
  • Posts: 106
    • Patrick's Hardware Page
Re: Sun20 Formatting Issues
« Reply #11 on: July 13, 2023, 02:29:47 pm »

And as we would expect, the controller will work with pretty much any 20MB MFM drive. I've tried it with every 20MB drive that I have and they all worked perfectly!

You can use any drive with at least 20 MB. Just reduce the real number of heads and cylinders so that it gives 20 MB. The remaining space on the drive will be ignored.
Logged
Pages: [1]   Go Up