i41CXp and HEPAX, almost there...



#35

Thanks to Meindert (and Eric and Antonio of course) HEPAX is now available for i41CXp.

Screen shot of HEPROOM:

The next step is getting HEPAX RAM and hopefully a way to get contents in and out of RAM.

Eric, Antonio, any chance of this?

Thanks.


#36

Just to clarify: I have created a .MOD file which forces HEPAX to sit at an odd page instead of the standard even page. This prevents HEPAX from executing its own page relocation instructions (which are not supported in i41CX) and HEPAX just runs. RAM support is not possible (WROM is not supported), so any of the functions that use HEPAX RAM cannot be used (which is most of HEPAX unfortunately).
I will post the modified MOD files on my website later in the upcoming weekend.
Anyone who want to try to modify the MOD files themselves, my M2kM (manager for MLDL2000) has tools for editing the parameters in a MOD file, even if you do not have an MLDL2000: see here .

Why HEPAX runs this way was explained earlier in the forum here and here

Meindert

#37

Adding HEPAX support to Nonpareil is on my (long) to-do list. Once I get that working, it should be easy to add it to i41CX+ as well.


#38

I've now got much of the HEPAX support code written. So far it successfully moves its ROM to page 5 on a 41C or 41CV, 6 on a 41CX, or 7 on a 41CX with an 82143A printer. I think it's not initializing its filesystem properly, though. HEPROOM returns 0, and HEPDIR seems to show a file with the name "_". The XROM numbers for the two RAM pages are getting intialized to 11 and 12 (0b and 0c hex).

Any experts on how the HEPAX initialization works?


#39

this is fantastic news Eric, very exciting.

I would probably contact Diego as he has had to dive hip deep into the HEPAX code for his excellent NoVram piece. And he is always very helpful , even to N00bs like myself!
Very excited by the possibility to have hepax on the iPhone... Long live the 41.
Cheers

Peter

#40

Eric,

Even with only the WROM instruction HEPAX can work. The trick is to use an odd page for HEPAX itself, and to use initialized RAM blocks.
If the RAM blocks are not initialized, you must have implemented the WPTOG instruction, since HEPAX used this to recognize its own RAM pages.
If you want, I can prepare MOD files with initialzed RAM, just send me an email and I will respond to that.

That HEPROOM works means that you are getting very close ...

Meindert


#41

Hi all,

Sorry for joining this thread a little late...

Though I'm not a real *expert* in HEPAX (JFG surely is) I've got a fair understanding of its initialization process, and was lucky enough to be the first one in getting HEPAX run into MLDL2000 by Nov. 22nd 2005, with the invaluable support and contributions of Meindert and Luiz.

There are two approaches to make HEPAX run:

a) you make a replication of its internal behaviour. Which means the "module"(physical or not) must have a certain degree of "inteligence" in the sense that it must be able to execute some functions by itself. That's the way NoVRAM's modules work. Or,

b) you do all the clerycal work and let HEPAX rests quietly into any odd numbered page.

Whichever you take, instruction H'040 (known as WROM or WRIT s$x) *must* be implemented.

The *real* HEPAX does the following steps during initialization (every time HP-41 is turned ON):

1- Allocates its code into the even page (four banks) of the port it is plugged in, temporarily disabling its first RAM page.

2- Checks for ROM and RAM pages already installed into the HP-41.

3- If it finds a suitable free page, then executes instruction H'030 and re-allocates itself into that free page. In case that no suitable free page is found then shows the message [ILL CONFIG ] and stops.

4- Once auto-reallocated the first RAM page (removed in the first step) is recovered.

5- One by one every RAM page is checked to confirm that: a) the page is RAM (it can be written thru H'040 instruction) and b) it is available to the HEPAX SYSTEM (no ROM image has been loaded into that page)

6- The chain of RAM pages detected and available for FILE SYSTEM is checked to see if they've already been "marked" as HEPAX RAM with the following contents (this "marking" does *NOT* build the FILE SYSTEM). If they're already marked, then nothing else is done at this point and the control is returned to HP-41 mainframe. If RAM is empty then HEPAX writes the following contents into free RAM pages (assumed HEPAX in port 1, pages #8 - #B are free RAM, and no other ROM's are installed*):

8000: 00B (fake XROM #) 9000: 00C; A000: 00D; B000: 00E

X= Page number (Same contents in all four pages)

XFE9: 091

XFED: 090

XFEF: 091

XFF1: 0E5

XFF2: 00F

XFF3: 100

7- Then the control is returned to HP-41 mainframe, and the start-up procedure is finished. Note that the FILE SYSTEM is not yet initialized though!

In this situation you will see [X:HEPAX RAM ] for "X" pages=8 - B when you execute HEPAX 002.

The File Sytem chain will actually be created as soon as you issue any command requiring of it: HEPDIR, HEPROOM, etc...

When this happens some more info is recorded into RAM, here you are the details:

8FE7: 000 (pointer to previous page in the chain, 000 means 1st page)

8FE8: 009 (pointer to next page in the chain)

9FE7: 008

9FE8: 00A

AFE7: 009

AFE8: 00B

BFE7: 00A

BFE8: 000 (last page in the chain)

The contents at XFF3 is also changed from 100 to 200 and some words at X092 and following addresses are written with info relative to the internal File System structure.

If you plan to go the b) approach, you "only" need to do up to point 6 above. The actual File System will be created later.

Also take into account that:

- HEPAX will need a separate Bankswitching scheme in case other Bankswitched modules are present (this only affects when running HEXEDIT into another Bankswitched module page)

- You'll need to find a suitable way to implement RAMTOG (H'1F0)

That's all folks!

Hope this helps.

Best wishes from Spain.

Diego.

* If another ROM Pac with XROM # B is already installed, HEPAX will start fake XROM # sequence with C... and so on.


Edited: 11 Oct 2008, 11:07 a.m. after one or more responses were posted


#42

As usual, Diego is very informative. Looking forward to meet you Diego, hope you make it to Allschwil!

Can you confirm if HEPAX uses the WPTOG instruction to check if RAM is really HEPAX RAM and not just any MLDL RAM?

Meindert


#43

Hi Meindert,

I'm also pleased to have the opportunity of joining the meeting and share a good time with all the attendants.

Regarding RAMTOG (I suppose you refer to this command as WPTOG), I'm affraid I can not be of much help. As you know I don't have the real HEPAX, so I can only make a guess:

As there is no way by which HEPAX can know of the status (protected or not) of any RAM page of any other (external) RAM Box; the more likely if that HEPAX code does not care to manage with this.

In my NoV's implementation it only takes care of its internal RAM.

A real HEPAX owner, with any other RAM Box, willing to make some test will be very helpful here!!.

However, even if HEPAX doesn't care of other RAM Box page protection status, this does not means that RAMTOG is used to determine if any given RAM page is internal or external to HEPAX module.

A user with an HEPAX RAM module will also be very helpful here... any volunteers?

Sorry not beeing more specific.

Diego.


#44

Diego - see my email to you...

I'm not sure if I have any time before the meeting in Allschwill, but at the very least I could bring a HEPAX and RAMBOX. On second thought - we at the location on this planet with the highest concentration of HEPAX modules, RAMBOXES, HP41's and any related material, so we should be able to try a thing or to there, assuming our generous host (Thanks Matthias for organizing the meeting, this is awesome!!!) might be willing to lend your and Meinderts capable hands a few of his precious gadgets for an hour or two.

One thing you could try Diego, is to see if the HEPAX from your NoV32 would be willing to write to the 512 word RAM in a CLONIX. Or You could try to load a generic MLDL ram page into the NoV and see if the HEPAX in there would be willing to write to it. (I think both MEindert as well as V41 and emu offer 'generic MLDL' ram .mod images...)

Cheers

Peter


#45

Hi Peter

My HEPAX emulation is rather selfish...:-) It does not allow writting into its RAM from external code... and, as far as I can remember, I also built Clonix6P RAM (512 words) with the same criteria. I don't know if real HEPAX behaves the same. It can be changed though, but I can see no reason for that so far.

NoV's modules can anyhow write and read from any other RAM available (it cannot write protect that page, as stated above) I've tested it with ERAMCO RSU-2 and W&W RAM Box.

Tests that I'd like to perform with the real HEPAX:

1.- HEPAX + ERAMCO RSU-2. 1.1 Does RAMTOG work with ERAMCO's RAM?
................................1.2 Can ERAMCO OS write into HEPAX RAM?

2.- Same as above but with HEPAX RAM Module.

3.- HEPAX + MiliAmpmeter. HEPAX current consumption on DEEP-SLEEP, LIGHT-SLEEP and RUN modes.

4.- HEPAX on port 1, 2, 3 & 4 sequentially. Check where HEPAX code place itself "before" relocation.

These tests can be done in about 40 minutes provided all the required elements are handy. I'll carry all of them but the HEPAX & HEPAX RAM modules.

I think that there will be time enough for all the activities within the weekend.

Cheers.

Diego.


#46

The RAM in a real HEPAX doesn't care where the write instruction comes from. For example, you can use the editor in the ZenROM to edit the HEPAX memory. I think the David Assembler ROM can also be used with HEPAX memory, but I haven't tried it.

AFAIK, RAMTOG only works with the HEPAX. Other devices ignore it.

#47

My breadboard setup allows external power through a 10 Ohm resistor for current measurements. It also has the HP41 analyzer connected, so we can make a full trace of the startup.

I was planning to bring all of this with me to Switzerland anyway.

Meindert

#48

Thanks for the very detailed explanation of the HEPAX initialization process. It looks like everything up through step 6 is working fine, as far as I can tell. It's just when I try to use HEPROOM, HEPDIR, etc. that it seems to fail to initialize the file system correctly (step 7).

I'm not sure what you mean about "need a separate bankswitching scheme". The only thing that seems different about the HEPAX bankswitching as compared to the Advantage ROM, IR printer, or the 41CX bankswitched ROM is that it has four banks instead of two. If you just mean that its bankswitching doesn't affect other ROMs, and vice versa, that's true of all of them and not specific to HEPAX. Otherwise you couldn't use any combination of the 41CX, Advantage ROM, and/or IR printer together.

#49

I've got ENBANK3, ENBANK4, WPTOG, ROMBLK, and WRIT S&X all implemented. Implemented correctly may be another matter.

I didn't want to put it in an odd page because I want it to work like the real thing.

It looks like it's doing the basic RAM initialization, but it's failing to initialize the file system properly when I execute file system functions.

It does not appear to use WPTOG as part of RAM identification. It seems to simply try to write and read back values. It appears to me that it would initialize any other third-party RAM the same way it initializes its own, but I could be mistaken about that.


#50

Wow Eric, you are cruising through this in a remarkable speed! I'm definitely starting to salivate here...

Cheers

Peter

#51

I found the problem, and have the HEPAX working in Nonpareil. There's still some other work remaining before a release. Right now there's still no way to unplug a module, and there's still a problem with starting Nonpareil from saved state if a module was loaded. Maybe I can get those fixed next weekend.

The problem was that the way bank switching of ROMs is managed in .mod files is by having the ROM pages that are modelled as being part of the same ROM chip, and thus subject to common bank switching, as being in the same "bank group".

In Nonpareil, I handle all the bank switching in terms of these bank groups.

However, the HEPAX .mod files do NOT put the ROM pages into a bank group, so Nonpareil was not doing the bank switching at all.

The fix was to add an alternate code path, so that if a bank switch instruction is executed from a ROM page that isn't marked as part of a bank group, but the requested bank does exist for that page, to do the bank switch.


#52

awesome news Eric!

Cheers

Peter

#53

Will you be providing any hooks into RAM so that some type of external access will be available? This would be handy for EM as well.

Thanks. Look forward to your next release.

P.S. Did you get my PM?


#54

Quote:
Will you be providing any hooks into RAM so that some type of external access will be available? This would be handy for EM as well.

I don't think I understand what you have in mind.

The contents of the HEPAX RAM will most likely be stored in the existing Nonpareil state save file, as I'm not happy with having Nonpareil modify the HEPAX .mod file. If there's some reason for a separate program to want to read or write the HEPAX RAM, or extended memory, it can edit the state save file.


#55

Quote:
If there's some reason for a separate program to want to read or write the HEPAX RAM, or extended memory, it can edit the state save file.

Perfect. Currently with my 41CX I can use HP-IL to get programs and data in and out of EM and HEPAX RAM, but with emulators there is no easy way to populate EM/HEPAX RAM with existing data. Your suggested method of doing this is just fine. Thanks.

Edited: 13 Oct 2008, 7:37 p.m. after one or more responses were posted


#56

I've been planning to add support for import/export of programs and possibly data registers. I hadn't yet considered whether to try anything similar for extended memory or HEPAX.

#57

Eric,

I you used the MOD files that I supplied than you should blame me, since I probably did not fill in the BankGroup parameters in the MOD file.

Glad to hear that everything works now,

meindert


#58

I was using the mod files from TOS. Once I put in the extra code to deal with the bank group not being set, your mod file worked too.

Thanks!
Eric

#59

Now I've got the state of the HEPAX being saved and restored along with the rest of the calculator state. Nonpareil does not write the HEPAX contents back to the hepax.mod file.

I'm starting to think that I should have used DOM rather than SAX to read the state save files, which are compressed XML. Oh well, SAX works well enough.

With the last public release of Nonpareil, it wasn't possible to restore state saved from a calculator with modules installed, and module installation was very limited, only working for fixed-address modules. That's all fixed now; when you load a module you select which port to load. I haven't yet implemented unloading of modules.

I'm considering whether Nonpareil should require the calculator to be turned off to load and unload modules. You're supposed to do that on the real calculator, for electrical reasons as well as to avoid problems if the calculator is accessing the module when you remove it. With the simulator, electrical problems are obviously a non-issue, but the HEPAX module is an example of one that doesn't work well if you install it with power applied, and also installing other modules after a HEPAX may fail if you don't power the calculator off, due to the way the HEPAX relocates its ROM. For instance, on a 41CX without a printer installed, the HEPAX will relocate its ROM to page 6, and then installing a printer without powering down will fail since printers are required to be in page 6.

I suppose I could eventually hack something up so that Nonpareil would handle powering down for module installation and up again automatically. Then it would just require that the calculator be in light sleep (not running), and not in program mode.

#60

Eric,

Your problem is most likely in the Bankswitching. HEPAX had exactly the same behavior with my latest MLDL2000 firmware (many changes, and HEPAX not tested yet). Loading only the first HEPAX page does exactly this, and getting back to the previous firmware version resolved the problem.

Without any HEPAX RAM HEPDIR and HEPROOM should say: H:NO FILESYS. I wiil try to get this sorted out today and email a working HEPAX MOD with something in RAM.

Meindert


#61

Found the problem in my bankswitching, the ENBANKx instructions were no recognized anymore due to what I though was an optimization in the firmware. HEPAX now runs again with the newest MLDL2000 firmware (which is not released yet).

This basically shows that Eric is really very close to a working HEPAX implementation, since my MLDL2000 with bankswitching disable shows exactly the same behavior as his emulation, and that his emulation is indeed very very good!

Meindert


#62

Hi,

I think some of my previous comments may deserve a more detailed explanation:

Quote:
HEPAX will need a separate Bankswitching scheme in case other Bankswitched modules are present...

What I was trying to say is that when you have more than one Bankswitched module, you'll need to keep track of which bank is active on each module. Originally (Physical modules) every BS module cares of ist own BS scheme. In an emulation/replication this has to be taken into account.

Most steps are relatively easy to implement, to my mind and experience, the most complex one was step 4; when the "hidden" RAM page must be recovered, and mapped to the appropriate address.

As Meindert has pointed out, the errors you've described remind the first attempts to run HEPAX with "swapped" Bankswitched scheme.

You are close... Go ahead!!

Diego.


#63

Quote:
when you have more than one Bankswitched module, you'll need to keep track of which bank is active on each module.

Right. I learned that the hard way when I tried to use the Advantage module with the 41CX. If you try to use a single global bank variable, bad things happen.

Quote:
the errors you've described remind the first attempts to run HEPAX with "swapped" Bankswitched scheme.

Is that what's been described as the 1, 3, 2, 4 order? I could try that. Are the banks in the .mod file from TOS in the wrong order?


#64

Hi Eric,

The so called (1-3-2-4) order was just a way to describe that the values of the ENBANK instructions are not increasing in a regular way, but swapped 3rd and 4th values resulting in B1=100, B2=180, B3=140, B4=1C0... but I'm sure you already knew that... ;-)

So you learned (the hard way) about the need of independent "bank" variables... sorry to be late... :-(

Hope the following comments may help.

Some other (not so obvious) things regarding BS you have to take into consideration, and may affect the functionality:

- Make sure any other not-bankswitched ROM or RAM image is present in the four Banks!!

- Other Banksitched ROM's (Adv. or IR PRINTER) should show-up Bank-1 (obviously) into Bank-1 *AND* into Bank-3... Otherwise you'll get garbage on HEPAX 002 command.

- Bank-2 of said Bankswitched ROM's should show up in Banks 2 and 4... (I must admit I have not noticed any weird behaviour when Bank-2 is not present at Bank-4... but just to make sure ;-))

Please keep us informed...

Best wishes.

Diego.


#65

Since the bank switching is done independently for each "device", there's no need for any non-bankswitched ROMs to appear in bank 2, or for anything but the HEPAX to be in banks 3 and 4. For instance, the bank-switched part of the Advantage module has to remember its own bank, and isn't affected by ANY bank switch instruction executed by the HEPAX, or by any other ROM. The Advantage, IR printer, and 41CX internal ROM won't ever select the nonexistent banks 3 and 4.

#66

Other Banksitched ROM's (Adv. or IR PRINTER) should show-up Bank-1 (obviously) into Bank-1 *AND* into Bank-3... Otherwise you'll get garbage on HEPAX 002 command.

- Bank-2 of said Bankswitched ROM's should show up in Banks 2 and 4... (I must admit I have not noticed any weird behaviour when Bank-2 is not present at Bank-4... but just to make sure ;-))

Nothing like that is needed and I doubt this is correct at all.

In order to correctly emulate/simulate HEPAX you should do the following:

(1) Implement ENBANK1, ENBANK2, ENBANK3 and ENBANK4 instructions (#100, #180, #140 and #1C0) to select the appropriate bank inside HEPAX ROM.

(2) Implement WMLDL instruction (#040) to write to HEPAX RAM.

(3) Implement WPTOG instruction (#1F0) to toggle write protect/unprotect status of a HEPAX RAM page. Page number is in C[0].

(4) Implement ROMBLK instruction (#030) to move HEPAX ROM to page in C[0].

That's all, it's very simple. CXISA should support reading from all pages, of course.

I implemented (1) .. (4) in my HP-41E emulator for Windows back in 1998/1999 but I didn't implement (4) ROMBLK in HP-41X because HEPAX is fixed to page 7 in HP-41X.

Edited: 13 Oct 2008, 2:11 a.m.


#67

Yes, you're both right!

These notes came from the days I was trying to make HEPAX and Advantage co-exist into a single NoVRAM with a single BANK variable... (yes I also learned that the hard way!!... :-)

Excuse me for the confusion...

Cheers.

Diego.

#68

Thanks much for the information, both here and by email. I have bankswitching working correctly for the 41CX ROM and Advantage ROM, but it's certainly possible that I've done something that breaks it for the HEPAX, or that ENBANK3 and 4 aren't working right. I'll study that further.


Possibly Related Threads...
Thread Author Replies Views Last Post
  HEPAX Revisited: Revision 1E available Ángel Martin 4 438 05-03-2013, 01:57 PM
Last Post: Diego Diaz
  NOVRAM 64 / HEPAX bug? M. Joury 2 321 11-03-2012, 02:49 PM
Last Post: M. Joury
  [41CL] CLUTILS HEPAX Kerem Kapkin (Silicon Valley, CA) 3 296 06-06-2012, 10:52 AM
Last Post: M. Joury
  NoV-64: The Incredible Shrinking HEPAX RAM Les Wright 31 1,712 05-27-2012, 08:48 AM
Last Post: M. Joury
  Non-HEPAX configurations for NoVRAM/NoV-32 Diego Diaz 1 220 02-07-2012, 07:27 AM
Last Post: Ignazio Cara (Italy)
  Getting HEXEDIT to work on the HEPAX itself Ángel Martin 1 216 01-29-2012, 06:42 AM
Last Post: Ángel Martin
  41CL - HEPAX DISASM non-functional? Frido Bohn 1 229 12-20-2011, 07:26 AM
Last Post: Ángel Martin
  HEPAX Focal program "Jump" Jeff Davis 1 231 09-18-2011, 01:44 PM
Last Post: Ángel Martin
  ADV HEPAX goes for $1,000 at TAS !!! Ángel Martin 17 819 09-14-2011, 09:38 PM
Last Post: Gerson W. Barbosa
  NoVRAM / HEPAX MCODE Question Jeff Davis 2 267 12-06-2010, 05:01 AM
Last Post: Frido Bohn

Forum Jump: