Announcing DB48X, RPL for DM42

This area is for discussion about other applications, not fitting the other 3rd-party application areas.
c3d
Posts: 54
Joined: Fri Sep 02, 2022 2:24 pm

Announcing DB48X, RPL for DM42

Post by c3d »

I am happy to announce the first baby steps of DB48X, a project to recreate an HP48-like RPL environment on the DB42. Early this morning, it successfully ran its first RPL program, so I think it is time to share. Here is a quick video of the current state: https://youtu.be/WYlU2oSehoA. Please understand that this is still _very_ rough and incomplete (I started this about 20 days ago).

The project repository is here: https://github.com/c3d/DB48X-on-DM42/tree/sim. You can build the firmware, but there is also a DM42 simulator in it, which makes it easier to develop and run tests.

Please note that there is also an earlier attempt at https://github.com/c3d/db48x/tree/dm42, which you should ignore. It proved a bit too big to fit in the DM42 without claiming the QSPI, which makes installation unnecessarily complex. I'll try to fit in the 704K of available storage as much as possible.

Here is where the community can already help:

1. Improving the on-line documentation: https://github.com/c3d/DB48X-on-DM42/tree/sim/doc. You can read it, suggest corrections, etc. The on-line documentation is written using quasi-standard markdown, but *italics* and _keyboard_ are distinct styles. Also, in "my" flavor of markdown, _ X _ is valid, and is a key `X` with two spaces around it.
2. Making comments and suggestions on the proposed design
3. Submitting code, if you feel like it.

Please use GitHub to report issues or make suggestions, rather than this forum.
Nigel (UK)
Posts: 118
Joined: Fri Jul 21, 2017 11:08 pm

Re: Announcing DB48X, RPL for DM42

Post by Nigel (UK) »

This looks great! However, I'm having a problem building the code. Having cloned it, I notice that the "recorder/" folder is linked to a submodule. So I've run

Code: Select all

git submodule init
and then

Code: Select all

git submodule update
to get the code. However, I get this error message:

Code: Select all

Cloning into '/home/nd/programs/db48x/DB48X-on-DM42/recorder'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:c3d/recorder' into submodule path '/home/nd/programs/db48x/DB48X-on-DM42/recorder' failed
What am I doing wrong?

Thanks in advance for your help!

Nigel (UK)
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Announcing DB48X, RPL for DM42

Post by Thomas Okken »

Very nice!!
c3d
Posts: 54
Joined: Fri Sep 02, 2022 2:24 pm

Re: Announcing DB48X, RPL for DM42

Post by c3d »

Nigel (UK) wrote:
Sun Oct 30, 2022 10:58 pm
This looks great! However, I'm having a problem building the code. Having cloned it, I notice that the "recorder/" folder is linked to a submodule. So I've run

Code: Select all

git submodule init
and then

Code: Select all

git submodule update
to get the code. However, I get this error message:

Code: Select all

Cloning into '/home/nd/programs/db48x/DB48X-on-DM42/recorder'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:c3d/recorder' into submodule path '/home/nd/programs/db48x/DB48X-on-DM42/recorder' failed
What am I doing wrong?

Thanks in advance for your help!

Nigel (UK)
You are doing nothing wrong. I will fix the submodule path.
c3d
Posts: 54
Joined: Fri Sep 02, 2022 2:24 pm

Re: Announcing DB48X, RPL for DM42

Post by c3d »

Nigel (UK) wrote:
Sun Oct 30, 2022 10:58 pm
and the repository exists.
fatal: clone of 'git@github.com:c3d/recorder' into submodule path '/home/nd/programs/db48x/DB48X-on-DM42/recorder' failed
[/code]
This problem should be fixed now. Can you try again?
Nigel (UK)
Posts: 118
Joined: Fri Jul 21, 2017 11:08 pm

Re: Announcing DB48X, RPL for DM42

Post by Nigel (UK) »

Thank you, this now works. Both "recorder" and "make-it-quick" now appear where they should. However, running "make" gives an error :

Code: Select all

ttf2font.cpp: In function ‘void processFont(cstring, cstring, cstring, int, int)’:
ttf2font.cpp:185:41: error: ‘errno’ was not declared in this scope
  185 |         fprintf(stderr, "Error %d: %s", errno, strerror(errno));
      |                                         ^~~~~
ttf2font.cpp:75:1: note: ‘errno’ is defined in header ‘<cerrno>’; did you forget to ‘#include <cerrno>’?
   74 | #include "ids.tbl"
  +++ |+#include <cerrno>
   75 | };
Adding #include <cerrno> at line 44 of ttf2font.cpp fixes this.

I now have a .pgm file to try! I'll try to build the simulator tomorrow. Many thanks.

Nigel (UK)
Nigel (UK)
Posts: 118
Joined: Fri Jul 21, 2017 11:08 pm

Re: Announcing DB48X, RPL for DM42

Post by Nigel (UK) »

Just to confirm that I have successfully built the simulator. If anyone else wants to try, here's a few things that I had to change to get it to work.
  • I had to install Qt development packages. I already had some, but not enough!
  • I had to add the Intel Decimal floating-point maths library gcc111libbid.a for my machine (which I already had) to the lib/ folder. If you don't already have this you have to download the source and build it.
  • My compiler wasn't finding a definition for wchar_t (type for wide characters). This is supposed to be in stddefs.h, but for some reason on my machine it isn't. I added typedef unsigned int wchar_t; to recorder.c and recorder_ring.c to get around this.
  • I had to add -fpermissive to the CXXFLAGS and CFLAGS in simulator.mak to get the code to compile. simulator.mak is generated by qmake from simulator.pro, so this change will have to be reapplied if make sim is run again from scratch.
  • I had to replace the line return test(first).test(args...); (line 205 in tests.h) with return test(first, args...);
    for the code to compile without error.
After all that I got a working simulator! I tried running it with the -T testing option. It stopped with this error:
1: 001: Integer addition Segmentation fault (core dumped)
but it's early days yet!

Nigel (UK)
c3d
Posts: 54
Joined: Fri Sep 02, 2022 2:24 pm

Re: Announcing DB48X, RPL for DM42

Post by c3d »

Hi Nigel,

Could you tell me which errors you get without -fpermissive?

Also, which compiler / OS are you building on?

Thanks,
Christophe
Nigel (UK)
Posts: 118
Joined: Fri Jul 21, 2017 11:08 pm

Re: Announcing DB48X, RPL for DM42

Post by Nigel (UK) »

Here is a sample of the error messages:

Code: Select all

In file included from ../src/arithmetic.h:34,
                from ../src/input.cc:32:
../src/decimal-64.h: In constructor ‘decimal64::decimal64(uint64_t, object::id)’:
../src/decimal-64.h:70:39: error: invalid conversion from ‘uint64_t*’ {aka ‘long unsigned int*’} to ‘BID_UINT64*’ {aka ‘long long unsigned int*’} [-fpermissive]
   70 |         bid64_from_uint64(&num.value, &value);
      |                                       ^~~~~~
      |                                       |
      |                                       uint64_t* {aka long unsigned int*}
                                  ^~
In file included from ../src/arithmetic.h:34,
                 from ../src/input.cc:32:
../src/decimal-64.h: In constructor ‘decimal64::decimal64(int64_t, object::id)’:
../src/decimal-64.h:78:38: error: invalid conversion from ‘int64_t*’ {aka ‘long int*’} to ‘BID_SINT64*’ {aka ‘long long int*’} [-fpermissive]
   78 |         bid64_from_int64(&num.value, &value);
      |                                      ^~~~~~
      |                                      |
      |                                      int64_t* {aka long int*}
In file included from ../src/arithmetic.h:35,
                 from ../src/input.cc:32:
../src/decimal128.h: In constructor ‘decimal128::decimal128(uint64_t, object::id)’:
../src/decimal128.h:70:40: error: invalid conversion from ‘uint64_t*’ {aka ‘long unsigned int*’} to ‘BID_UINT64*’ {aka ‘long long unsigned int*’} [-fpermissive]
   70 |         bid128_from_uint64(&num.value, &value);
      |                                        ^~~~~~
      |                                        |
      |                                        uint64_t* {aka long unsigned int*}
I took the appearance of [-fpermissive] after the error to be a Sign of how to overcome the problem!

I'm using Ubuntu 22.04.1 LTS. The compiler is gcc 11.3.0.

Nigel (UK)
jwiede
Posts: 44
Joined: Mon Oct 18, 2021 11:17 pm
Location: San Jose, CA USA

Re: Announcing DB48X, RPL for DM42

Post by jwiede »

So is this building fine on UNIX (and Mac) systems now, or are there still library problems?

What's the current state of the DM42 build?
DM42, DM16L, and a menagerie of HPs thanks to CAS (Calc Acq Syndrome)!
Post Reply