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