Post Reply 
HP-41CY re-initialization ROM
10-27-2019, 05:23 AM
Post: #1
HP-41CY re-initialization ROM
I've written a module to re-initialize a corrupted HP-41CY. It seems to work fine in all situations I've tested. However, there is a problem: there is a part that I do not fully understand.

First, let me recap my approach and considerations (where RB2INI is my initialization module):
  • Create a CLONIX module with RB2INI in page 8 (to mask a potentially corrupted RAMBOX2 OS) and OS/A in page E and OS/B in page F.
  • Use the I/O service polling vector in RB2INI to take over control and run the initialization process.
  • The bank switching op-codes (ENROM1/2/3) only work if the currently executed code is in the RAMBOX2 RAM.

My understanding of the bank switching instructions in RAMBOX2:
  • ENROM1: Reset all pages to bank #1
  • ENROM2: Enable odd pages of bank #2
  • ENROM3: Enable even pages of bank #2

Re-initialization is straight-forward if we assume that the active RAMBOX2 bank is #1:
  • Copy RB2INI to page A (in RAM).
  • Transfer control to RB2INI in page A.
  • Clear pages 9 and B to F.
  • Copy OS/A from page E to 8.
  • Enable odd pages of bank #2.
  • Copy RB2INI to page 9 (in bank #2).
  • Transfer control to RB2INI in page 9.
  • Enable even pages of bank #2.
  • Clear pages A to F.
  • Copy OS/B from page F to 8.
  • Power off.

However, if bank #2 is active I don't see a controlled way to initialize bank #1 because we would need to use the ENROM1 instruction to initialize a page in bank #1 but these pages are all potentially corrupted. Therefore, after ENROM1, we would execute some garbage instructions!

Because I had no other idea (even after many experiments) I tried to force a switch to bank #1 anyway. Suprisingly, it kind of works. When I run the initialization process on a HP-41CY with active bank #2, the process is somehow restarted after the ENROM1 instruction (i.e., the I/O service interrupt gets called again). Maybe the garbage in bank #1 was not bad enough, although I tried hard to create nasty situations. Only once I run into a problem where the calculator hanged. But even then, after turning it off and on again, RB2INI ran again and completed successfully.

The source code of RB2INI is available online. I think what I have right now is good enough for my needs. Anyway, I don't like if I do not fully understand the details. So any comments are highly appreciated.

Maybe the RAMBOX2 MMU can be controlled somehow and there is another possibility to activate bank #1? Or maybe there is another instruction than WROM to write to the whole RAMBOX2 RAM? I don't know ...
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP-41CY re-initialization ROM - Jurgen Keller - 10-27-2019 05:23 AM
RE: HP-41CY re-initialization ROM - PeterP - 11-03-2019, 06:19 PM
RE: HP-41CY re-initialization ROM - PeterP - 11-04-2019, 03:48 PM
RE: HP-41CY re-initialization ROM - PeterP - 11-06-2019, 03:36 PM
RE: HP-41CY re-initialization ROM - CY-CL - 10-27-2019, 04:16 PM
RE: HP-41CY re-initialization ROM - hth - 11-03-2019, 05:59 PM
RE: HP-41CY re-initialization ROM - hth - 11-03-2019, 08:32 PM
RE: HP-41CY re-initialization ROM - PeterP - 11-06-2019, 03:39 PM
RE: HP-41CY re-initialization ROM - hth - 11-06-2019, 07:45 PM
RE: HP-41CY re-initialization ROM - PeterP - 11-06-2019, 07:45 PM
RE: HP-41CY re-initialization ROM - PeterP - 11-09-2019, 08:21 PM
RE: HP-41CY re-initialization ROM - PeterP - 11-09-2019, 08:19 PM
RE: HP-41CY re-initialization ROM - CY-CL - 12-27-2019, 07:32 PM



User(s) browsing this thread: 1 Guest(s)