LisaList2

Advanced search  

News:

2022.06.03 added links to LisaList1 and LisaFAQ to the General Category

Pages: 1 2 [3] 4   Go Down

Author Topic: An Arduino-Based Parallel Port Hard Drive Troubleshooter  (Read 32285 times)

stepleton

  • Sr. Member
  • ****
  • Karma: +127/-0
  • Offline Offline
  • Posts: 425
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #30 on: December 20, 2021, 04:48:07 pm »

Congrats on getting this far! It looks like the Apple parallel port hard drive emulation space is really heating up. I think that ArduinoFile uses the most modest microcontroller, which is pretty cool.

ETA: This is probably nonsense. IDEFile uses an 8031, which is far smaller! Perhaps I mean the most modest of the modern "hobbyist class" of MCUs.
« Last Edit: December 20, 2021, 06:57:41 pm by stepleton »
Logged

AlexTheCat123

  • Sr. Member
  • ****
  • Karma: +68/-1
  • Offline Offline
  • Posts: 228
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #31 on: December 20, 2021, 07:34:23 pm »

Quote
Congrats on getting this far! It looks like the Apple parallel port hard drive emulation space is really heating up.

Thanks! It feels really good to have contributed something to the Lisa community that might be useful to other people!

I would also like to apologize once again for the original name that I gave the ArduinoFile in some of the earlier posts in this thread. I've felt really bad about that over the past couple months and I want to make sure that everyone knows that the original name was a big misjudgement on my part and that I'm really sorry about it.
Logged

stepleton

  • Sr. Member
  • ****
  • Karma: +127/-0
  • Offline Offline
  • Posts: 425
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #32 on: December 21, 2021, 05:29:00 pm »

No sweat, try not to let it bother you too much. I think it's water under the bridge now!
Logged

jamesdenton

  • Administrator
  • Sr. Member
  • *****
  • Karma: +67/-0
  • Offline Offline
  • Posts: 164
  • ArcaneByte
    • ArcaneByte
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #33 on: March 24, 2022, 07:26:53 pm »

Just wanted to give a shout out to Alex here, as I successfully built and tested an ArduinoFile and appreciate the quick assistance he was able to provide with a timing problem. Happy to report that the great Selector, LOS, MacWorks, and UniPlus all are working without issue so far.
Logged

AlexTheCat123

  • Sr. Member
  • ****
  • Karma: +68/-1
  • Offline Offline
  • Posts: 228
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #34 on: March 24, 2022, 10:32:09 pm »

Thanks James! I'm glad you got it working and I was happy to help out! As far as I know, you're the first person (other than me) to actually build an ArduinoFile, which is really cool!
Logged

AlexTheCat123

  • Sr. Member
  • ****
  • Karma: +68/-1
  • Offline Offline
  • Posts: 228
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #35 on: May 07, 2022, 06:39:31 pm »

I just uploaded a new version of the ProFile emulator code to GitHub (https://github.com/alexthecat123/ArduinoFile) with a few changes and bug fixes.

Thanks to James Denton, I was able to fix a timing-related bug that kept the emulator from working on certain people's Lisas that are slower than mine at putting an 0x55 on the parallel bus.

I also fixed a bug where the ready LED sometimes wouldn't come back on after the end of a read or write operation and added enough key-value store functionality to get the Moniker and Autoboot functions in the Selector working. I probably won't ever fully implement the key-value store since these are the only two Selector operations that use it, but I might end up doing it if someone ends up writing an application that actually needs it!
Logged

stepleton

  • Sr. Member
  • ****
  • Karma: +127/-0
  • Offline Offline
  • Posts: 425
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #36 on: May 07, 2022, 08:47:04 pm »

Probably not super necessary to add full key/value store support. I doubt it'll find additional uses anytime soon, but you never know.

One feature I was thinking of adding someday was caching a value for the clock. It's not clear how desirable the feature would be, but the idea goes like this. On startup, the Selector could check the Lisa's idea of the time. If it looked like a sensible value (as if someone had set the clock and then rebooted the machine), then the Selector would save the current time to the key/value store. On the other hand, if the Selector found that the Lisa's clock was clearly unset (as if someone had just plugged in the Lisa and turned it on), then the Selector would load the saved time from the key/value store and set the clock to that.

The time would be incorrect, sure, but these days the Lisa clock is always incorrect. The upside is that the Office System wouldn't have to keep reminding you to set the clock all the time.


Did you implement the "selector restore" functionality? Users encounter it as described here, and the protocol that allows it to work behind the scenes is here. I've found it's helped me out a few times now.
Logged

AlexTheCat123

  • Sr. Member
  • ****
  • Karma: +68/-1
  • Offline Offline
  • Posts: 228
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #37 on: May 08, 2022, 08:21:35 am »

Quote
One feature I was thinking of adding someday was caching a value for the clock.
That sounds like a good idea to me! Even if the time isn't correct, at least the Office System would stop bothering you about it!

Over the past few weeks, I've been thinking about making some sort of daughterboard that lets you connect a battery-backed RTC to the COP421 that will automatically update the clock (excluding the year, of course) to the current time whenever the Lisa is plugged in, but it might be a while before I'll get around to this and your Selector-based solution seems like a really good alternative.

Quote
Did you implement the "selector restore" functionality?
Yep! I think I've implemented every Selector feature by now and "selector restore" has come in handy for me a couple of times as well!
Logged

rayarachelian

  • Administrator
  • Hero Member
  • *****
  • Karma: +105/-0
  • Offline Offline
  • Posts: 772
  • writing the code,writing the code,writing the code
    • LisaEm
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #38 on: May 08, 2022, 12:02:11 pm »

One feature I was thinking of adding someday was caching a value for the clock. It's not clear how desirable the feature would be, but the idea goes like this. On startup, the Selector could check the Lisa's idea of the time....

This triggers another thought: it might be useful to also save the portion of the 1K floppy RAM that maps to PRAM to the SDXC card and load it back in when the selector profile (or other profile) is loaded. This will likely help with MacWorks, perhaps it can be a switchable option for the end user if desired?
Logged
You don't know what it's like, you don't have a clue, if you did you'd find yourselves doing the same thing, too, Writing the code, Writing the code

stepleton

  • Sr. Member
  • ****
  • Karma: +127/-0
  • Offline Offline
  • Posts: 425
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #39 on: May 08, 2022, 12:59:40 pm »

This triggers another thought: it might be useful to also save the portion of the 1K floppy RAM that maps to PRAM to the SDXC card and load it back in when the selector profile (or other profile) is loaded. This will likely help with MacWorks, perhaps it can be a switchable option for the end user if desired?

This sounds like a great idea --- the first step of course is to determine what portion of the RAM that is and how to tell when it's initialised vs. uninitialised.

The Selector configuration data structure's feature bitmap is a 32-bit bitmap, and only two bits are used so far. It'll be easy to enable/disable switchable options like these.

Oh hey, speaking of switchable options, I forgot altogether: the Selector has the ability to display a little 128x32 bitmap logo when it starts up, kinda like the little picture you see with old Sun workstations. I forgot that I put that feature in there, and in fact I never tried it. Here's the code that does it. Who knows, maybe it even works! :)

The plan was (and I guess still is) that besides the Selector (which needs to be fairly small so that it boots up quickly), I'd make an additional set of Selector utilities that you could run from the Selector, including something that lets you edit that little bitmap, which lives in the key/value store.

On that note, @AlexTheCat, the list at the bottom of key_value.x68 is the set of all the key/value store elements that the Selector expects to find right now, as you may well know. It includes the entry that holds the logo image data.
Logged

rayarachelian

  • Administrator
  • Hero Member
  • *****
  • Karma: +105/-0
  • Offline Offline
  • Posts: 772
  • writing the code,writing the code,writing the code
    • LisaEm
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #40 on: May 08, 2022, 02:44:59 pm »

This triggers another thought: it might be useful to also save the portion of the 1K floppy RAM that maps to PRAM to the SDXC card and load it back in when the selector profile (or other profile) is loaded. This will likely help with MacWorks, perhaps it can be a switchable option for the end user if desired?

This sounds like a great idea --- the first step of course is to determine what portion of the RAM that is and how to tell when it's initialised vs. uninitialised.


I vaguely remember seeing it somewhere in the HWG, but it doesn't say what MacWorks uses, so it's fairly safe to save the whole 1K of RAM, but maybe exclude the lower values that include the IOROM version (incase you move the Aphid from one machine to another.)



Edit: this is what I save in LisaEm, but don't recall where I got the values from:
Code: [Select]
    fwrite(&floppy_ram[0x180/2],(0x200-0x180)/2,1,F);
So the floppy_ram block is presented to the Lisa on the low bytes in words only hence the /2 and looks like the range is 0x180-0x200=0x80 (or 128 bytes) and the address range should then be double that. So it's the high 128 bytes that are saved as PRAM.  From the M68000 point of view, this is the range from 0xFCC301-0xFCC3ff (odd bytes only).

Note: Looks like MacWorks II+ uses double that and has a serial EEPROM for this as part of the PFG so it can support System 7 - https://lisafaq.sunder.net/single.html#lisafaq-sw-mw



The other problem is going to be how to save those at shutdown, so would need a MacWorks MacOS extension/app that runs in the background and on shutdown saves those values to the Aphid.


Oh hey, speaking of switchable options, I forgot altogether: the Selector has the ability to display a little 128x32 bitmap logo when it starts up, kinda like the little picture you see with old Sun workstations. I forgot that I put that feature in there, and in fact I never tried it. Here's the code that does it. Who knows, maybe it even works! :)

Neat! I am a fan of the old SPARC v8s.
« Last Edit: May 08, 2022, 03:02:36 pm by rayarachelian »
Logged
You don't know what it's like, you don't have a clue, if you did you'd find yourselves doing the same thing, too, Writing the code, Writing the code

blusnowkitty

  • Sr. Member
  • ****
  • Karma: +75/-0
  • Offline Offline
  • Posts: 255
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #41 on: May 09, 2022, 10:18:08 am »

I don't have an Aphid and I haven't looked at the code, but could you not make the Selector a chainloader? Effectively, give it 3-5 seconds on a splash screen waiting for user input if they want to load into the config menu, then set up the I/O RAM (Beaglebone's a full-blown ARM SBC, no? How hard would it be to use NTP to set the date/time automatically?), and finally load the Profile image the user wants to boot from (either saved in a config file as a default boot option or whatever image the user selected from the menu).
Logged
You haven't lived until you've heard the sound of a Sony 400k drive.

stepleton

  • Sr. Member
  • ****
  • Karma: +127/-0
  • Offline Offline
  • Posts: 425
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #42 on: May 09, 2022, 03:59:33 pm »

I'm not sure I fully understand the proposal, but something very close to what you propose can happen with the Selector's autoboot feature: if enabled, you have three seconds (ish) before it
  • switches the drive image from the Selector's own boot volume to whichever drive image is configured for autoboot
  • then boots from that drive.

The Selector program itself is fairly simple: when it starts up, it loads itself in its entirety into RAM and never touches its boot volume again. The reason for this is because the Selector can change the Aphid's current hard drive image at any time, so suddenly the data on the hard drive image it booted from may no longer be available.

If you wanted to dynamically load bits of the Selector only when you needed them (apologies if this is not what you're proposing!) then you'd want to do that dynamic loading using commands to the Aphid that are different from regular hard drive reads and writes. This is because the Aphid doesn't know whether it's the Selector talking or some other Lisa program or OS, and you probably only want the Selector to load up bits of the Selector (other Lisa software has no use for it and would only be confused by it --- or worse, it might just try to overwrite it or something). The key/value store would be the easiest option for some kind of "out of band" loading, but as Alex has noted, not all implementations of the Aphid key/value store are feature complete :-)

BeagleBone is a line of SBCs, but some are bigger and more feature-packed than others, and the one I've gone for is the smallest of them all: the PocketBeagle. Size is the main feature there; many other conveniences are missing. To talk to an NTP server, you'd need to get a network connection out of it, and there are certainly options for that. There is no built-in ethernet port or WiFi on the board itself, though, so the easiest option is to use the USB cable and tunnel TCP/IP over that (something the board sets up out of the box --- you can SSH into your Cameo/Aphid that way).

But if you don't want to use another computer as a network gateway for your tiny computer, you'll need to do something like adding an ethernet port or a USB host that you can plug a network dongle into. The PocketBeagle's SOC has built-in support for such ports if you attach their connectors to some of the I/O pins, but you'd need to hope that the I/O pins that those features use aren't the same as the I/O pins that the Cameo board uses. Could I change the I/O pins? Yes, but I don't want to --- the 16 that I chose are the ones most directly connected to the SOC's built-in I/O coprocessors. Plus I'd have to respin the Cameo board itself :-)

Other architectures may not have the same constraints that the PocketBeagle does --- maybe ArduinoFile can work differently, or maybe you can use one of those WiFi-enabled ESP32 things for yet another emulator. I saw somewhere that someone had made a ProFile emulator using a Raspberry Pi Pico... yes, here it is. Coming up with your own emulator is a fun project and I suspect Patrick's excellent documentation is a big part of what's made it possible.

Anyway, without a way of getting the time from the outside world, it's more-or-less Groundhog Day for the PocketBeagle: it boots up and the time is whatever time it was when the kernel was built. At least I think that's how it works; there may be a cached time sort of scheme like the mechanism I've proposed for the Selector, but I forget whether that's the case.

Not sure if this is useful information, but there it is!
« Last Edit: May 09, 2022, 04:08:10 pm by stepleton »
Logged

blusnowkitty

  • Sr. Member
  • ****
  • Karma: +75/-0
  • Offline Offline
  • Posts: 255
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #43 on: May 09, 2022, 05:26:57 pm »

Sounds to me like Aphid Selector already does what I was thinking then.
Logged
You haven't lived until you've heard the sound of a Sony 400k drive.

stepleton

  • Sr. Member
  • ****
  • Karma: +127/-0
  • Offline Offline
  • Posts: 425
Re: An Arduino-Based Parallel Port Hard Drive Troubleshooter
« Reply #44 on: May 09, 2022, 05:30:42 pm »

But wait, there's more! You can even set a password on the autoboot feature so that visitors to your computer museum won't monkey with your hard drive images! :D

(They'd have to come to the museum with their own floppy disk with the Selector on it to work around the password.)
Logged
Pages: 1 2 [3] 4   Go Up