pyILPER: Read and write HP-41 ROM/MOD files
11-07-2017, 02:43 PM
Post: #1
 Geir Isene Senior Member Posts: 377 Joined: Dec 2013
pyILPER: Read and write HP-41 ROM/MOD files
How do I read and write HP-41 ROM or MOD files to/from an HP-41 using pyILPER (thanks for a great piece of sw, btw)?
11-07-2017, 04:24 PM
Post: #2
 Dave Frederickson Senior Member Posts: 1,389 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
I believe what you want to use are Joachim's LIFUTILS, for which pyILPER makes a great front-end.

In pyILPER, mount a LIF disc image in one of the Drive tabs, then clear the Device enabled check box, this enables access to LIFUTILS. There will be capabilities enabled in the Drive drop-down menu and right-click options in the directory window.

Dave
11-07-2017, 04:25 PM
Post: #3
 jsi Member Posts: 53 Joined: Jun 2015
RE: pyILPER: Read and write HP-41 ROM/MOD files
pyILPER can import and export rom files as HEPAX SDATA files to/from the currently mounted LIF image file. Check the option "convert HP-41 rom to SDATA file (HEPAX) on import or "unpack HPEAX HP41 SDATA ROM file" on export. You have to disable the virtual drive to access the file management functions (Tool menu and directory entry context menu).

pyILPER uses the "rom41hx" and "hx41rom" filters of the LIFUTILS.

Regards
Joachim
11-07-2017, 07:19 PM
Post: #4
 Geir Isene Senior Member Posts: 377 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
OK, for the dense - please repeat with a baby-step checklist (note: I am on Linux, running pyILPer):

1. Start pyILPER
2. Make sure the PILbox is connected physically and to the pyILPer program running pyILPer configuration from inside the program ("File" menu)
3. ??
4. ??
11-07-2017, 08:54 PM (This post was last modified: 11-07-2017 09:10 PM by Geir Isene.)
Post: #5
 Geir Isene Senior Member Posts: 377 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
I tried this:

Code:
 cat CASINO.ROM | rom41hx CASINO > casino.sda

And tried to load the file (casino.sda) and got an error message "File does not contain a LIF type 1 medium."

I want to have e.g. the CASINO.ROM loaded into my HP-41CL using the PILbox and the pyILPer.

Edit; Got an old LIF file loaded - but how do I get the CASINO.ROM in there using e.g. lifutils?
11-07-2017, 09:13 PM
Post: #6
 Dave Frederickson Senior Member Posts: 1,389 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
(11-07-2017 08:54 PM)Geir Isene Wrote:  I tried this:

Code:
 cat CASINO.ROM | rom41hx CASINO > casino.sda

And tried to load the file (casino.sda) and got an error message "File does not contain a LIF type 1 medium."

I want to have e.g. the CASINO.ROM loaded into my HP-41CL using the PILbox and the pyILPer.

Casino.sda is not a LIF image, consequently the error message.

1. Create a copy of CASSETTE.DAT from the lifimage folder.
2. Mount the LIF tape image in one of the drive tabs.
3. Disable the virtual drive - enabling LIFUTILS.
4. Copy casino.sda to the tape image file. Sorry, I don't have a copy of pyILPER running at the moment so I can't offer specific details. You could also do this from the command line using lifput. Also note that converting the file outside of pyILPER wasn't necessary.
5. From here, casino.sda can be accessed as if it were on a tape drive.

Dave
11-08-2017, 12:38 AM
Post: #7
 Geir Isene Senior Member Posts: 377 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
On 5: I see CASINO as a "DA" file and not able to use e.g. GETROM to load it onto the 41 as an ordinary ROM.
11-08-2017, 12:50 AM
Post: #8
 Geir Isene Senior Member Posts: 377 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
It seems I can use only LIFUTILS to do what I want here (skipping pyILPER enirely and with LIFILPER as the hook to the PILbox) - if I could only get the ROM file _as_a_ROM-file_ into a LIF file.

If I could do this, then I could create a neat TOTAL-UPDATE program for the HP-41CL (such as Sylvain did with the CL serial interface) using the PILbox. Reason: I broke the serial connector on the CL board. It may even prove to be smoother than the CL serial connector way (by simply stuffing all the needed roms into one LIF file and mount it via LIFILPER and let the HP-41CL fetch each ROM successively and stuff them into Flash).
11-08-2017, 12:52 AM (This post was last modified: 11-08-2017 12:55 AM by Dave Frederickson.)
Post: #9
 Dave Frederickson Senior Member Posts: 1,389 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
Give me a couple of hours to get home where I can try this.
11-08-2017, 12:55 AM
Post: #10
 Geir Isene Senior Member Posts: 377 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
(11-08-2017 12:52 AM)Dave Frederickson Wrote:  Make the below changes to the instructions.

4. Copy casino.rom to the LIF image.
5. From here, casino.rom can be accessed as if it were on a tape drive.

How? If I do this:

Code:
 lifput test.lif CASINO.ROM

(test.lif being a properly initialized and valid LIF image)

... then I get this:

Code:
 illegal file type
11-08-2017, 01:22 AM (This post was last modified: 11-08-2017 01:35 AM by Dave Frederickson.)
Post: #11
 Dave Frederickson Senior Member Posts: 1,389 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
(11-08-2017 12:55 AM)Geir Isene Wrote:
(11-08-2017 12:52 AM)Dave Frederickson Wrote:  Make the below changes to the instructions.

4. Copy casino.rom to the LIF image.
5. From here, casino.rom can be accessed as if it were on a tape drive.

How? If I do this:

Code:
 lifput test.lif CASINO.ROM

(test.lif being a properly initialized and valid LIF image)

... then I get this:

Code:
 illegal file type

In order to use lifput the file must have a valid 32-byte LIF file header, which it probably does not. I suggest pyILPER be used as a front-end for LIFUTILS as it offers some options that may not be obvious.

Please post a copy of casino.rom or a link to where I can download it.

In the mean time, can you load one of the ROM files from the LIF archive, like WIZROM on SWAP12?

Dave
11-08-2017, 02:16 AM
Post: #12
 Geir Isene Senior Member Posts: 377 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
The Casino rom is just an example. It's the same with any rom file.

Here's the thing:

I need to save a rom file (any rom file) to a LIF image so that the HP-41CL can retrieve it via a command such as CCD OSX's GETROM.

OR, I need to figure out how to retrieve the rom file to the HP-41CL when the rom file is saved inside the LIF image as an SDATA file.

Either of these would work fine. And preferably using just the LIFUTILS so that batch uploads of roms to the 41CL can be fully automated via a script.
11-08-2017, 02:29 AM
Post: #13
 Dave Frederickson Senior Member Posts: 1,389 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
Using pyILPER, importing a file gives the option of converting a ROM file to SDATA or adding a LIF file header to an HP41 FOCAL raw file.

Converting the file to SDATA can easily be scripted, so perhaps someone can provide the steps to import the SDATA file.

Dave
11-08-2017, 06:47 PM
Post: #14
 hth Member Posts: 117 Joined: Mar 2014
RE: pyILPER: Read and write HP-41 ROM/MOD files
With a huge/complete set of .mod files, then a script tool could extract .rom images and given some rules of how to distrubute the images, create a LIF image so that a file in it corresponds to each flash sector in the 41CL.

With that, it would just be a matter of running an RPN program on the HP-41 and load a file to 41CL RAM using HP-IL, then invoke a flash update?

I am also without a serial port on my 41CL, and wonder how feasible it would be?

Håkan
11-08-2017, 06:57 PM (This post was last modified: 11-08-2017 07:27 PM by Geir Isene.)
Post: #15
 Geir Isene Senior Member Posts: 377 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
(11-08-2017 06:47 PM)hth Wrote:  With a huge/complete set of .mod files, then a script tool could extract .rom images and given some rules of how to distrubute the images, create a LIF image so that a file in it corresponds to each flash sector in the 41CL.

With that, it would just be a matter of running an RPN program on the HP-41 and load a file to 41CL RAM using HP-IL, then invoke a flash update?

I am also without a serial port on my 41CL, and wonder how feasible it would be?

Håkan

Yes - this way would be a very smoothe way of updating the 41CL - we could have dated LIF files with all CL roms in them - sequentially ordered like in the CL. Then it's a trivial matter of hooking the CL up to the LIF file on the PC via the PILBox - and then run a program on the 41 to fix the updates. Go and make dinner, eat and stroll back to the 41CL and voilá - it's done.

The trick is to get the ROM files into the LIF file in a way for the 41CL to grab them from there and stuff them into its RAM pages. I'm hoping for a guru to give me a hint of how to solve this trick. The programming on the PC side and on the 41CL I will happily do :-)
11-08-2017, 07:31 PM
Post: #16
 rprosperi Senior Member Posts: 2,125 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
(11-08-2017 06:57 PM)Geir Isene Wrote:  Then it's a trivial matter of hooking the CL up to the LIF file on the PC via the PILBox - and then run a program on teh 41 to fix the updates. Go and make dinner, eat and stroll back to the 41CL and voilá - it's done.

Assuming you can create such a LIF volume with all the ROM images (a big if, IMHO) the update via HP-IL will take MUCH longer than dinner! When updating only the changed images, it can still take 3-4 hours via direct serial transfer, so via HP-IL on the '41, this will take days....

It seems that simply ordering a $30 cable (plus ship to Europe, but still) makes more sense, but you may have more free time than I do. In any case, I agree it's an interesting challenge. After many hours of exploring ROM downloads via HP-IL (via HEPAX and/or CCD tools, plus file conversions, and tracking ROM image IDs and sequence, etc. etc.) I caved and went the cable route. But I'd love to see your solution, so please don't take this as criticism. --Bob Prosperi 11-08-2017, 08:07 PM (This post was last modified: 11-08-2017 08:08 PM by Geir Isene.) Post: #17  Geir Isene Senior Member Posts: 377 Joined: Dec 2013 RE: pyILPER: Read and write HP-41 ROM/MOD files (11-08-2017 07:31 PM)rprosperi Wrote: (11-08-2017 06:57 PM)Geir Isene Wrote: Then it's a trivial matter of hooking the CL up to the LIF file on the PC via the PILBox - and then run a program on teh 41 to fix the updates. Go and make dinner, eat and stroll back to the 41CL and voilá - it's done. Assuming you can create such a LIF volume with all the ROM images (a big if, IMHO) the update via HP-IL will take MUCH longer than dinner! When updating only the changed images, it can still take 3-4 hours via direct serial transfer, so via HP-IL on the '41, this will take days.... It seems that simply ordering a$30 cable (plus ship to Europe, but still) makes more sense, but you may have more free time than I do. In any case, I agree it's an interesting challenge. After many hours of exploring ROM downloads via HP-IL (via HEPAX and/or CCD tools, plus file conversions, and tracking ROM image IDs and sequence, etc. etc.) I caved and went the cable route. But I'd love to see your solution, so please don't take this as criticism.

It would be a solution to only update the changed files - or only the files you want to update (or add). The problem with the serial cable solution for the CL is that it requires a syncronous solution - i.e. the PC and the 41 side going back and forth between each image. With this LIF solution, you would create the LIF file and be done with the PC side and let the 41 do the rest without interruption.

As for ordering a new cable... the connector on the CL board is damaged. A new cable doesn't help.
11-08-2017, 10:17 PM
Post: #18
 rprosperi Senior Member Posts: 2,125 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
(11-08-2017 08:07 PM)Geir Isene Wrote:  It would be a solution to only update the changed files - or only the files you want to update (or add). The problem with the serial cable solution for the CL is that it requires a syncronous solution - i.e. the PC and the 41 side going back and forth between each image. With this LIF solution, you would create the LIF file and be done with the PC side and let the 41 do the rest without interruption.

As for ordering a new cable... the connector on the CL board is damaged. A new cable doesn't help.

A broken connector on the CL board changes things, I agree there.

I guess I don't see why it's a problem to go back and forth between the CL and PC serving the needed ROM images and a CL and a LIF volume supplying the needed ROM images, but as I said, I do look forward to this solution so will follow along.

You will have to somehow manage the FLDB mapping of ROM images to addresses, which is done automatically using the clserver software, but the CLUPDATE manual may provide some useful information on how to do that.

--Bob Prosperi
11-15-2017, 09:00 PM
Post: #19
 Michael Fehlhammer Member Posts: 156 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
I really do not want to be a spoil-sport, I am interested in an HP-IL solution for updating the CL as well.
But there is a severe drawback of the HP-IL solution you have to be aware of:

via HP-IL the usual ROM reading and writing routines ( HEPAX, CCD, Eramco ...) only use 10 bit words, since a normal HP41 (non-CL) sees and uses only these 10 bits. ( Some 'unpacked' ROM formats seem to use 16 bit words, but the upper 6 bits are all zero and ignored ).

Within the 41CL, 16 bit words are used; the additional 6 bits can be used to control the CL speed mode, for example.

Some modern rom images, especially those which can be seen as CL operating system extensions, make use of the additional bits. Such images may only be transferred without loss of information via CL serial connection.

You could overcome this problem by defining your own CL - ROM file format and by programming the special 16 bit read and write routines.
11-15-2017, 09:10 PM
Post: #20
 Geir Isene Senior Member Posts: 377 Joined: Dec 2013
RE: pyILPER: Read and write HP-41 ROM/MOD files
Interesting. What you are saying is that there is no way that e.g. the HEPAX READROM function could transfer these modules without breaking them?

I am open for suggestions on how to go about ensuring no additional data in modern roms are lost while transferring the roms over HP-IL.

It would be a shame if the venerable HP-IL module with the excellent PILbox could not be used for fully updating an HP-41CL.
 « Next Oldest | Next Newest »

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