The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

[WP34S] Creating My Own calc_full.bin
Message #1 Posted by Les Wright on 3 Apr 2012, 1:27 a.m.

I am aware that it is recommended to flash with the calc_full.bin binary provided with each release so that the user has all of the extra programs in flash memory on the calculator. I haven't been doing that since I really like to work with a "clean" machine to start.

However, in experimenting with how to get my programs back onto to my calc after erasing it with each new firmware update, I have found that concatenating files using the Unix cat function on Mac OS X works just fine. I guessed this was the analogy to the DOS/Windows copy /b command used in the the join.cmd file provided with the various releases. I had tried to concatenate my own binaries with copy /b when I was using v. 2.2, but could never seem to get it right so I eventually gave up.

If all of my programs are in programs.txt, I first create a flash library in the appropriate format:

$ wp34s_lib.pl -olib wp34s-lib.dat programs.txt

That done I concatenate this with the exist calc.bin file:

$ cat calc.bin wp34s-lib.dat > my_calc_full.bin

I then go over to MySamba in my Windows XP installation under Fusion, and flash the calc with my_calc_full.bin, and on resetting the calc from the flash cable and turning it on my programs are all there in the flash library.

This was easy enough to figure out but I don't recall seeing it documented explicitly anywhere. Should it be? Learning to do this saves me several steps and lots of time when restoring the calc's programs after a new firmware flashing. Of course, I will still need to use the emulator and calc serial transfer commands to move other RAM contents like registers and settings, but this seems to be the best way to move programs, especially when the size of one's library grows larger than the maximum allowable size of RAM.

Comments welcome!

Les

Edited: 3 Apr 2012, 1:45 a.m.

      
Re: [WP34S] Creating My Own calc_full.bin
Message #2 Posted by Walter B on 3 Apr 2012, 2:02 a.m.,
in response to message #1 by Les Wright

Hi Les,

Thanks for your post describing your experience. The part of the manual dealing with the topics you covered eventually became the oldest one now and obviously needs some rework. Will be done in due course and may use - with your permission - some parts of your text. If you want something added, feel free to send me an update.

Walter

      
Re: [WP34S] Creating My Own calc_full.bin
Message #3 Posted by Marcus von Cube, Germany on 3 Apr 2012, 2:32 a.m.,
in response to message #1 by Les Wright

I was always thinking that Unix users were much more proficient with command line utilities then their Windows counterparts, so I wrote the first drafts of the chapter in the documentation for this clientèle. Your approach is perfectly correct.

Just moving a single program to the calculator over the wire is easy unless it's larger then the maximum number of program steps in RAM (with zero registers allocated). A single program should never reach this size. That's what the END statement is designed for: Divide your work in manageable units which can be easily moved between RAM and the library with PSTO and PRCL.

            
Re: [WP34S] Creating My Own calc_full.bin
Message #4 Posted by Massimo Gnerucci (Italy) on 3 Apr 2012, 5:08 a.m.,
in response to message #3 by Marcus von Cube, Germany

Quote:
I was always thinking that Unix users were much more proficient with command line utilities then their Windows counterparts

Please, don't generalize... ;)

Massimo

                  
Re: [WP34S] Creating My Own calc_full.bin
Message #5 Posted by fhub on 3 Apr 2012, 6:51 a.m.,
in response to message #4 by Massimo Gnerucci (Italy)

Quote:
Quote:
I was always thinking that Unix users were much more proficient with command line utilities then their Windows counterparts
Please, don't generalize... ;)
Yes, especially Windows users coming from the good old DOS times are definitely experts in command line utilities! :-)

Franz

                        
Re: [WP34S] Creating My Own calc_full.bin
Message #6 Posted by M. Joury on 3 Apr 2012, 7:53 a.m.,
in response to message #5 by fhub

My coworkers find my reliance on the command line somewhere between odd and irritating. The funny thing is that one of those individuals comes from a UNIX background so I am surprised by *his* reliance on GUI tools.

Cheers,

-Marwan

                              
Re: [WP34S] Creating My Own calc_full.bin
Message #7 Posted by bill platt on 3 Apr 2012, 8:19 a.m.,
in response to message #6 by M. Joury

In '98, I was working in Deutschland for a few months and the yard was on a Unix mainframe. The GUI of that UNIX system blew away anything either W$ or Apple had ever done.

Only a few years earlier in grad school, the unix mainframe was completely command line.

            
Re: [WP34S] Creating My Own calc_full.bin
Message #8 Posted by Les Wright on 4 Apr 2012, 12:34 a.m.,
in response to message #3 by Marcus von Cube, Germany

Walter and Marcus,

Should it be possible as well to concatenate state files wp34s.dat or wp34s-backup.dat with calc.bin. The v. 2.2 manual gives instructions for doing this with copy /b, but when I attempt to concatenate with

$ cat calc.bin wp34s-lib.dat wp34s-backup.dat > my_calc_full.bin

or variations on this (library file comes second rather than first, wp34s.dat used as state file rather than the backup file), the library contents may or may not go over (depending whether I concatenate it first or second to calc_bin), but the state file contents don't write at all to the catalogue.

Keep in mind that I use MySamba, so in the event that the state file is written to RAM rather than flash memory in the back-up addresses, it will be erased when I hit the reset button and turn the calc back on.

Any thoughts on this? I probably won't do this sort of flashing as a steady diet, but it will be nice to see if it is possible.

Les

                  
Re: [WP34S] Creating My Own calc_full.bin
Message #9 Posted by Marcus von Cube, Germany on 4 Apr 2012, 1:58 a.m.,
in response to message #8 by Les Wright

You need to use DD to fill the flash file to 126KB size before you can append wp34s.dat. Can't think of an automated syntax (independent of actual flash file size) to do this.

BTW, your bin files look ok. I need to check on the hardware. It might be a checksum error. Can you send me the wp34s-lib.file you are appending?

                        
Re: [WP34S] Creating My Own calc_full.bin
Message #10 Posted by Les Wright on 4 Apr 2012, 2:03 a.m.,
in response to message #9 by Marcus von Cube, Germany

DD?

                              
Re: [WP34S] Creating My Own calc_full.bin
Message #11 Posted by Les Wright on 4 Apr 2012, 2:08 a.m.,
in response to message #10 by Les Wright

Never mind. Google is my friend. Looks sophisticated. Could be fun to play with, but I do fear bricking my calc...

                                    
Re: [WP34S] Creating My Own calc_full.bin
Message #12 Posted by pascal_meheut on 4 Apr 2012, 2:20 a.m.,
in response to message #11 by Les Wright

DD means "Copy & Convert" but CC was already taken.

                                    
Re: [WP34S] Creating My Own calc_full.bin
Message #13 Posted by Marcus von Cube, Germany on 4 Apr 2012, 4:13 a.m.,
in response to message #11 by Les Wright

The ERASE button will always bring your calc back to SAM-BA boot mode so don't be afraid.

                                          
Re: [WP34S] Creating My Own calc_full.bin
Message #14 Posted by Les Wright on 5 Apr 2012, 2:59 p.m.,
in response to message #13 by Marcus von Cube, Germany

Good to know.

I will note that I tried to manipulate the size of my calc_full.bin by appending multiple copies of wp34s-lib.dat plus wp34s.dat to bring it to a total file size of 128KB. No dice. I the flashing goes well, but all I get is a single copy of the library programs.

I won't worry about this now. It would be great to get this to work, but for the time being I am happy that I can build a wp34s-lib.dat file of my choosing, concatenate it with calc.bin, and move it over. If I wish to move over RAM contents or settings from the emulator, SENDA, SENDP, SENDR, etc., work very well indeed, even on the Mac.

Les

                                                
Re: [WP34S] Creating My Own calc_full.bin
Message #15 Posted by Marcus von Cube, Germany on 5 Apr 2012, 3:39 p.m.,
in response to message #14 by Les Wright

Quote:
I will note that I tried to manipulate the size of my calc_full.bin by appending multiple copies of wp34s-lib.dat plus wp34s.dat to bring it to a total file size of 128KB. No dice. I the flashing goes well, but all I get is a single copy of the library programs.
That explains it! The software looks in exactly one place for the library header, that is at the end of the code, rounded up to a 256 byte boundary. The header contains a checksum and the number of steps. The lib tool is responsible to add programs and update the header. Any further copies of this data block aren't recognized at all, they are just invisible to the software.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall