Omnimaga

Calculator Community => HP Calculators => Topic started by: DJ Omnimaga on August 18, 2013, 08:16:03 pm

Title: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 18, 2013, 08:16:03 pm
This is a topic where we should gather all information we can in order to hack the HP Prime for ASM/C support. Basically, if you have made any discoveries or if you have an idea, feel free to share it!

Make sure to not upload copyrighted material such as OS code or Boot1/2/whatever, though.
Title: Re: Let's hack the HP Prime!
Post by: Juju on August 18, 2013, 08:20:07 pm
I approve of this topic. It would only be real active when most of us will have a HP Prime in our hands because the simulator, well, it's not an emulator.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 18, 2013, 08:25:30 pm
Indeed. Of course it will depend of who actually both program in ASM/C and owns the calc, but still, even people who just got the emulator (assuming it accurately runs the OS) could possibly help.
Title: Re: Let's hack the HP Prime!
Post by: critor on August 18, 2013, 08:51:56 pm
By holding the [Symb] key while pressing reset on the back, you enter the OS recevory mode.

By holding all three [ F ] [ C ] [ O ] keys while pressing reset on the back, you get some kind of a maintenance/diagnostic menu.
Title: Re: Let's hack the HP Prime!
Post by: Juju on August 18, 2013, 10:09:08 pm
Nice! Can you show pics?
Title: Re: Let's hack the HP Prime!
Post by: Adriweb on August 18, 2013, 11:30:04 pm
I do believe that having an actual emulator would be quite (if not extremely) useful.
Maybe taking some parts from nspire_emu could be a good base, considering the processor is pretty much the same.

Some info:
The firmware binairies aren't encrypted (at all). But I guess that the people who know about ARM ASM programming already looked at the .elf files and figured that out ^^

Like on the Nspire, the next step would be to look for flaws (buffer overflow etc.) but again I'll leave that to people who know about this ^^


(BTW, not completely hacking-related, but here is a bit of info about the transfer protocol : http://tiplanet.org/hpwiki/HP_Prime/Linking_Protocol )
In fact it would be cool to have some official documentation of the protocol, from HP. In fact, for TI, TILP (which is especially useful (the only option, in fact) for Linux users) has been made through painful reverse-enginnering through USB sniffing/dumpings. As HP looks more open to the community, maybe they would give the interested people some documentation so that a linking program could be coded for Linux, mainly :)
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on August 19, 2013, 03:58:50 am
I do believe that having an actual emulator would be quite (if not extremely) useful.
That would be great indeed but a lot of work too. :-\
Quote
As HP looks more open to the community, maybe they would give the interested people some documentation so that a linking program could be coded for Linux, mainly :)
I think both Omnimaga and TI-Planet should be eligible as HP beta testers and be given some privileged technical info. Let's hope HP sniffers read these messages and are sensible enough to provide some more useful insight.
Title: Re: Let's hack the HP Prime!
Post by: Adriweb on August 19, 2013, 04:28:03 am
Critor and I are officially beta testers already, btu we don't have access to technical info more than anyone here.
And, well, the linking protocol isn't so much a "private" in a sense that it just can get reversed-engineered, but it takes quite some time.

And what bad can giving some doc on the linking protocol do anyway :P
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on August 19, 2013, 06:03:10 am
Why not base a community emulator on an existing emulator framework such as QEMU, BTW ?
It's easy to find a fork of an old version of QEMU suitable for a S3C244x-based board, and while I haven't looked at the datasheets of both the S3C2416 and the relevant S3C244x (only at the S3C2416), chances are that they do share some devices.
Title: Re: Let's hack the HP Prime!
Post by: critor on August 19, 2013, 08:41:20 am
Nice! Can you show pics?

The post is not available in english yet, but you can find some HP-Prime Diagnostic pictures in the latest TI-Planet news:
http://tiplanet.org/forum/viewtopic.php?f=55&t=12860
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 19, 2013, 09:59:30 am
How do you update firmware on the calc? Do you use that menu for it or can you do it by hooking it up to the pc and click update firmware in some sort of update client program?
Title: Re: Let's hack the HP Prime!
Post by: critor on August 19, 2013, 11:15:24 am
The firmware mentioned in the Diagnostic seems to be only for the touch screen.

If by firmware you mean the OS, I use the recovery mode accessible by holding [Symb] while resetting the calculator.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 19, 2013, 11:23:09 am
And recovery mode takes firmware from a file on the calculator?
Title: Re: Let's hack the HP Prime!
Post by: critor on August 19, 2013, 11:27:57 am
The OS has to be sent from the computer with a specific tool.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 19, 2013, 01:03:40 pm
And that tool obviously checks the os first.
Title: Re: Let's hack the HP Prime!
Post by: critor on August 19, 2013, 01:20:39 pm
What we have is clearly neither the final tool, nor the final OS format.
So I cannot give a final answer to your question.
Title: Re: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 19, 2013, 01:55:10 pm
Is there a way to enter maintenance/OS recovery modes in the emulator?
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 20, 2013, 01:05:25 am
Did the "emulator" come with a reset button on the back?
Title: Re: Let's hack the HP Prime!
Post by: Adriweb on August 20, 2013, 02:20:18 am
No, it's "just" a simulator.
Title: Re: Let's hack the HP Prime!
Post by: critor on August 20, 2013, 08:21:38 am
Guidebook, firmware and linking software did leak last week on the HP FTP server and were quickly removed:
http://tiplanet.org/forum/viewtopic.php?f=55&t=12867&lang=en
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on August 20, 2013, 09:16:19 am
Guidebook, firmware and linking software did leak last week on the HP FTP server and were quickly removed:
http://tiplanet.org/forum/viewtopic.php?f=55&t=12867&lang=en
Come on, it can only have been done on purpose, IMHO!
BTW, has any of you managed to get hold of the "HP-Connectivity Kit"? That would be really interesting. And also the booter code, of course!

Good news, nevertheless! ;)
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on August 20, 2013, 11:28:24 am
Some of the firmware upgrades contain a file named "BXCBOOT0.bin".
Title: Re: Let's hack the HP Prime!
Post by: critor on August 20, 2013, 11:31:00 am
Which is the Boot Code.
V11 in the leaked firmware.
V13 in the current zip-password-protected firmware.
Title: Re: Let's hack the HP Prime!
Post by: Adriweb on August 20, 2013, 12:13:04 pm
Lionel and I started an article about the file formats used for the Prime's data :
http://tiplanet.org/hpwiki/HP_Prime/File_Format#Known_file_types

Not extremely related to the Prime hacking in itself (well, who knows ?), but still good to know :)

I've especially worked on the list format, it was quite easy to "decrypt", once knowing how to procude these .hplist files correctly from the HP Connectivity Kit (the calc simulator software is more annoying to work with - we/I'm not sure exactly when it decides to save stuff...)

I'll definitely look at the rest of the formats when I have some time.
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on August 20, 2013, 12:19:00 pm
Thanks for the input.
Here are some thoughts on how i think this hacking business could eventually proceed. Someone ought to write some sort of roadmap. To start with (let's take it easy :)), we need to figure out the HP Prime's system:
    architecture surrounding the microcontroller (S3C2416).
    memory map: ROM, RAM, IO, etc.
During this process, some ARM disassembly will certainly be required. This step will be a bit awkward to accomplish here because we'll need to abide by the forum rules, but still feasible by other means.

Please feel free to add your contributions/advice, because i'm sure i won't have enough free time to lead this process.
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on August 20, 2013, 12:28:34 pm
Chances are that people have started proceeding a while before you posted a roadmap ;)
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on August 20, 2013, 12:35:53 pm
Yeah, i thought so too, but i am not aware of it. That's nice to hear, though! But don't you think we a need some common place to share that valuable info?
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on August 20, 2013, 12:41:19 pm
That's probably the goal of this topic, as stated by DJ in the first post ?
The hpwiki could contain such information as well.
Title: Re: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 20, 2013, 12:45:15 pm
Just make sure to not blatantly explain how to circumvent the teacher mode during exams. :P
Did the "emulator" come with a reset button on the back?
nah but there is a reset option in the menus. The thing, though, is that even if it actually worked like on the calc, it would be next to impossible to do the key combination and clicking that option simultaneously.
Title: Re: Let's hack the HP Prime!
Post by: critor on August 20, 2013, 12:47:32 pm
We've never been interested into that, not even on the TI-Nspire.
Title: Re: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 20, 2013, 12:49:39 pm
Indeed. Just warning in case there are some potential new members who might get interested in hacking but don't know well enough about ethics and morals.
Title: Re: Let's hack the HP Prime!
Post by: timwessman on August 20, 2013, 12:50:07 pm
(the calc simulator software is more annoying to work with - we/I'm not sure exactly when it decides to save stuff...)

On exit. Everything is only saved when either more memory is needed (and then it will write out loaded objects), or on power down.

Loading is also delayed until needed. Some of the mysterious bits you have trouble interpreting are flags indicating status, location in memory, or similar.
Title: Re: Let's hack the HP Prime!
Post by: Adriweb on August 20, 2013, 12:53:48 pm
Ah, thanks for the details :)  (For some potential data editor, would setting these bytes to '0' (or duplicate from a known number) be a bad idea ?)

(For the simulator, I also believed it was on exit, but at several occasions, Windows couldn't see the file as updated... so that's why. No problem with the connectivity kit, though, since saving was manually done)
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on August 20, 2013, 01:06:26 pm
That's probably the goal of this topic, as stated by DJ in the first post ?
The hpwiki could contain such information as well.
Yeah, this time, i completely with you, weird he? ;) Sooner or later that info will be uncovered, anyway.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 20, 2013, 01:13:40 pm
Guidebook, firmware and linking software did leak last week on the HP FTP server and were quickly removed:
http://tiplanet.org/forum/viewtopic.php?f=55&t=12867&lang=en
Come on, it can only have been done on purpose, IMHO!
BTW, has any you managed to get hold of the "HP-Connectivity Kit"? That would be really interesting. And also the booter code, of course!

Good news, nevertheless! ;)

Quite possible. Their time is more expensive than ours.
Title: Re: Let's hack the HP Prime!
Post by: critor on August 20, 2013, 01:16:12 pm
SpiroH -> You might ask to people who did post in the HP-Museum topic:
http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=247985#247985
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 20, 2013, 01:17:02 pm
(the calc simulator software is more annoying to work with - we/I'm not sure exactly when it decides to save stuff...)

On exit. Everything is only saved when either more memory is needed (and then it will write out loaded objects), or on power down.

Loading is also delayed until needed. Some of the mysterious bits you have trouble interpreting are flags indicating status, location in memory, or similar.
Sometimes, I keep the save folder open on my computer in case I mess up. If I fear that the calc could crash, requiring a reformat (although so far things are fine) or if I worry about messing up my program, I just copy the hpprgm files into a different folder.

Question: What kind of data is stored into RAM? When a program is executed, for example, is it copied to a certain RAM area, forcing a size per program limit? Are programs always stored in RAM then backed up in Flash when the calc is turned OFF (to prevent them from being lost on a reset)? How large are each GROB memory areas?

If the GROBs are quite large, this could definitvely be an awesome RAM area to store content for use with ASM/C  programs.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 20, 2013, 01:18:38 pm
I assume they are all beta testers?
Title: Re: Let's hack the HP Prime!
Post by: critor on August 20, 2013, 01:22:07 pm
If they were all beta-testers, they wouldn't have needed to read the post about the FTP account. ;)
Title: Re: Let's hack the HP Prime!
Post by: timwessman on August 20, 2013, 01:33:41 pm
Quote
Question: What kind of data is stored into RAM? When a program is executed, for example, is it copied to a certain RAM area, forcing a size per program limit? Are programs always stored in RAM then backed up in Flash when the calc is turned OFF (to prevent them from being lost on a reset)? How large are each GROB memory areas?

It is actually quite interesting/different to see people who have never experienced "HP" calculators discovering the programming philosophy differences. There have never been arbitrary limits or things put in place to try and restrict what you can do in HP graphers. In fact, in quite a few ways the new programming in Prime is much more restrictive then anything found on HP graphers to date. Basically, none of these questions are things I've even thought about or seen posted in HP centered forums. I guess I'll have to adjust my thinking some.

RAM only contains things as/when they are loaded. Program execution can be done from anywhere provided there is enough memory to run. No limits I am aware of. In fact, I honestly have no idea how large of a program you'd have to create before any sort of issues would start happening. If you run out of memory (say, by creating an 11MB lists and trying to multiply it by itself), the calculator will reboot. There is no clean low memory cleanup yet unfortunately. Not really a real problem, but bothers me from a technical perspective.

The 10 predefined grob variables are just pointers. No limit on size. Also, any variables in a program can be any type. You are not restricted to the base 10. The only unique one is G0 which is basically just the main screen pointer.

There might be some size limits leftover from the 39gII that we forgot to remove (for example, on the 39gII lists were limited to 999 or 10000 chars per note or something), but they are not intentional.

Programs consist of 3 parts. You have a header area that contains information about exported variables/programs (so the system knows how to recognize them, and number of arguments for example), a compiled bytecode area, and the source. On poweroff, the source is saved to flash if it has been modified. The bytecode is discarded. Early in the development it was kept across power cycles, but there is basically no reason to do so since the parsing/compiling is so fast you could never notice a difference as an end user.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 20, 2013, 01:43:50 pm
Ah I see. I guess it's nice that they are pointers (GROBs I mean). I was more worried about permanently bricking my calc or something by accidentlaly setting up a GROB that is slightly too large to fit and ends up overwriting very important RAM areas. That said, it's not like I would really need a 65536x1024 large GROB or something anyway. The largest I can think about is a very large Mario level made of 256x64 tiles that are 16x16 pixels each, which would take about 8 MB of RAM.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 20, 2013, 04:24:38 pm
I was just looking at the pcb and I saw some interesting labels:
SDA, SCK : A serial bus for hooking up the little orange pcb up to the main board. The connector has 6 pins, so I think it's SPI, but it could be I2C too.
UART RX, UART TX : Serial port. Not sure what that is used for in the calculator.
BUZZ100 : Can you hook up a speaker/buzzer?

That little orange pcb had a chip on it that says Novate(and then I cannot read the rest.) I think it is the touchscreen controller.
I googled a few options including Novatel which specializes in embedded wireless modules. Could anyone confirm what the text on the chip says?
Title: Re: Let's hack the HP Prime!
Post by: critor on August 20, 2013, 04:36:26 pm
Yes, we had already noticed about the BUZZ100 and the UART RX/TX.

For now we didn't investigate this.

Connecting a speaker/buzzer won't prove anything if the OS doesn't support it. If we had native code support yes - but we haven't for now.

UART RX/TX doesn't seem to be as critic as on the TI-Nspire, as the development USB tool does already let you read/write images from/to any address.
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on August 20, 2013, 04:36:42 pm
@Keoni29: Do you already know HP Prime (DVT Prototype) Hardware Details (http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=248005) ?
Title: Re: Let's hack the HP Prime!
Post by: Jim Bauwens on August 20, 2013, 04:37:43 pm
That post is written by Adriweb ;)
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on August 20, 2013, 04:39:42 pm
I was trying to reply to Keoni29 not to critor. Also, it has some replies on it that mention the buzzer+uart! ;)
Unfortunately, the thread has stopped a bit too short.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 21, 2013, 03:13:35 am
Nothing mentioned about that little orange pcb though. I would love to have a picture of it removed from the calc if possible.
Title: Re: Let's hack the HP Prime!
Post by: critor on August 21, 2013, 03:49:43 am
HP-Prime firmware available, now without any password, with OS SDK0.30 + Boot Code V13 + usbtool flasher thanks to cnCalc.org.
http://tiplanet.org/forum/viewtopic.php?f=55&t=12870&lang=en

Edit: removed the direct ROM link.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 21, 2013, 03:54:30 am
OS SDK0.30 + Boot Code V13 + flasher usbtool.

Is this really what I am thinking? O.O
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 21, 2013, 03:57:32 am
Downloading. Let's find out.... 8)
Title: Re: Let's hack the HP Prime!
Post by: critor on August 21, 2013, 03:58:16 am
As far as I know, this is not related to the will to develop an official SDK or not.
All development firmwares have a SDK prefix in the version string.

By the way, I was wondering if my link above was against the Omnimaga ROM images rules.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 21, 2013, 04:03:53 am
Well, Omni has tolerated unnoficial links to very rare TI-OSes no longer hosted on TI servers (such as OS 1.1), although I am unsure about the policies regarding direct links, since in the past, they were usually linked to indirectly (such as, for example, if a TI-Planet news that is cross-posted to Omni includes the TI-Planet one as source, but the link to the OS file info page is only included in the original news). If this is a ROM rather than an actual firmware installable via the connectivity software, then this might be another story, though. You might have to ask I guess.
Title: Re: Let's hack the HP Prime!
Post by: Eiyeron on August 21, 2013, 04:03:54 am
Yes. We don't publish ROMs links. A topic has been closed a few days ago for requesting Nspire ROM for educational use...

Quick edit: but it's for hackiiiiing.... What sould E do?
Title: Re: Let's hack the HP Prime!
Post by: critor on August 21, 2013, 04:05:30 am
So, do I remove the direct ROM link and just mention the website, for example?
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 21, 2013, 04:06:58 am
Is this a full rom or just an OS that is "pubicly" available to the beta testers?
Title: Re: Let's hack the HP Prime!
Post by: critor on August 21, 2013, 04:10:03 am
It's the OS currently available in a zip-password-protected archive file on the HP FTP.
So it was not intended to be publicly available.

Either cnCalc.org did have the pass and rebuilt a non-protected archive after extracting the files, either they've been running a brute force attack on the file since yesterday.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 21, 2013, 04:10:44 am
If the file contains a ROM or that it's unclear that it is one (or something like 68K OSes), then it might be better to remove it altogether. Besides, we don't know if HP will react worse than TI or not to any ROM/OS sharing (but again, they provide an entire emulator for free with no ROM requirement)

I'm thinking that the file was originally not password-protected (either on purpose or a mistake?) and they got it before it did.
Title: Re: Let's hack the HP Prime!
Post by: critor on August 21, 2013, 04:13:07 am
The firmware zip file which was available at the time of the leak was not password protected, but it was a different version: SDK0.26 + Boot Code V11.

Edit: I've just removed the direct link. Tell me if you change your mind. I know it's a difficult decision, especially for this topic.
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on August 21, 2013, 04:39:22 am
Nothing mentioned about that little orange pcb though. I would love to have a picture of it removed from the calc if possible.
Or a higher resolution picture of the motherboard only would also help, I'd say!

Edit: I've just removed the direct link. Tell me if you change your mind. I know it's a difficult decision, especially for this topic.
Now we get a feel on how touchy this topic might become in the short term. Maybe the Omni administration could provide some help here, before it's too late and topic becomes locked? :(

Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 21, 2013, 04:41:59 am
I extracted the ASCII and UTF-16 strings from the files in that zip.
APPDISK.DAT could not be extracted because the text extractor program crashed every time I tried. I could look at it in a data editor though and it looks like it contains the text for the UI menu's including the characters and symbol picker menu, but I am not 100% positive.

I will try to extract the data by hand or using a different tool. I briefly looked over some text and one thing I found interesting was that it mentioned SD and MMC cards.
Title: Re: Let's hack the HP Prime!
Post by: Juju on August 21, 2013, 04:43:14 am
I'll try some stuff as well, looks like APPDISK.DAT is a FAT16 image.

EDIT: It is, I mounted it with a sudo mount -o loop,offset=8192 APPSDISK.DAT appsdisk/

Notice the offset=8192.

Spoiler For Spoiler:
Code: [Select]
[[email protected] appsdisk]$ ls -lR
.:
total 6
-rwxr-xr-x 1 root root 2256 13 aoû 18:42 APPSLIST.INF
-rwxr-xr-x 1 root root   76 13 aoû 18:42 APPSLIST.MAP
-rwxr-xr-x 1 root root  986 13 aoû 18:42 APPSLIST.MD5
-rwxr-xr-x 1 root root    0 13 aoû 18:42 BESTABFS.IND
-rwxr-xr-x 1 root root   46 13 aoû 18:42 FIRSTRUN.INI
drwxr-xr-x 4 root root  512 13 aoû 18:42 programs
drwxr-xr-x 3 root root  512 13 aoû 18:42 WINDOW

./programs:
total 1
drwxr-xr-x 2 root root 512 13 aoû 18:42 misc
drwxr-xr-x 2 root root 512 13 aoû 18:42 tools

./programs/misc:
total 16246
-rwxr-xr-x 1 root root    31744 13 aoû 18:42 armfir.dat
-rwxr-xr-x 1 root root 16292832 13 aoû 18:42 armfir.elf
-rwxr-xr-x 1 root root    31744 13 aoû 18:42 armhello.dat
-rwxr-xr-x 1 root root    19456 13 aoû 18:42 diagnose.dat
-rwxr-xr-x 1 root root   259584 13 aoû 18:42 diagnose.exe

./programs/tools:
total 194
-rwxr-xr-x 1 root root  31744 13 aoû 18:42 bestafir.dat
-rwxr-xr-x 1 root root  22016 13 aoû 18:42 bestafir.exe
-rwxr-xr-x 1 root root  31744 13 aoû 18:42 hello.dat
-rwxr-xr-x 1 root root 113152 13 aoû 18:42 hello.exe

./WINDOW:
total 1
drwxr-xr-x 2 root root 512 13 aoû 18:42 SYSTEM

./WINDOW/SYSTEM:
total 587
-rwxr-xr-x 1 root root 558592 13 aoû 18:42 COREDLL.DLL
-rwxr-xr-x 1 root root   5632 13 aoû 18:42 KRNLLIB.DLL
-rwxr-xr-x 1 root root   6144 13 aoû 18:42 MD5DLL.DLL
-rwxr-xr-x 1 root root  30208 13 aoû 18:42 SDKLIB.DLL
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on August 21, 2013, 06:36:53 am
Nothing really new so far, it's just that cncalc's move makes it easier for more people to find out by themselves :)

Please put everything you can on HPWiki :)
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 21, 2013, 06:39:51 am
Well just by looking at the text we extracted we can tell there is supposed to be SD card diagnostics in the diagnostics menu, but for some reason that does not show up in critors pictures. Critor, can you update the firmware and check if the option is there? There is also supposed to be MP3 playback diagnostics, but a menu option is not present in the diagnostics.exe from what I can tell. The buzzer is mentioned in there too. Just a keyword Buzzer.

Segment from diagnostics.exe:
(...)
0000000316FC   0000004326FC      0   Buzzer
(...)
000000031980   000000432980      0   KeyBeep
(...)
000000033978   000000434978      0    :\diagnose\
000000033988   000000434988      0    :\diagnose\
000000033998   000000434998      0    :\mp3\
0000000339A0   0000004349A0      0    :\mp3\
0000000339B0   0000004349B0      0   *.mp3
0000000339B8   0000004349B8      0   Can't find MP3 files
0000000339D0   0000004349D0      0   [AUDIO VOICE TEST]
0000000339E4   0000004349E4      0   Playing(ESC Break)...
000000033A00   000000434A00      0   A:\diagnose\DgVoxChn.RVX
000000033A20   000000434A20      0   A:\diagnose\dgvoxeng.rvx
000000033A3C   000000434A3C      0   VOXWARE FILE: A:\diagnose\DgVoxChn.RVX.
000000033A64   000000434A64      0   VOXWARE FILE: A:\diagnose\DgVoxEng.RVX.
000000033A8C   000000434A8C      0   VOXWARE:
000000033AA8   000000434AA8      0   VOXWARE: I am glad to have met you.
000000033ACC   000000434ACC      0   BESTAK: I am not happy with this room.
000000033AF4   000000434AF4      0   CTTS:  
000000033B24   000000434B24      0   ETTS: I am not happy with this room.
000000033B4C   000000434B4C      0   I am not happy with this room.
000000033B6C   000000434B6C      0   MP3: Play %s
000000033B7C   000000434B7C      0   MP3: Play mp3 data - DREAM        
000000033BA0   000000434BA0      0   MP3 VOL: Play %s
000000033BB4   000000434BB4      0   MP3 VOL: %s.
000000033BC4   000000434BC4      0   [MP3 TEST]
000000033BD0   000000434BD0      0   C:\mp3\*.mp3
000000033BE0   000000434BE0      0   C:\mp3\
000000033BE8   000000434BE8      0   MP3: Play %s
000000033BF8   000000434BF8      0   C:\mp3\
000000033C00   000000434C00      0   MP3: Play %s
000000033C10   000000434C10      0   MP3: Play mp3 data - DREAM

Title: Re: Let's hack the HP Prime!
Post by: critor on August 21, 2013, 06:44:42 am
My unit was already updated to the latest firmware at that time.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 21, 2013, 06:45:07 am
I will try to find out why it does not show up.
Title: Re: Let's hack the HP Prime!
Post by: Eiyeron on August 21, 2013, 06:49:10 am
We found a lot of things, like compilation command lines in the end of a file...
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 21, 2013, 06:53:36 am
There is a lot of information and windows references in there too which leads me to thing the files are compiled before you send them over usb.
Edit: Yes you can generate and image with usb tool. It takes the data and rom files from the zip and generates an image. The problem is that the software crashes before it can write to the file, so the image is empty.
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on August 21, 2013, 07:00:46 am
The files (BXCBOOT0.BIN, BESTAARM.ROM, MASTER.DAT, APPSDISK.DAT) are sent over USB verbatim, using Mass Storage Device protocol and SCSI commands. There's also a bit of yet unidentified data. See my initial analysis from last week, at http://tiplanet.org/hpwiki/HP_Prime/Linking_Protocol :)

Juju's post #60 is a prime example (pun intended :P) of information which should end up in resources such as the HPWiki.
Title: Re: Let's hack the HP Prime!
Post by: Eiyeron on August 21, 2013, 07:12:50 am
"I am not happy with this room."... I like this sentence. It's so nonsense here!
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on August 21, 2013, 07:37:36 am
How do you run the BXCBOOT0 bootloader? Judging from the text found in BXCBOOT0.DAT the calculator checks for an SD card. Could this mean the bootloader can load an operating system from an SD card?
Title: Re: Let's hack the HP Prime!
Post by: TIfanx1999 on August 21, 2013, 08:30:17 am
The firmware zip file which was available at the time of the leak was not password protected, but it was a different version: SDK0.26 + Boot Code V11.

Edit: I've just removed the direct link. Tell me if you change your mind. I know it's a difficult decision, especially for this topic.

When in doubt PM an admin listed on <a href=http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=17>this</a> page. I think for now a link to the TI-Planet topic is okay.
Title: Re: Let's hack the HP Prime!
Post by: timwessman on August 21, 2013, 12:26:55 pm
Is this really what I am thinking? O.O

No. That is just what the ODM calls the main OS.

How do you run the BXCBOOT0 bootloader? Judging from the text found in BXCBOOT0.DAT the calculator checks for an SD card. Could this mean the bootloader can load an operating system from an SD card?

Nope. Nearly all RTOS systems are rather generic and start life provided by the chip manufacturer. They generally contain example code for anything supported from the chip. Usually it isn't complete and only does very basic things - and in many cases doesn't even work for some of the "features"- and usually requires quite a bit of modification before it does anything useful. It is extremely common to find some leftover stuff that less qualified devs just leave in place to avoid extra work needed to strip it out (because they just don't understand it...). I would be very surprised if any of that type of stuff proves useful for you.

TW



Title: Re: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 21, 2013, 01:36:27 pm
I guess it's fine as long as leftovers won't double the OS size or something. :P
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on August 21, 2013, 03:44:52 pm
I'm told (thanks for testing !) that the silly experiment of:
1) performing a simple, visible modification to \programs\misc\armfir.elf, e.g. changing the help strings for WHILE and REPEAT;
2) computing the MD5 sum of the modified armfir.elf;
3) updating the relevant line of \APPSLIST.MD5;
4) transferring the modified APPSDISK.DAT to the calculator
doesn't produce an error during transfer, but doesn't yield a change on the calculator side.

Alright, although there's a chance that I messed up, it was unlikely to be that easy anyway. However, the experiment took about half an hour, so it was not a big waste of time :)
That was far quicker than sufficient reverse-engineering of BXCBOOT0.BIN, and possibly BESTAARM.ROM as well !

The failed experiment may even provide some clues about the checksum / signature / validation process before writing a firmware image to NAND Flash memory. As APPSDISK.DAT has the same size as the SDRAM at 0x30000000, the validation process could conceivably be chunked... unless the whole code for hardware setup + interacting with the host through USB + validating the image + writing to NAND Flash runs entirely from the 64 KB SRAM at 0x40000000, but that looks a bit small to me (would be easier with 128, let alone 256, KB).

Checksums / signatures are less easy to see on the Prizm than on TI-Z80 OS & FlashApps / TI-68k OS & FlashApps / Nspire boot2 & diags & OS.
The Win CE strings show some test certificate authority stuff, no idea whether it's actually used.
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on August 22, 2013, 09:46:58 am
This is a very nice and useful experiment (and not a silly one, IMO), but i'm afraid we still need to dig a bit further into the hard part, i mean, the reverse-engineering.;)
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on August 25, 2013, 02:29:12 am
Looking at the list of recent changes on the HPWiki hosted under the tiplanet.org domain (nothing since 3 days ago :( ), I've noticed that a highly weird-looking username was registered: "BXCBOOT0_BIN_pastebin_com_SKw5xtev".

So I thought... that seems to contain an obfuscated URL, right ?
And yeah, everyone can easily see that the URL points to interesting information related to this topic - namely, partial reverse-engineering of the first 4 KB of some version of BXCBOOT0.bin :)
Clear-binary firmware upgrades are a good thing... which is why TI keeps using encrypted upgrades (which delayed, but fail to prevent, reverse-engineering), certainly.


EDIT: as far as emulating the Prime is concerned, I keep thinking that we should definitely base an emulator of ours on an existing, versatile, full-featured, GPL'ed framework, instead of reinventing a new emulator from scratch. QEMU is such a framework, and what's more:
* there is already some code for similar S3C24XX chips, even though it would need adaptations for both newer QEMU versions and the slightly different processor model;
* we have datasheets of the processor, NAND Flash memory, etc.;
* we can use the Linux support for members of the S3C24XX family, including S3C2416.
Useful links: https://dev.openwrt.org.cn/browser/feeds/device (lots of things in the subfolders), http://docs.openmoko.org/trac/browser/trunk/src/host/qemu-neo1973/hw/s3c2410.c
Needless to say, development should be performed with an aim at upstreaming quickly, just like we did for the Nspire port of Linux.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on August 25, 2013, 01:02:26 pm
One hope I have about a third-party emulator is that I hope the ones making it makes it friendly to lower end computers as much as possible.
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on August 25, 2013, 01:51:34 pm
Sure, QEMU uses dynamic translation :)

BTW, several hours after my previous message, the user page of BXCBOOT0_BIN_pastebin_com_SKw5xtev has been filled with an expanded version of the information previously on pastebin.
Title: Re: Let's hack the HP Prime!
Post by: TIfanx1999 on August 26, 2013, 01:31:14 am
EDIT: as far as emulating the Prime is concerned, I keep thinking that we should definitely base an emulator of ours on an existing, versatile, full-featured, GPL'ed framework, instead of reinventing a new emulator from scratch.

I agree. It should make things go quickly. No need to reinvent the wheel.
Title: Re: Let's hack the HP Prime!
Post by: Juju on August 27, 2013, 08:01:06 pm
Also said emulator should use the same file format as the official simulator, for convenience. I finally got around documenting it \o/

http://tiplanet.org/hpwiki/HP_Prime/Skins
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on August 31, 2013, 12:52:58 pm
A discussion with Andreas Färber on #qemu, following my posting:
Quote
Hi, as you might know, HP is in the process of releasing a new graphing calculator, dubbed "Prime", based on a S3C2416 ARM chip, but not running U-Boot + Linux. The hardware is more powerful, and the software is less closed-minded, than those of the TI-Nspire, which is based on undocumented chips.
For the purpose of making a portable community emulator for this platform, QEMU seems an obvious choice, especially since it's easy to find (very old...) forks of QEMU with support for the pretty similar S3C2410 & S3C2440 chips. Writing everything from scratch (which was done for the Nspire emulator) seems a poor way to use our free time.
I'm writing here because I'm not clear about, for instance, 1) the making of a portable UI with clickable buttons interacting with the emulation core, 2) the bootup of something based on neither U-Boot nor Linux, and 3) the creation of memory images / savestates suitable for QEMU.
I've already used QEMU for installing standard Linux distros on emulated x86, x86_64, ARM, PowerPC, Sparc and MIPS - but for those, either there's a BIOS which can consume ISO images, or the user points a Linux kernel and an ISO image, and no need for displaying a graphic, clickable keyboard.
So... could you explain me / point me to the right, up to date, information ? TIA :)
learnt me that:
* there's no official documentation for extending QEMU. Therefore, we're on our own, starting from the links I posted above (especially the Openmoko one: I checked that the MMIO addresses are nearly the same on the S3C2410 and S3C2416) and looking at other up to date forks of QEMU with additional platform support, e.g. Linaro QEMU;
* forks such as the Android QEMU have additional GUI buttons, which clears one of my worries.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 01, 2013, 01:21:24 am
What I hope is that if such emulator comes to fruition, that it can easily let us copy/paste code from programs to the computer or vice-versa, that it runs at the exact same speed as the calc (and can be speed up/slowed down to test very hard games or skip loading) and that it emulates everything perfectly.
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on September 17, 2013, 04:34:43 pm
Hey, where is everyone ? ;)

Don't forget the challenge of running Linux on the Prime ASAP, ideally before the end of the year (i.e. several months after the Prime hits the market). It's largely doable if we are collectively interested in the platform enough - especially since we have clear-binary firmware upgrades, a datasheet, Linux support for most of the devices in the chip, and also an old, sadly out of tree and unmaintained, QEMU fork for the close S3C2410 chip :)
We had none of those goodies for the Nspire series.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 17, 2013, 04:50:10 pm
I think most people who have an HP Prime are on HP Museum forums it seems. It's hard to attract HP fans on a TI forum when there is an established HP-only board around, same problem we had with Casio people. Certain people might see TI boards as the "enemy" or something.

The two problems, though, with HP Museum, is that

1) Their most active contributor hates TI-Planet, Critor and the rest of the team with a passion, and he's banned from both Omni and TI-Planet, two sites which are affiliated together. You know who I am talking about. If we try to lure HP Museum people here, I am unsure what his reaction (via public posts and private messenging) would be, and I already notice that some people such as CompSystems and Tim Wessman hardly ever post on Omni anymore for unknown reasons.

2) The HP Museum registration system is absolutely restrictive in the way that any common e-mail address such as Gmail, Hotmail, Yahoo, etc, are not allowed to register. Not everyone can get an obscure e-mail in less than 5 minutes, and most people don't want to spend more than 1 minute to register on a website anyway. Why not use Facebook connect or StopForumSpam if spam is such a problem?


As for hacking the calc itself, the issue is that on Omnimaga, there are hardly any ARM assembly programmers anymore, which is required to hack the calc, and most people who are interested in HP Prime programming wants it primarily for the BASIC language (since they find high level languages more user-friendly). There might also be some doubts about the popularity of the calc, since it just missed the school start sales by 2 months.


That said I am absolutely unsure about why the sudden drop in interest towards the HP Prime in the last month or two from the people who used to post in this thread and other ones in this section. Is it due to people being busy with school? Do they just prefer to wait until next August when the calc will meet back-to-school 2014, to ensure that the calc will be popular enough to warrant efforts to hack it? Has anything else have happened behind the scenes that could have caused our HP fanbase to migrate to HP Museum or something?


Also I notice lately that every single Youtube video that TI-Planet or Critor3000 posted got at least one downrating.
Title: Re: Let's hack the HP Prime!
Post by: critor on September 17, 2013, 05:05:21 pm
Just ask Tim Wessman and Compsystems... And explain things if necessary if you think he's been badmouthing Omnimaga to HP guys and HP-Museum users.

Too bad such a great topic did die...
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 17, 2013, 05:10:07 pm
I guess I would probably need to ask CompSystems first, since he was the first to go away. It's possible, however, that Tim has to try to avoid participating to HP hacking discussions, since he is working for HP.

In my case, don't count on me to hack the calc, as I don't do ASM/C myself. I was more busy working on game sprites, but given the way sprites are imported into programs, I would rather have them completed before starting to do anything. I also didn't have any free time where I am healthy enough to sit down for 30 minutes and try to code or learn to. I want to try to contribute via HP games, though, so maybe it gets more people interested in buying the calc then hopefully those people will want it hacked to do better stuff in the future.
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on September 17, 2013, 05:21:01 pm
Well, don't forget the fact that the "HP Prime" not having been released worldwide so far, does clearly have a negative impact on people's enthusiasm. Hacking does require a lot of testing with the real thing. So, i'd say as soon as it becomes available and we can play with the real toy, the hacking interest will certainly increase all of a sudden. So, it's also HP's fault :P. My 2 cents.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on September 17, 2013, 05:21:50 pm
As for ARM programming: Learning a new programming language is not a huge deal to me. Asm dialects are pretty easy to learn, but difficult to master.
Title: Re: Let's hack the HP Prime!
Post by: critor on September 17, 2013, 05:24:46 pm
I think most people who have an HP Prime are on HP Museum forums it seems. It's hard to attract HP fans on a TI forum when there is an established HP-only board around, same problem we had with Casio people. Certain people might see TI boards as the "enemy" or something.

Then they have some maturity problem. TI-Planet is for maths and programming, and I don't see why we should restrict ourselves to one manufacturer when things are similar with other manufacturers models.

Both Cemetech and Omnimaga also deal with non-TI calculators, especially Casio. Omnimaga was affiliated with Planete-Casio long before TI-Planet.


And we're not being nicer with TI or less nice with other calculators manufacturers.

I'll easily admit that the TI-84 Plus CSE is a bad product although it seems to have been adopted by many people (based on the ticalc.org uploads).

I don't approve the latest TI-Nspire CX hardware.

I'll also admit that the Casio Prizm fx-CG10/20 is a very good product (and I'm sad it failed to be adopted and that interest for it did apparently die).

But I'll tell you that the Casio ClassPad II fx-CP400 is currently a bad thing (only the main (calculator) application can be rotated, Basic is far slower than on the TI-81/80 from the last century, except for the home screen the rest of the OS just copies the heavy black & white GUI of older Classpad calculators with many borders and hasn't been adapted at all for the color screen...). Let's hope for an OS update although they tend to be quite rare with Casio...
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 17, 2013, 05:46:17 pm
Yeah I mean like that one debate topic there about why should there be a Wiki on TI-Planet when there is already wiki4hp that have been around for years, located at http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=249854#249854 . One person in particular wasn't fond of the idea that HP Prime info and fans go on a TI website instead of their own and only HP forum. They probably don't want any other website to budge on their thunder. That said, it might be partly due to "ti" being part of TI-Planet name, so they might have the impression that the site focuses exclusively on TI calcs. Granted, Omnimaga and Cemetech focuses less on TI calcs than TI-Planet, but TI-Planet still has plenty of Casio and HP news, along with visible links to Casio/HP stuff in navigation. All three sites have been particularly virulent towards Texas Instruments in recent years too, even more than HP.

Also Omnimaga and Cemetech forums have been around for almost a decade (and the respective groups existed for even longer). If people here got more and more interested into Casio and HP calcs, couldn't this be because TI has done an huge mistake and that people are disgruntled TI fans who decided to look for alternatives? ;)

Anyway, personally I don't see the point in trying to establish a monopoly on the entire HP programming community if certain TI/Casio website decides to expand their horizons. I know that there were certain negative remarks towards everything Omni related in Planet-Casio news a year or two ago, meaning that there were people there too who might have been upset that a TI website competes directly against a Casio one. Besides, there are younger people who might prefer modern forum interfaces to messageboards that takes you way back in 1995, or vice-versa (people who prefer less CPU/bandwidth-intensive, but simpler interfaces), along with people who find the registration process too complicated on one of the website.


But I'll tell you that the Casio ClassPad II fx-CP400 is currently a bad thing (only the main (calculator) application can be rotated, Basic is far slower than on the TI-81/80 from the last century
In CP400 defense, however, the line command is much faster than on the PRIZM (although still slower than on the 84+CSE). :P
Well, don't forget the fact that the "HP Prime" not having been released worldwide so far, does clearly have a negative impact on people's enthusiasm. Hacking does require a lot of testing with the real thing. So, i'd say as soon as it becomes available and we can play with the real toy, the hacking interest will certainly increase all of a sudden. So, it's also HP's fault :P. My 2 cents.
Yeah I agree. Only Critor and Gilles59 had the calc until recently and it was not necessarily the final release. Kerm only got his sample recently and I don't have one (although I already pre-ordered the calc anyway). The emulator is more like a simulator, so ASM programs most likely won't run on it, and BASIC game speed is innacurate on the emu. Missing the bts rush didn't help either, since most people already got their calcs by now.
Title: Re: Let's hack the HP Prime!
Post by: critor on September 17, 2013, 06:00:34 pm
Yeah I mean like that one debate topic there about why should there be a Wiki on TI-Planet when there is already wiki4hp that have been around for years, located at http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=249854#249854 . One person in particular wasn't fond of the idea that HP Prime info and fans go on a TI website instead of their own and only HP forum. They probably don't want any other website to budge on their thunder.

Yes I know and I was very shocked by this. Such behavior is immature and unproductive.
The first priority now should be to do the job - not to fight about who's going to host it...

If they prefer keeping HP stuff on a website on which registration is allmost impossible (I did spend several hours registering on it, looking for an accepted email address...), then it's too bad for HP visibility... And as a consequence, it's too bad for them.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 17, 2013, 06:18:09 pm
Ouch, I didn't realize it could take this long. I gave up after 5 minutes (when I realized that no common e-mail worked). ANyway I think it's good to have alternatives. Besides, their site seems to be mainly oriented towards educational uses of the calc, much like the TI-Nspire Google Group, while the big four TI sites focuses mainly on advanced calculator development. If you post about your next Final Fantasy game on HP Museum or Nspire Group, you will probably not get much attention and if you post about ASM exploits, there will be people who get upset at you because they find calc games pointless.
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on September 18, 2013, 01:53:45 am
Yeah, the MoHPC registration process is overly restrictive and annoying.
If it weren't for pier4r recently starting to centralize and expand information on Addloop, Savage and UltraNaivePrimes benchmarks on wiki4hp, that site would basically be as dead as it was at the time of the hpwiki / wiki4hp discussion on MoHPC. The information found on the hpwiki hosted on TI-Planet could obviously have been copied to the wiki4hp, but AFAICT from the list of recent changes, nobody even bothered doing that.

If the traditionally HP-oriented community doesn't start low-level development for the Prime soon enough, and if the traditionally TI-oriented community beats them (those are two big "if"s, but still), that'll teach the HP community. Here, we all agree that we and they should be working together on the same goal, but if we don't... first one wins.

Even without physical Prime items in the wild just yet (although it seems that they should be hitting people's hands quite soon), people can disassemble firmware, reverse-engineer file formats through the emulator, work on emulating the S3C2416 + associated hardware, and stuff like that :)
But that takes time, as usual...
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 18, 2013, 11:16:16 pm
One good thing about the HP Museum board though is that it gets plenty of people asking help for HP calcs, not only the Prime, but older models as well. THis shows that there is an actual HP community out there, contrary to what we thought in 2003-08. There only needs to be more games now, since most games on Hpcalc dates back in the 90's.

And yeah, if the HP Prime reaches a larger audience than the HP 50g (which only reached older people in class or engineers, who, in general, have no more interest in playing games, even on gaming consoles), it would at least be good if it was hacked and if there were games offered to students using it, along with math tools. I wonder if KermMartial will port his Graph 3D app to the Prime in the near future? IIRC the calc lacks 3D graphing; but Graph 3D had very decent speed results per 84+CSE BASIC standard, so imagine how fast it would be on the Prime.


That said Lionel, although the activity level towards the Prime here is kinda low since last week or so, I think there is still more interest than for Nspire development. Although ElementCoder showed interest in starting ARM assembly again soon and that a new member who programs in Lua joined today, notice how the Ndless 3.2 announcment only got one reply so far >.<. If the Prime really takes off, TI will have a lot of work to do to regain trust towards Nspire users.
Title: Re: Let's hack the HP Prime!
Post by: chickendude on September 19, 2013, 05:21:44 am
I'm just waiting to get my hands on one. Finding a way to run machine code is quite a bit over my head, but once we get there i'll be more active :)
Title: Re: Let's hack the HP Prime!
Post by: TIfanx1999 on September 19, 2013, 08:14:57 am
This is silly. We should all be working together towards a common goal; making the calculators we all know and love an open platform for development. Why should anyone care if we or any of the other sites started as TI fansites? We all want the same thing. The truth is that over time, the TI community has largely expanded. These days were are a more broad "Graphing calculator hobbyist community" instead.

Back on topic, I'd love to help with making the Prime an open format, but I have no experience in this area, and no idea where to start. I will however be placing my preorder for one shortly. :)

*edit* Just checked out their forums, To say the least, they are really dated. I can't even register unfortunately. I only have hotmail. I don't have access to a non-free email account. Their alternative is a bit ridiculous unfortunately. :/
Quote from: The Museum of HP Calculators
If you're sure you don't have a "normal" email account, or if you use an ISP that has the unfortunate tendency to provide both free and paid addresses, then please click here to register by postal mail.
They could at least have an email link to contact administration so you could be added manually.

I'm not sure how they plan to host a wiki there when many people who might be interested won't even be able to access their forums. :/
Title: Re: Let's hack the HP Prime!
Post by: Adriweb on September 19, 2013, 09:24:07 am
*edit* Just checked out their forums, To say the least, they are really dated. I can't even register unfortunately. I only have hotmail. I don't have access to a non-free email account. Their alternative is a bit ridiculous unfortunately. :/
Quote from: The Museum of HP Calculators
If you're sure you don't have a "normal" email account, or if you use an ISP that has the unfortunate tendency to provide both free and paid addresses, then please click here to register by postal mail.
They could at least have an email link to contact administration so you could be added manually.

I'm not sure how that plan to host a wiki there when many people who might be interested won't even be able to access their forums. :/
Yeah it's pretty ridiculous.


Anyway, for reverse-engineering the List file format (http://tiplanet.org/hpwiki/HP_Prime/File_Format), what I only did is create several list files (and editing them as I was exploring things) and compare with an hex editor. In the end it was quite easy.

Other file types could be done like that.

Although that's no OS rev-eng, it's still a start :)
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on September 19, 2013, 01:10:31 pm
Yeah, reverse-engineering file formats and (a bit more advanced) linking protocols are one of the ways people can help without knowledge of ARM assembly.

Communication with the Prime is easier than communication with all TI graphing calculators and the SilverLink: thanks to the (ab)use of the standard HID class, no additional driver is required. For Windows users interested in using both official software and the hopefully lighterweight third-party software, the Prime shall not suffer from the massive user unfriendliness that manual installation of the filter driver, required for working around a limitation of Windows, is...
Title: Re: Let's hack the HP Prime!
Post by: timwessman on September 19, 2013, 02:56:33 pm
Tim Wessman hardly ever post on Omni anymore for unknown reasons.

Just nothing to say really. I would assume that fact that the calcs were not available and in people's greedy little palms was the reason for lack of interest.

Tim has to try to avoid participating to HP hacking discussions, since he is working for HP.

Bingo.

I think most people who have an HP Prime are on HP Museum forums it seems. It's hard to attract HP fans on a TI forum when there is an established HP-only board around, same problem we had with Casio people. Certain people might see TI boards as the "enemy" or something.

Then they have some maturity problem.

On the contrary, the average age of the posters at hpmuseum is probably up in the ~50 year range or higher.  ;D Games, hacking, quotes at the bottom of posts, animated avatars, etc just is not much interest to a large chucnk of people in that range. Seeing such just makes them think "kids, get off my lawn"... :-P

I am certain a large majority see someone posting "cute" little simple programs that don't really do much doesn't interest a majority of the readers/posters. Also note that that group is more about the OLD calculators, the historical interest items and less about modern units (hence the name "hp museum". They don't even really talk much about anything newer.

Then again, there are a large numbers of others there that are interested in such but just don't have anything to contribute in their opinions. Every time someone has posted a "this is the HP museum forum, don't waste my time with Prime" type message, they have been inundated with others telling them to shut up and that, yes, there is interest.


Also, you need to remember that a LARGE chunk of people who are regulars at the hpmuseum forum are WAY beyond talking about "hacking" software. They have long ago moved into the "create calculators from scratch" phase.

Were you aware of the wp34s which is a complete from scratch calculator based on a repurposed HP-20/30b? http://commerce.hpcalc.org/34s.php (http://commerce.hpcalc.org/34s.php) Or how about the user that created a USB connection for said calculator complete with rechargeable li-ion battery that mounts inside the unit? Or the user who created from scratch a brand new replacement board for the HP-41, including every flash module ever sold for it, extensions to the built in system, full compatibility with all HP-IL modules, and so on... http://systemyde.com/hp41/index.html (http://systemyde.com/hp41/index.html)?

Then you have the team that recreated a mini HP11,12,15,16C calculators and sells them? http://www.swissmicros.com/ (http://www.swissmicros.com/) The team that is making a complete from scratch hardware calculator to rival anything HP or TI ever made (of the classical style)?

To many folks like this, hacking software to make games, or even just programming on modern units isn't all that exciting.

I do think the people that complained about the wiki were a bit silly. However, easiest way to show them wrong is to simply make it better. Everyone will know which is the real resource...

thanks to the (ab)use of the standard HID class, no additional driver is required.

Abuse? In what way?
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on September 19, 2013, 03:39:46 pm
Quote
I am certain a large majority see someone posting "cute" little simple programs that don't really do much doesn't interest a majority of the readers/posters.
Indeed.
FYI, that "someone" is desperate about garnering attention. He made himself the worst outcast in the TI community (and consequently an outcast in parts of the Casio and HP communities), multiple times at years apart, through severely inappropriate behaviour ranging from spamming to threats, through insults and whatnot...

Quote
Were you aware of the wp34s which is a complete from scratch calculator based on a repurposed HP-20/30b? http://commerce.hpcalc.org/34s.php Or how about the user that created a USB connection for said calculator complete with rechargeable li-ion battery that mounts inside the unit? Or the user who created from scratch a brand new replacement board for the HP-41, including every flash module ever sold for it, extensions to the built in system, full compatibility with all HP-IL modules, and so on... http://systemyde.com/hp41/index.html?

Then you have the team that recreated a mini HP11,12,15,16C calculators and sells them? http://www.swissmicros.com/ The team that is making a complete from scratch hardware calculator to rival anything HP or TI ever made (of the classical style)?
I knew about the link between WP34S and 30, but not about most of the other, pretty interesting, items that you're mentioning :)
My father has had a 41C for so many years, and has made a number of programs for his own use over time. We still use the 41C, though not the programs.

Quote
To many folks like this, hacking software to make games, or even just programming on modern units isn't all that exciting.
Easily understood :)
Games would clearly be the main use of native code, as usual, even with a port of Linux + userspace to the Prime. It has to do with the fact that making native code games is always much easier - and funnier anyhow - than making native code math programs with CAS integration, because games only need to access the screen, the keyboard and optionally some files, while math programs need to consume and produce data in (often) undocumented formats through (often) undocumented APIs...
The Prime's CAS format is probably among the exceptions, as being based on giac/xcas, it's unlikely to be completely undocumented. The ease of making native code math programs on the Prime could therefore well be closer to that of the TI-68k/AMS series than to that of the Nspire series, which is a good thing :)
At the end of the 1990s, TI was in their right mind and used to provide a bunch of official documentation for TI-68k/AMS, which third parties like me expanded. As for the Nspire, while I showed that the Nspire's CAS hasn't evolved much from the TI-68k's CAS, we never got really far, even with native code Lua extensions...

Quote
Quote
thanks to the (ab)use of the standard HID class, no additional driver is required.
Abuse? In what way?
Not sure until the protocol has been analyzed :)
But I know it's common for people to use the HID protocol to transmit non-keyboard/mouse/joystick data to other devices. Among hundreds of examples, in the TI community, one of the globalCALCnet bridges ( http://www.cemetech.net/projects/item.php?id=35 ) does it, for instance.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 19, 2013, 05:13:44 pm
@Tim I think the TI Planet HP wiki should definitively focus on the HP Prime for the time being, since that's the calc people here are the most interested in. Also yeah about the HP enthusiasts on HP Museum, I think the average HP user is older due to the main demographic target for the HP 48 and such calcs. Also, a lot of those people are hardcore RPN fans, so they might tend to not like newer calcs due to that. I remember nasty complaints on Youtube about the 39gII because it lacked RPN and SysRPL. Of course the HP Prime supports RPN in some ways, though, so that can help.

Also nice to see that people recreated calcs from scratch O.O. Over here I know that there was a Project Paradise (later renamed to Ubercalc) and OTcalc projects, but sadly they never got much further than planning stages. D:
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on September 21, 2013, 09:51:55 am
I now have a Prime in my hands. I want to try installing the SDK, but I'm afraid I'm going to brick my calculator; I don't konw if I could fix that as connecting to ftp.hp.com in the data-link program seems to not be retrieving the OS for me. Should I go ahead and see what the SDK firmware does on a calculator?
Title: Re: Let's hack the HP Prime!
Post by: critor on September 21, 2013, 09:58:22 am
Which boot+firmware versions did it come with?
Just launch the diagnostics software to find out: hold F C O keys while pressing and releasing the reset button on the back.

(http://tiplanet.org/forum/gallery/image.php?mode=medium&album_id=194&image_id=2841) (http://tiplanet.org/forum/gallery/image_page.php?image_id=2841)
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on September 21, 2013, 10:25:05 am
Here's just a raw dump of my Prime's data:

DATA: V0.025.5106    OS(1M):V0.025.5106
ADPT IN    :    BOOT ARMUboot V13
Samsung K9K2G08U0M    256 MB    SLC

So I see you've got the SDK version working! Have you found any differences in function yet?

EDIT: The HHC2013 is going on as we speak. I'm hoping some of our questions about native execution and the like will be answered there...

EDIT 2: I've been messing around with the file formats. The first byte of the custom app's .hpapp files seem to indicate what app it's copying.
Title: Re: Re: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 21, 2013, 12:10:12 pm
Here's just a raw dump of my Prime's data:

DATA: V0.025.5106    OS(1M):V0.025.5106
ADPT IN    :    BOOT ARMUboot V13
Samsung K9K2G08U0M    256 MB    SLC

So I see you've got the SDK version working! Have you found any differences in function yet?

EDIT: The HHC2013 is going on as we speak. I'm hoping some of our questions about native execution and the like will be answered there...

EDIT 2: I've been messing around with the file formats. The first byte of the custom app's .hpapp files seem to indicate what app it's copying.
heya and welcome to the forums. :) Nice to see that HHC2013 is happening by the way. IIRC there were worries about a cancellation due to the recent Colorado floods.

Also is the calc really sold with OS 0.025.5106? A version number under 1.0.0 often means it's a beta... ???
Title: Re: Let's hack the HP Prime!
Post by: critor on September 21, 2013, 12:12:11 pm
Where do we usually download released firmwares for HP calculators ?
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on September 21, 2013, 12:19:48 pm
heya and welcome to the forums. :) Nice to see that HHC2013 is happening by the way. IIRC there were worries about a cancellation due to the recent Colorado floods.

Also is the calc really sold with OS 0.025.5106? A version number under 1.0.0 often means it's a beta... ???

You know, it does kinda feel like a beta. The documentation isn't very good, some features feel incomplete, you know, the lot. It really feels that they rushed to ship this out. And yet they're still late...

Anyways, these hard-coded app numbers (it seems that the .hpapp files only store data, not code) makes it seem to me like they never coded for third-party apps to exist... I'm probably wrong here; maybe there's an app ID for custom apps. calc.settings seems to hold the pointers themselves, so there's hope.

EDIT: Here's the list of app IDs. Any ID over 11 causes it to revert to 0 when the calculator is turned on. This should go on the wiki?

00 00 00 00 - Function
01 00 00 00 - Solve
02 00 00 00 - Statistics 1-Var
03 00 00 00 - Statistics 2-Var
04 00 00 00 - Inference
05 00 00 00 - Parametric
06 00 00 00 - Polar
07 00 00 00 - Sequence
08 00 00 00 - Finance
09 00 00 00 - Linear Solver
0a 00 00 00 - Triangle Solver
0b 00 00 00 - Linear Explorer
0c 00 00 00 - Quadratic Explorer
0d 00 00 00 - Trig Explorer
0e 00 00 00 - DataStreamer
0f 00 00 00 - Geometry
10 00 00 00 - Spreadsheet
11 00 00 00 - Advanced Graphing

Where do we usually download released firmwares for HP calculators ?
Usually, I'd say somewhere like http://h20000.www2.hp.com/bizsupport/TechSupport/ProductList.jsp?lang=en&cc=us&prodTypeId=215348&prodSeriesId=5367459&taskId=135 (http://h20000.www2.hp.com/bizsupport/TechSupport/ProductList.jsp?lang=en&cc=us&prodTypeId=215348&prodSeriesId=5367459&taskId=135), but it seems both the emulator and the data-link program have firmware-downloading capabilities; however, it seems HP's data server are not working.

Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on September 21, 2013, 01:57:41 pm
Yup, it would be great to have this kind of information on the wiki :)
Title: Re: Let's hack the HP Prime!
Post by: Adriweb on September 21, 2013, 02:56:12 pm
Yes, right here : http://tiplanet.org/hpwiki/HP_Prime/File_Format :)
I've restructured the page a little for clarification, btw.

(Also, I've enabled the "ConfirmAccount" extension on the wiki, which requires admins to validate new accounts before they can login; You can thank spammers for that.... :x)
Registration url : http://tiplanet.org/hpwiki/Special:RequestAccount
Title: Re: Let's hack the HP Prime!
Post by: timwessman on September 21, 2013, 05:45:31 pm
Quote
Also is the calc really sold with OS 0.025.5106? A version number under 1.0.0 often means it's a beta... ???

Nope. That is a common convention, but really has nothing to do with the state of things. That whole menu is for factory use and they control numbers and versions there. I honestly have no idea what they really are using there or what it is supposed to mean. I suspect it has something to do with bootloader stuff.

some features feel incomplete

Examples please?
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on September 21, 2013, 06:34:24 pm
Nope. That is a common convention, but really has nothing to do with the state of things...

Oh, that's good to know! Look at me here, always assuming the worst.

Examples please?

Eh, it's just a sort of an impression. Really, I'd be writing more about suggestions I have than things that are really missing. But, you did ask, so here goes:
* The app structure doesn't really have an HP calculator feel. Maybe if there was app 'folders' and/or an ability to hide apps?
* The "online" Help has a lot of typos, not to mention the accidental HP38gII syntax.
* Like the first point, there's no good way to organise your variables.
* There's no calculator-to-calculator linking. Even if the physical manual tries to claim there is ("Documentation which mentions sending data directly from one HP Prime to another should be disregarded" the sheet of paper that came with my Quick Start Guide says).
* All the undocumented CAS shortcut functions, described here (http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=250574#250574). Some of them can cause crashes!
* Some basic apps we'd like are not here, like 3D graphing or periodic tables. No extra utility apps either.

All in all, it's a fine release, sure. But it just feels that much more limited than the HP calculators I'm used to (I mean heck, my 50g came with a built-in ARM assembler!). My hypothesis is that HP is just playing nice in the software until they get College Board approval, at which point I hope they'll add in more freedom to the OS. Of course, the College Board won't be easily convinced, so this could take a while to happen.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 21, 2013, 06:41:23 pm
Also, Sailerboy on IRC last night has complained about cryptic error messages when using some math equations and stuff on the main screen. Sadly the logs appears to be offline though so it would be hard to retrieve the screenshots he did. Nonetheless, they were definitively cryptic or even non-existent.


Also Iconmaster I think they decided to cut down ASM features because of concerns about cheating tools like PTTKiller on TI calcs. However the door is supposedly not fully closed. I just hope that people who hack the calc use common sense and restrict their use of ASM/C for games and legit tools if it ever becomes possible on this calc. Staff will most likely delete any cheating program from the forums anyway, like with PTTKiller. Also, I think the higher focus on algebraic view or whatever it is called, rather than RPN, was to make the calcs easier to use for more people, so that people won't get a TI instead.

Quote
Also is the calc really sold with OS 0.025.5106? A version number under 1.0.0 often means it's a beta... ???

Nope. That is a common convention, but really has nothing to do with the state of things. That whole menu is for factory use and they control numbers and versions there. I honestly have no idea what they really are using there or what it is supposed to mean. I suspect it has something to do with bootloader stuff.
Ah I see Tim, I worried that the OS was still in beta lol, but if that was the case, I would have been surprised at how stable it is per beta standards (at least, from what I saw in the emu). I hope it's quite stable for myself in its final form too :P.   
Title: Re: Let's hack the HP Prime!
Post by: critor on September 21, 2013, 06:46:43 pm
some features feel incomplete

Examples please?

For exemple, I've found a limitation with the sequence application.
By default it starts sequences with rank 1, but it doesn't let you set the sarting rank to 0.
(http://i.imgur.com/orvuSEv.png)

This is a big problem for France, as the sequences are a very important topic in high school, and we define them as starting at rank 0 - and so start many sequences in problems.

Other calculator manufacturers (TI & Casio) set the default starting rank to 1, but let the user enter 0.



And now what seems to be a bug of the sequence application - I don't know if it's called like that in english, but it seems you can't define cross-sequences:
(http://i.imgur.com/WrfPUFA.png)

U1 sequence is disabled and unusable.
I suppose the app checks and sets the sequences sequentially - so U1 is checked first but rejected as it depends upon U2 which is not defined at that time.


The same problems seem to be present with the HP-39gII sequence app. (I don't have the calculator - I could only test with the emulator)


I've reported both problems to HP-France, but I don't know if they did translate and forward them.
Title: Re: Let's hack the HP Prime!
Post by: sailerboy on September 21, 2013, 07:00:31 pm
Quote
Also is the calc really sold with OS 0.025.5106? A version number under 1.0.0 often means it's a beta... ???

Nope. That is a common convention, but really has nothing to do with the state of things. That whole menu is for factory use and they control numbers and versions there. I honestly have no idea what they really are using there or what it is supposed to mean. I suspect it has something to do with bootloader stuff.

some features feel incomplete

Examples please?

I'd like to add onto the incompleteness.

This certainly feels like a beta. There are certain things from a UX standpoint that don't seem to work as expected. I've screen-capped a couple of them using the connectivity software:

After trying to type the following integral in, I got the weirdest, most undescriptive error that I've ever seen on a calculator. Trying to copy/paste yielded the same result, yet retyping the function gave the correct result.
(http://i.imgur.com/f7WpvUt.png)

Trying to find the integral of any trig function (as far as I can tell, only tested it with sin/cos) yields the following message on the screen. I understand that the calculator uses taylor series to approximate an integral, but that message doesn't give me any useful information as a user, and since it requires user interaction to dismiss (it doesn't go away automatically), it is very annoying.
(http://i.imgur.com/IwyRrV4.png)

In the below picture, both the function on the top and the bottom are equivalent, but the Prime refuses to evaluate the top symbolically.
(http://i.imgur.com/qwPKctE.png)

Implicit multiplication seems to work randomly. 13x seems to work, but 13sin(x) throws yet another, even less descriptive error.
(http://i.imgur.com/mzeMZOF.png)

Other implicite multiplications that seem to not work as expected are π(10) (This returns a bad argument value error, which seems to suggest that it's intended for the Prime Counting Function, but that doesn't work as expected either.). Various other implicit multiplications either error, or do not work as expected. In the same picture, prettyprint (textbook notation?) doesn't seem to work for e. instead of typing something like e^x (or even the nicer ex), it does exp(x)
(http://i.imgur.com/q7fS485.png)


I love the prime, and the graphing is very fast, but these are glaring errors that really take me out of the entire experience. Also, if I wanted to enclose a part of an expression in parenthesis, i have to follow these steps:

Navigate to beginning of part I want enclosed
Push () button
Push right dpad
Push backspace
Navigate to end of part I want enclosed
Push () button
Push backspace

With the Nspire, these were the steps:
Highlight part I want enclosed
Push ( or ) button

OR

Navigate to beginning of part I want enclosed
Push ( button
Navigate to end
Push ) button

Finally, if I make an error in my input (forget the dx for the integral, forget to square something properly, etc), the calculator doesn't allow me to fix it, it reformats the function in some random way, and then throws up an error.

I'm trying really hard not to compare this to my Nspire from a UX point of view, since I recognize the need to differentiate from one's competitors, and a direct copy would be boring, but when these UX decisions affect the usability of the calculator, it gets annoying.
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on September 21, 2013, 07:12:06 pm
While the fire for random suggestions are hot, here's another one. I know how you've been dealing with text highlighting since the beginning of time: Using the Mark system. Myself, I'd think one could implement a text-highlighting system closer to the TI-89's, using the Alpha key or similar... It'd make text highlighting a lot more natural.
Also, there's no way to select the item on drop-down input boxes without touching the screen. I'd think you could hit ENTER to open up the dropdown, but no.
Title: Re: Let's hack the HP Prime!
Post by: sailerboy on September 21, 2013, 07:14:26 pm
Also, there's no way to select the item on drop-down input boxes without touching the screen. I'd think you could hit ENTER to open up the dropdown, but no.


You can use plus and minus to go between options in drop down boxes, but this is definitely not a great solution.

Also, what is the user function supposed to be used for? I tried looking in the manual and couldn't find anything. It's under shift+help.
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on September 21, 2013, 07:37:41 pm
Also, what is the user function supposed to be used for? I tried looking in the manual and couldn't find anything. It's under shift+help.

It redefines keys. You make programs with the KEY function instead of the EXPORT function, and the function's name is K_ and then the key's name (numbers are themselves, but more complex key names use This Case). You then press User and then the key you redefined to execute the program. I know; at first, I was used to the 50g notion of adding functions to a userkey list and thus thought the key was useless; as it turns out, there's a different method for userkeys on the Prime.
Title: Re: Let's hack the HP Prime!
Post by: sailerboy on September 21, 2013, 07:53:07 pm
Also, what is the user function supposed to be used for? I tried looking in the manual and couldn't find anything. It's under shift+help.

It redefines keys. You make programs with the KEY function instead of the EXPORT function, and the function's name is K_ and then the key's name (numbers are themselves, but more complex key names use This Case). You then press User and then the key you redefined to execute the program. I know; at first, I was used to the 50g notion of adding functions to a userkey list and thus thought the key was useless; as it turns out, there's a different method for userkeys on the Prime.

Is this comparable to anything that TI has?
Title: Re: Let's hack the HP Prime!
Post by: willrandship on September 21, 2013, 07:54:34 pm
Well, the TI-86 had a custom menu, which you could set to use any string you liked for its outputs.

I mostly used it to shortcut math things that took a while to get to.
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on September 21, 2013, 08:09:33 pm
Is this comparable to anything that TI has?

It's kinda like the TI-89's kbdprgm keys, but better. With my 50g, I usually had USR-LOCK on at all times.
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on September 22, 2013, 02:00:29 am
Yeah, HP calculators have long had keyboard customization possibilities that the 86 and TI-68k series' custom mode doesn't match. The HP-41C already had that user mode, but I don't know whether it was the first HP calculator to provide this feature.
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on September 22, 2013, 10:07:09 am
Here's a good example of the oddities of the CAS. Let's try using the @ sign in an expression. Nothing in the documentation says anything about the @ sign in an expression, so it'll be a syntax error if we use it, right?

(http://i.imgur.com/QQeS5D2.png)

(http://i.imgur.com/rGKnRl3.png)

...Wrong. It instead gives us double_deux_points, which is something I've never heard of, and the Catalog hasn't, either.

(http://i.imgur.com/i32U6cc.png)

Copying this mysterious input does not help resolve questions. It's just another undocumented CAS convention. Re-inputting the same exact output gives us just 5, but copying the 'just' 5 gives us at::5 again. Will the wonders never cease?

EDIT: A deux point is French for a colon? Well, that's nice and literal.

EDIT 2: I installed the SDK OS. Well, one difference is this:
(http://i.imgur.com/jhpyT0E.png)

EDIT 3: I cannot seem to reproduce the above behavior, so it might not be an SDK thing. Just a bug thing. Also, it seems that ON+Help seems to do something, but I can't tell what. Anyone else with a non-SDK Os, does ON+Help not give you the Help screen like it should if ON+Help didn't do anything?

EDIT 4: Okay, on another note, I extracted all the known localized strings using the STRINGFROMID function. I thought there might be some secrets or whatnot in there. It's available here (http://pastebin.com/FRZUqsmG). Some entries in this list implies that the HP Connectivity Kit program exists inside the calculator, oddly enough.
Title: Re: Let's hack the HP Prime!
Post by: timwessman on September 22, 2013, 03:19:38 pm
I've reported both problems to HP-France, but I don't know if they did translate and forward them.

Definitely never made it to me...


As a general comment here, thanks for the details on things. As I suspected, the vast majority of the comments revolve around the CAS. I always monitor and collect issues/comments and get that into our systems to make sure they are addressed in some fashion.

When you find a spelling/grammatical issue with the built in help, please email me and I'll be sure it gets resolved in the next revision. Remember, there is 5MB(!) of compressed built in help on the system. Thus there is lots of chances to miss things. Any help here is greatly appreciated. If you've never had to proofread a large collection of information multiple times, it is nearly impossible to understand how the brain fills in and filters things to make them "right" in your brain. :-)
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on September 22, 2013, 03:25:13 pm
As a general comment here, thanks for the details on things.

Glad to help! Being an avid HP user, I'd be glad any day to help make the OS better.

When you find a spelling/grammatical issue with the built in help, please email me and I'll be sure it gets resolved in the next revision.

Oh, I've come across multiple minor Help issues; I'll be certain to forward a list to you soon.
Title: Re: Let's hack the HP Prime!
Post by: timwessman on September 22, 2013, 03:30:53 pm
Quote
After trying to type the following integral in, I got the weirdest, most undescriptive error that I've ever seen on a calculator. Trying to copy/paste yielded the same result, yet retyping the function gave the correct result.
(http://i.imgur.com/f7WpvUt.png)

Just a note on this one, it is a result of the "d(x)" having the integral included inside the variable declaration like d(x+int...). Definitely a problem with not showing the user clearly that you are still inside the variable declaration there.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 23, 2013, 01:20:16 am
I've reported both problems to HP-France, but I don't know if they did translate and forward them.

Definitely never made it to me...
Which is not surprising, IMHO. Big corporate companies tend to do that a lot. Blame bureaucracy for most of those occurences. Hence why everyone nicknames TI-Cares support service as TI-Doesnt-Care. The best that can happen is if one TI/Casio/HP employee who is involved in programming the calculator OS is active on forums where the product he worked on is popular, which is the case right now. Otherwise, there is usually some sort of person who filters e-mails and might just delete anything that is slightly negative or just not bother about sending the info to the appropriate team, which is made even worse if it's transmitted from HP France to another HP headquarter or vice-versa.

By the way, a Bug reports thread has been made here: http://ourl.ca/19642/361648;topicseen#new
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on September 24, 2013, 11:37:14 am
Welcome to Omnimaga Iconmaster!
You know, it does kinda feel like a beta. The documentation isn't very good, some features feel incomplete, you know, the lot. It really feels that they rushed to ship this out. And yet they're still late...
Thank you for all your feedback this far, it will certainly be much appreciated by all future Prime users. I think, however, that most of these recent posts hardly have anything todo with the real hacking stuff. :-\

By the way, a Bug reports thread has been made here: http://ourl.ca/19642/361648;topicseen#new
Well done!
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 24, 2013, 02:29:57 pm
Yeah this is why Sailerboy created a new topic just for bugs and feature requests (mostly bug reports, actually).

But yeah it does feel like a beta at times, because there are reports that the calculator package sold in stores comes with an outdated version of the emulator and no documentation (although it's available on-calc). This can make it a bit hard for people who are not used to help being built-in the calc, who will end up searching for hours for the guidebook. X.x
Title: Re: Let's hack the HP Prime!
Post by: Adriweb on September 26, 2013, 07:27:22 pm
I don't know if this is exploitable, but there seems to be some reproducible steps to corrput the memory :
http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=251395#251395

Quote
Sorry to make so many threads, but I think this one deserves its own thread. This was partially mentioned in the EDITMAT thread.

You can get likely your calculator to hard crash and corrupt its memory in the following manner:

1. Create a new app and within the app have new bindings for the default views such as Plot, PlotSetup, etc. Your app should presumably creates new global variables.

2. Run the app and make sure everything is working.

3. Open the program editor with your app currently running. Simply open the source code to your app and close it.

4. Now, press a key corresponding to what your app overrides. For example, if your app has a new Plot() function, press plot.

At this point there is a good chance that your calculator resets, and possibly corrupts memory.

You can use my Graph 3D app, which I have slightly updated in a different thread. Here are the exact steps:

1. Follow the steps on how to install the app. Click here for the source. (http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=251367)

2. Run the app and plot 1/390*(X^3*Y-X*Y^3) using the default window settings. After you see a graph, press [Num] to see a table of Z-values. (This is just to simulate having done stuff on the app.)

3. Now, with Graph 3D as the current app, go to the program editor (press [SHIFT][1]) and open the source to the Graph 3D app. Simply open and then close it with [ESC]. I have sometimes experienced a warmstart at this point.

4. Immediately try to plot using the [Plot] button and the calc will hang and eventually warmstart. Or try pressing [Num]. If it doesn't hang try turning it off... and then if can look at the matrices via [SHIFT][4]. M0 is a copy of Zvals, and I often get a huge matrix that is less than 1 kB in size!

What I think is happening:

After exiting the program editor, the calc tries to compile the source into an executable. The problem, however, is that when it's the currently running app, then function pointers are probably slightly changed and what was once a valid pointer is possibly no longer valid.

Current workaround:

Any time you close the program editor (after editing the currently running app), restart the app (exit to a different app and start your app again).

Here is a screenshot of the bug report, just in case : http://i.imgur.com/UVWwRCG.png
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 26, 2013, 11:40:52 pm
Interesting. I hope that this bug can't brick our calcs, tho x.x
Title: Re: Let's hack the HP Prime!
Post by: Adriweb on September 27, 2013, 11:55:28 am
Reflashing an OS would probably fix the OS and/or the filesystem.
Title: Re: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on September 27, 2013, 12:26:06 pm
The problem though is if HP decides to never fix some bugs preventing programs from running, then some of our programs might only run on unnoficial OSes, which students might not necessarily have installed.
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on September 28, 2013, 09:17:23 am
I don't know if this is exploitable, but there seems to be some reproducible steps to corrput the memory :

This could be really good, if it didn't overwrite the part of memory we'd use to insert data into when it inevitably crashes. It's take an extremely in-depth knowledge about what memory location goes where, but I guess putting arbitrary data that might or might not be possible.
Title: Re: Let's hack the HP Prime!
Post by: Lionel Debroux on October 29, 2013, 03:12:24 am
For information, I pointed to this topic on MoHPC, and Tim Wessman indicated that the calculator is not running Windows CE.
Title: Re: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on October 29, 2013, 11:25:51 am
To be honest, I never thought it did either. The Prime OS is entirely based on the HP 39gII OS, except less buggy, with larger screen and color support, the addition of a CAS and to a certain extent, RPN. The 39gII OS was written from scratch.
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on October 29, 2013, 11:31:26 am
the calculator is not running Windows CE.
The world is saved. :D
Title: Re: Let's hack the HP Prime!
Post by: timwessman on October 29, 2013, 12:55:12 pm
Does anyone have any clue where that idea came from? I've been unable to track it down myself after some time looking.
Title: Re: Let's hack the HP Prime!
Post by: Jim Bauwens on October 29, 2013, 01:01:40 pm
Well, the OS did contain several strings that pointed towards that direction, plus the fact that appdisk contained EXE+DLL files.
Logs: http://chat.eeems.ca:9003/?server=irc.omnimaga.org%206667&channel=omnimaga&date=Wed%20Aug%2021%202013#1377090330611

Edit: and http://ourl.ca/19423/358393
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on October 29, 2013, 01:02:00 pm
Just out of curiosity : are you using a base RTOS or is the software written from scratch ?
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on October 29, 2013, 01:50:13 pm
Just out of curiosity : are you using a base RTOS or is the software written from scratch ?
Well, almost nothing is written from scratch nowadays even when they claim so. ;)
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on October 29, 2013, 01:59:02 pm
Linux is./me runs
Title: Re: Let's hack the HP Prime!
Post by: willrandship on October 29, 2013, 02:00:01 pm
Well, can you call it from scratch when it's not written in machine code? He uses the C libraries quite heavily, and he didn't write them.
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on October 29, 2013, 02:03:05 pm
Well, this says otherwise :
Quote
The kernel is written using GNU C and the GNU toolchain.  While it
adheres to the ISO C89 standard, it uses a number of extensions that are
not featured in the standard.  The kernel is a freestanding C
environment, with no reliance on the standard C library, so some
portions of the C standard are not supported.  Arbitrary long long
divisions and floating point are not allowed.  It can sometimes be
difficult to understand the assumptions the kernel has on the toolchain
and the extensions that it uses, and unfortunately there is no
definitive reference for them.  Please check the gcc info pages (`info
gcc`) for some information on them.
Source : https://github.com/torvalds/linux/blob/master/Documentation/HOWTO
Title: Re: Let's hack the HP Prime!
Post by: willrandship on October 29, 2013, 02:05:49 pm
Good point.
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on October 29, 2013, 02:13:21 pm
Well, this says otherwise : ...
Well, before Linux there was MINIX: http://en.wikipedia.org/wiki/Minix
"MINIX is a Unix-like computer operating system based on a microkernel architecture created by Andrew S. Tanenbaum for educational purposes; MINIX also inspired the creation of the Linux kernel."

But that was before you were born, oh well. :P
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on October 29, 2013, 02:14:02 pm
Does anyone have any clue where that idea came from? I've been unable to track it down myself after some time looking.
Yeah I was wondering that too. I didn't hear about the possibility of it using Windows CE until today.
Title: Re: Let's hack the HP Prime!
Post by: willrandship on October 29, 2013, 02:14:21 pm
Linux was not based on MINIX's code. I have heard of it.
Title: Re: Let's hack the HP Prime!
Post by: Ryleh on October 29, 2013, 02:25:32 pm
As far as hardware is concerned, does anyone know if the topmost layer of the screen is removable/replaceable or is it attached to the screen/digitizer itself?
Title: Re: Let's hack the HP Prime!
Post by: Juju on October 29, 2013, 04:00:27 pm
Linux was not based on MINIX's code. I have heard of it.
The Linux kernel has indeed been written from scratch, based on theories learnt from Minix.
Title: Re: Let's hack the HP Prime!
Post by: quitte on November 18, 2013, 10:17:49 am
Since the home variables keep getting in my way I'm very much interested in modifying the firmware to get rid of them or rename them to something like chinese characters.

I took a look at the strings of the firmware files myself, and gave the usb tool a try.

It looks like the bootloader is a general purpose one that is capable of booting both PE and ELF format binaries from at least yaffs2 and fat filesystems. It seems to have support for the lcd, usb and serial.
I wouldn't be surprised if it provided an interface via the uart - but am not going to try myself since I need to resolve a minor hardware defecrt with hp first.

The programs in the filesystem are statically linked. So what could the dlls be for? I can thinik of two possibilities: 1. The PPL compiler/linker needs them to create binaries. 2. They have just been forgotten and they can be used with appropriate headers to link our own programs for the prime's OS

I wonder what would happen if they went missing.


The firstboot.ini suggests that on the first boot something special happens. I would very much like to know what the flash content is like on an actual calculator after it has been used. Unfortunately the usb util gave me 256MB worth of zeros :(

Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on November 18, 2013, 01:23:39 pm
That is interesting. Regarding such OS change, however, would this affect compatibility with existing HP PPL programs?

Welcome to the forums, by the way :)
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on November 18, 2013, 01:41:38 pm
It's very cool to see new members jump on this forum with first posts like that. I am glad there are so many people exited for the prime!
Title: Re: Let's hack the HP Prime!
Post by: quitte on November 18, 2013, 02:22:11 pm
Quote
That is interesting. Regarding such OS change, however, would this affect compatibility with existing HP PPL programs?

As there hardly are any the more important question first: "would this affect compatibility with programs preinstalled?"

Except for the Graphing variables and the settings variables I don't see why any are predefined. As far as I can tell they serve no purpose whatsoever. This is what the Manual has to say:
Quote
You use Home variables to store
data that is important to you, such as matrices, lists, real
numbers, etc.

I don't get why I would want to do that.

Would it affect PPL programs? Yes. If the program used the variables while assuming they are of their respective types. For example an assignment L1:=1 now results in a list containing one element: L1={1}. This behaviour would change. If the type of L1 was initially undefined the same assignment would result in a variable of type real (I think) L1=1

Imho this is the more often expected behaviour.

Of course renaming all those home variables to chinese characters would make them rather useless (which imho they already are). So if someone from HP is reading this: How about instead add a button to create new variables in the VARS view? So that I can define my own variables "that are important to me"?
Also: Why do only variables created in the home view appear in the VARS view (some don't - something about that dialogue popping up), while some can only be found in the mem view?
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on November 18, 2013, 02:30:42 pm
Welcome quitte!

...
It looks like the bootloader is a general purpose one that is capable of booting both PE and ELF format binaries from at least yaffs2 and fat filesystems. It seems to have support for the lcd, usb and serial.
I wouldn't be surprised if it provided an interface via the uart - but am not going to try myself since I need to resolve a minor hardware defecrt with hp first.
This seems to me as a very reasonable guess, indeed. They (HP) wouldn't spend time and money reinventing the wheel (as someone already has put it). If this guess happens to be true, then we should be able to get it replaced with our own 'custom' bootloader. That would a major step towards starting the hacking process. Unfortunately(?) this requires somebody with some knowledge and above all with some spare time to dig into it. Let's hope more hackers do arrive at omnimaga! ;)

Title: Re: Let's hack the HP Prime!
Post by: willrandship on November 18, 2013, 02:31:49 pm
We wouldn't need to replace the bootloader if it takes standard ELFs. Just load linux with it.
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on November 18, 2013, 02:35:21 pm
We wouldn't need to replace the bootloader if it takes standard ELFs. Just load linux with it.
Yeah, maybe so?! I'm just playing on the safe side. We never know what's hidden inside a bootloader until we try to replace it.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on November 18, 2013, 03:52:46 pm
Quote
That is interesting. Regarding such OS change, however, would this affect compatibility with existing HP PPL programs?

As there hardly are any the more important question first: "would this affect compatibility with programs preinstalled?"

Except for the Graphing variables and the settings variables I don't see why any are predefined. As far as I can tell they serve no purpose whatsoever. This is what the Manual has to say:
Quote
You use Home variables to store
data that is important to you, such as matrices, lists, real
numbers, etc.

I don't get why I would want to do that.

Would it affect PPL programs? Yes. If the program used the variables while assuming they are of their respective types. For example an assignment L1:=1 now results in a list containing one element: L1={1}. This behaviour would change. If the type of L1 was initially undefined the same assignment would result in a variable of type real (I think) L1=1

Imho this is the more often expected behaviour.

Of course renaming all those home variables to chinese characters would make them rather useless (which imho they already are). So if someone from HP is reading this: How about instead add a button to create new variables in the VARS view? So that I can define my own variables "that are important to me"?
Also: Why do only variables created in the home view appear in the VARS view (some don't - something about that dialogue popping up), while some can only be found in the mem view?
The issue though is that if the calculator gets popular next school year when it comes out in brick and mortar stores (if ever), then many people who get or make programs will not ever know that there is a modified OS that no longer supports variables the way the official OS did and then share their programs. At the same time, some hardcore programmers who use the OS will release their own programs, flooding the web with programs compatible with only one OS at once. It doesn't matter if there aren't many HP PPL programs right now, as there could be many in the future. Basically, people will have to constantly install back and forth the unnoficial OS and official one in order to run everything they want.

I am personally making large programs for the HP Prime right now and I definitively don't want to have to re-write everything in one year when custom OSes start coming out. I already have one game out, HP Prime Tunnel, that uses L1 and A-Z variables. There are already around 20 programs on Hpcalc.org.

I think it would be best if there was some sort of emulator released that changes the behavior of the HP PPL interpreter or compiler or at least a program allowing you to dual boot. Even better: An OS that supports both syntaxes/type of vars.
Title: Re: Let's hack the HP Prime!
Post by: quitte on November 18, 2013, 04:05:58 pm
Quote
I am personally making large programs for the HP Prime right now and I definitively don't want to have to re-write everything in one year when custom OSes start coming out. I already have one game out, HP Prime Tunnel, that uses L1 and A-Z variables. There are already around 20 programs on Hpcalc.org.

I think it would be best if there was some sort of emulator released that changes the behavior of the HP PPL interpreter or compiler or at least a program allowing you to dual boot. Even better: An OS that supports both syntaxes/type of vars.

This means you are making large programs that overwrite variables that contain - according to the manual - data that is important to the user. You shouldn't do that. If however you use local lists you can continue to do so - but you'd have to make sure to initialize it with the data type you end up using.

Seeing as how much mistakes I make when I try to pick variable names to circumvent the limitations while entering formulas into CAS I consider it a huge mistake to have those home variables in the first place. I don't see removing them causing any big issues.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on November 18, 2013, 04:09:31 pm
Aren't those variables cleared on calculator shutdown, though?

Else, I guess that would be a good idea, assuming that this doesn't drastically increase my program file size. On the 84+ it was common practice to overwrite those predefined vars, though, since that's all we had, and nobody complained except a small minority. The issue right now is that almost every HP Prime program released so far are made by TI programmers and a lot of TI coders planned to get the calc to program it. Inevitably, a lot of programs will use those vars, since it's not considered bad practice on lower end TI models. Programmers will most likely carry those habits on the HP Prime.

That reminds me, is it possible to create permanent variables and lists that won't get deleted on program exit? I am asking, since I would like to make an adventure game with save feature.
Title: Re: Let's hack the HP Prime!
Post by: willrandship on November 18, 2013, 04:10:32 pm
quitte, they do it that way because it's much easier on the OS's end. No namespacing, no reserving room for a growing set of variables, no tracking data and reassigning it. I'm not saying it's ideal, but it's much faster. In a compiled language like C, all this work is done before the program ever launches. The same is true for most of the other languages, like Java or Python. They consolidate all the memory storage before they run. However, this is a completely interpreted language, so these calculations would have to be done in real time, every time you want to enter a new variable namespace.

On an embedded environment like this, the CPU time and RAM used for this process are not negligible.

Also, DJ_O, your point about compatibility is very important.

If you want a better variable stack, just implement a better language and ignore the on-calc programming.
Title: Re: Let's hack the HP Prime!
Post by: quitte on November 18, 2013, 04:30:05 pm
Quote
is it possible to create permanent variables and lists that won't get deleted on program exit?

I read somewhere a couple of hours ago that matrices are indestructible and survive even resets

Quote
In a compiled language like C, all this work is done before the program ever launches

I recall Tim Wessmann talking about how the PPL is compiled before running and how the compiler is fast enough for there not being a point in saving the binaries. PPL is not an interpreted language.

My problem with the variables appears when using this calculator to do calculations. If it was just for programming it wouldn't be much of a problem since then I can just use long variable names - I'm typing on a PC anyways.

In CAS Mode however every character of the output counts because a line of the screen fills quickly. I can't just opt for R_n instead of Rn.And when you have both uppercase and lowercase variables should be used in the given task? I have to make up weird rules for picking variable names _all the damn time_ just because they are sitting there containing 0 {0}

I'm not the only one complaining. Here's a post from hpmuseum: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=256099#256099
Quote
HP: you've stolen my variables. By restricting where I can use lower or upper case variables, you've DESTROYED my work-flow. Equations require a combination of upper and lower case variables... what were you thinking?
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on November 18, 2013, 10:52:22 pm
Wow, if PPL is compiled, then I guess that might explain why it's so fast lol.

EDIT: Typo
Title: Re: Let's hack the HP Prime!
Post by: timwessman on November 18, 2013, 11:35:16 pm
Advanced users have no problems with "i am in charge of creating a variable". However, we have very strong feedback from lower end users and educators that having a set of predefined variables is very important and useful to them for many reasons.

Prime in its first release is not targeted directly at high end users. What was and wasn't in the first release was not targeted at the top 1% of users. If that messes up "your workflow" as was posted in that thread, and even the fact that someone is posting about calculators, pretty much by definition means they fall in that tiny power user minority.

Wow, if PPL is interpreted, then I guess that might explain why it's so fast lol.

Interpeted mean *slower*, not faster unless something is strangely wrong.

What happens is that since the compiler is so fast, the first time you use it then things are compiled for execution and will remain around until a power cycle.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on November 18, 2013, 11:40:10 pm
Erm sorry, I meant compiled. My bad lol XD
Title: Re: Let's hack the HP Prime!
Post by: willrandship on November 18, 2013, 11:56:56 pm
It makes sense to have a system set of variables that can be transferred from program to program, but it would also be nice to have local-program variables. It seems like having both should be an option.
Title: Re: Let's hack the HP Prime!
Post by: quitte on November 19, 2013, 02:58:04 am
Quote
Advanced users have no problems with "i am in charge of creating a variable". However, we have very strong feedback from lower end users and educators that having a set of predefined variables is very important and useful to them for many reasons.

Prime in its first release is not targeted directly at high end users. What was and wasn't in the first release was not targeted at the top 1% of users. If that messes up "your workflow" as was posted in that thread, and even the fact that someone is posting about calculators, pretty much by definition means they fall in that tiny power user minority.

I feel honoured to be put into the 1% by you. Of course those unspecified many reasons might actually be good. However let me put it in a 99%ish way:
Quote
8+3*i=:A         Error:Bad argument type
Why the hell can't I assign?
Quote
8+3*i=:L1      {8+3*i}
Ah great now it works. I wonder why. And where do those curly brackets come from? There was something about different variables in the manual. I guess I'll store that in one of the complexes.
Quote
8+3*i=:C1       Error:Invalid input
:banghead:

Title: Re: Let's hack the HP Prime!
Post by: timwessman on November 19, 2013, 09:32:28 am
It makes sense to have a system set of variables that can be transferred from program to program, but it would also be nice to have local-program variables. It seems like having both should be an option.

You do have local variables (local in the function, and local to the whole file).


...8+3*i=:C1       Error:Invalid input

Change that to a Z<N> which is the complex and it will work.

You are missing the rest of it which is "why is my list variable not a list?" The vast majority of users want to know that certain variables will ALWAYS be a certain type. L1 is a list. Always a list. L1 being a single number messes them up. Why is my X a matrix? Why isn't my matrix a matrix?

They associate certain variables as being a certain type.


I agree that the error messages need serious work though.
Title: Re: Let's hack the HP Prime!
Post by: quitte on November 19, 2013, 01:58:12 pm
At least I can take comfort in knowing that I actually got heard out by someone that could do something about it. I actually do - thanks for that.

I never asked and always assumed that there was nothing I could do about it, with what is provided - so I'll do that now: Is there a way, such as writing a PPL app, that gives me control of the "lost" variables in CAS and (optionally) the normal calc?
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on November 19, 2013, 02:46:27 pm
At least I can take comfort in knowing that I actually got heard out by someone that could do something about it. I actually do - thanks for that.


Yeah same. With Texas Instruments, the only way for this to happen is in France on TI-Planet and even then, the only person that sometimes posts there is not in any way involved in the programming team, so if you send him bug reports/suggestions, he can send them to TI in America, but then, who knows if TI isn't sending the e-mail to the Thrash Can out of laziness?

With HP, the main issue is that if we send suggestions to Tim and the others and they upgrade the OS, then that OS update has to go through the usual layers of bureaucracy like with TI before it finally reaches the public.
Title: Re: Let's hack the HP Prime!
Post by: MacBernick on December 02, 2013, 02:04:54 pm
Hi guys !
So no news about low level programming on Prime yet ?
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 02, 2013, 02:41:14 pm
Heya and welcome to the forums! :)

Unfortunately, as far as HP Prime hacking goes, it's pretty much dead. Nobody will ever hack the HP Prime because nobody seems interested in doing it for a platform that has less than a million users in the world :(

Even TI-Nspire hacking is dead, although there are a few games still coming out every now and then. No more Ndless development nor anything else, and that's with a much more popular (although more closed) platform. It took three years until ASM arrives on the Nspire too. Same for the Casio PRIZM, but again, hacking it is no longer as needed, since Casio has done nothing to block third-party ASM/C code.

For the next few years, we'll have to stick to HP PPL language (although that's already quite fast enough for the time being, since it's compiled).

On a better note, apparently it was discovered not so long ago that the HP Prime pretty much lacks any viable protection against third-party OSes. In other words, someone could disassemble the HP Prime OS then modify it to add a LaunchASM() command that runs ARM assembly or C programs. He could even write his own OS or make such mod avaialble as IPS patch to avoid getting in trouble by releasing an OS containing copyrighted content.

Besides that, if you or anyone else knows enough ARM assembly, hacking and stuff, they are well welcome to help finding other alternatives. Of course, keep in mind that in the future, HP might release OS updates that could unintentionally (or if they're like TI, intentionally) block ASM exploits.
Title: Re: Let's hack the HP Prime!
Post by: Jim Bauwens on December 02, 2013, 03:36:22 pm
Heya and welcome to the forums! :)

Unfortunately, as far as HP Prime hacking goes, it's pretty much dead. Nobody will ever hack the HP Prime because nobody seems interested in doing it for a platform that has less than a million users in the world :(

The device is just out and the hacking scene has already been declared dead. Maybe the fact that not many developers in the community have one helps that there is low activity _at the moment_?

Quote
Even TI-Nspire hacking is dead, although there are a few games still coming out every now and then. No more Ndless development nor anything else, and that's with a much more popular (although more closed) platform. It took three years until ASM arrives on the Nspire too. Same for the Casio PRIZM, but again, hacking it is no longer as needed, since Casio has done nothing to block third-party ASM/C code.

Wrong. It's not dead. You just think it's dead. How do you know that there is no Ndless development anymore? As far as I know you aren't in the Nspire dev team. At the moment there may be little development but when I look here and there I still see development and updates being done. I personally (and I know of others) continue to hack the platform. We just only decide to release certain things when the time is right.

Please DJ_O, stop saying these kind of stuff because the only thing you do with that is harm the community.
Title: Re: Let's hack the HP Prime!
Post by: critor on December 02, 2013, 03:48:48 pm
Although Ndless 3.1 is dead, it doesn't mean than Ndless and Nspire hacking are dead yet and are not being worked on.

Seeing what TI did those last months for the sake of exams and security, fixing many things and even things which were never exploited or misused (the J04/JTAG connector removed on HW-J/K, TNOC being forbidden with OS 3.6, new CAS check in OS 3.6 which does brick TI-Nspire DVT prototypes even if they are CAS...).

With all this, it's clear that TI is reading both TI-Planet and Omnimaga. So if anything is achieved, I can only tell you that you probably won't know about it before it is about to be released.
Title: Re: Let's hack the HP Prime!
Post by: quitte on December 02, 2013, 03:49:21 pm
I plan to visit home beginning tomorrow. At least one of the two usb to usart cables I had has got to be there...
Still I'm somewhat disappointed that still no one checked if there is any data coming out the TX pad.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 02, 2013, 03:52:20 pm
I guess that it's possible that evrything happens behind the scenes indeed. Otherwise, I suspect that there are just not enough people who meet all three following criterias at once in the community right now:

-Have enough time and motivation
-Has interest in the platform
-Has the knowledge to hack it. ExtendeD had 9 years of ASM experience when he got involved into Ndless.

And since the HP Prime fan base is considerably smaller than TI calcs, this inevitably means that it also has considerably fewer people who meet the three criterias above.

The only people we can count on in short terms are disgruntled TI-Nspire users who are sick of TI's actions, because most hardcore HP fans were born decades before video games became popular and are now way past their possible gamer time frame, meaning that they are most likely not interested in hacking any calc.
Title: Re: Let's hack the HP Prime!
Post by: quitte on December 02, 2013, 04:02:49 pm
I guess I should make a positive comment about the prime since those are rare. And actually I think it deserves it, despite all the problems that exist.

I never used an nspire calculator, but from what little I used a TI-84 and having used a Casio Algebra FX2.0 plus the Prime is just infinitely better. It's easy to use and it has great built in help. It's actually possible to start playing with it and make great use of it without digging through manuals.
And it is that ease of use that I partially blame for all the complaints about bugs. I would have never discovered the same problems on the Algebra FX, since using it was so much a pain in the bottom that I never got to similarily advanced use cases.
The other problem is that a lot of Prime users are able to compare to the best of the HP calculators. This sets expectations that coming from another calculator wouldn't exist.
The Prime is a very fast, easy to use and all in all great calculator.

So if you're reading that because goole lead you here: Try the simulator and make up your own mind.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 02, 2013, 04:07:06 pm
Yeah it's still one of my favorite calcs personally despite the bugs. At least many bugs coming from the 39gII were fixed in the Prime. It freezes much less often, for example, and the calc is much more stable than the emulator.

The only issue is that some bugs can impact usage in class, which is the main calc's user target. They need to be fixed as soon as possible. Other than that, performance-wise, it's really impressive.

I will never judge the Prime based on past HP calcs, because:
1) It's aimed at a completely different market.
2) The HP 49g/+ had serious issues when it came out. So much in fact that it never recovered from its bad reputation then HP changed the name to HP 50g once it got fixed. Maybe the HP Prime is the same, but I hope it doesn't get to the point where the name has to be changed as well.

So if you're reading that because goole lead you here: Try the simulator and make up your own mind.

I don't like the simulator anymore. It crashes at many places where the calc has no problem running ("The application has crashed and will be restarted"). For example, very large code or drawing stuff outside the screen. It's annoying because I keep losing lots of progress when using it (on the real calc, I only lose progress if the program code was still open during the crash, which never happened so far), so I prefer sticking to the real thing or the connectivity kit now.
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on December 02, 2013, 04:07:39 pm
Quote from: DJ Omnimaga
...
-Have enough time and motivation
-Has interest in the platform
-Has the knowledge to hack it. ExtendeD had 9 years of ASM experience when he got involved into Ndless.
...
Well, IMHO it mostly depends on your luck. One of these days a prestigious hacker knocks at the Omninaga's door offering his/her services for free. Until then, keep your hopes as high as possible. Yeah, on this matter I agree with Jim why should we be so negative? After all there are great (TI-Nspire) contributions on this site and some and still rather recent! Come on DJ_O cheer up a bit, brighter days are coming! :)
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on December 02, 2013, 04:10:53 pm
I totally agree with SpiroH. +1
Title: Re: Let's hack the HP Prime!
Post by: Vogtinator on December 02, 2013, 04:16:53 pm
I got into nspire development only because we got this calc at school.
It has so many bugs that it is almost unusuable at school, and I'm sure the Prime will get a chance if it meets the requirements.
Almost nobody buys calcs just to hack them. Often they're also used properly :P
I'd say wait a few years, the situation will look entirely different when the prime overtook the nspires.

Quote
Well, IMHO it mostly depends on your luck. One of these days a prestigious hacker knocks at the Omninaga's door offering his/her services for free. Until then, keep your hopes as high as possible. Yeah, on this matter I agree with Jim why should we be so negative? After all there are great (TI-Nspire) contributions on this site and some and still rather recent! Come on DJ_O cheer up a bit, brighter days are coming!
Reminds me of nLaunch (CX).. but that was probably only because of TI's madness.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 02, 2013, 04:17:20 pm
Maybe I'm a bit too pessimistic, but I know that HP had financial troubles a few years ago and they have a long history of poor marketing when it comes to non-printer/computer stuff. What I am afraid of is if the HP Prime doesn't take off within the next two years, HP might as well pull the plug and discontinue the calculator.
Title: Re: Let's hack the HP Prime!
Post by: MacBernick on December 03, 2013, 11:27:26 am
Heya and welcome to the forums! :)

Unfortunately, as far as HP Prime hacking goes, it's pretty much dead. Nobody will ever hack the HP Prime because nobody seems interested in doing it for a platform that has less than a million users in the world :(

Even TI-Nspire hacking is dead, although there are a few games still coming out every now and then. No more Ndless development nor anything else, and that's with a much more popular (although more closed) platform. It took three years until ASM arrives on the Nspire too. Same for the Casio PRIZM, but again, hacking it is no longer as needed, since Casio has done nothing to block third-party ASM/C code.

For the next few years, we'll have to stick to HP PPL language (although that's already quite fast enough for the time being, since it's compiled).

On a better note, apparently it was discovered not so long ago that the HP Prime pretty much lacks any viable protection against third-party OSes. In other words, someone could disassemble the HP Prime OS then modify it to add a LaunchASM() command that runs ARM assembly or C programs. He could even write his own OS or make such mod avaialble as IPS patch to avoid getting in trouble by releasing an OS containing copyrighted content.

Besides that, if you or anyone else knows enough ARM assembly, hacking and stuff, they are well welcome to help finding other alternatives. Of course, keep in mind that in the future, HP might release OS updates that could unintentionally (or if they're like TI, intentionally) block ASM exploits.

Hey thank you. If I have thought I would start such a discussion with a 'hello' ^^'

Well I bought the Prime because I was a huge fan of my two 48 that I used to program in asm (I loved Saturn asm, Jazz was so cool). But I lost them some years ago when a fire started in my flat. I don't have the real machine yet (should be here in the next few days), but I played a while with the simulator. At first, I must say I was a little disappointed. A lot of cool feature of the 48 are gone, RPN is not half as practical as it was, and RPL miss me a lot. The filesystem (sort of) that used to manage objects and variables too. It was just excellent.
Of course when I saw the specs, I wanted to program it in some low level language... I sure can help and contribute to some sort of hacking, but I'm not a reverse-engineering guru of any kind, I know nothing about ARM asm (yet ?), and I have a job that can take me lot of time, so I won't start any project myself.
But you're right, PPL seems quite fast, and it should be fun to try and do amazing things with it.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 04, 2013, 03:12:00 am
Ouch, that sucks about the fire. >.<

And yeah, the reason why a lot of 48 features are gone is because the HP Prime was aimed at a completely different userbase than the older models. Instead of engineers/professionals, it was aimed towards students for the most part, and in the past, I often heard younger students complain about how confusing and hard RPN/RPL are, so forcing RPN/SysRPL upon them with no option to use algebraic mode and a Basic/Pascal-like language would have turned them away. The same thing happened with the 83+/84+ when FastRPL language came out: It showed big promises for programmers who wanted to program fast games without having to learn ASM, but to know FastRPL, you needed some ASM knowledge (the stack, for example). Now look at how popular Axe Parser is.

Anyway, there are now good news about the calc: A new update came out. It breaks file transfer between the emulator and calc, but it fixes many other things and some connectivity issues with the connectivity kit, which can still be used to create/save programs on the calculator as an alternative to the emulator.
Title: Re: Let's hack the HP Prime!
Post by: timwessman on December 04, 2013, 09:44:28 am
It breaks file transfer between the emulator and calc,

One of the issues prior with the emulator was that you couldn't tell where the communication was going. There is a new windows menu called "Connect To" that lets you select wit which unit you are trying to communicate. Have you selected your USB unit?
Title: Re: Let's hack the HP Prime!
Post by: Han on December 05, 2013, 10:54:31 am
Well I bought the Prime because I was a huge fan of my two 48 that I used to program in asm (I loved Saturn asm, Jazz was so cool). But I lost them some years ago when a fire started in my flat. I don't have the real machine yet (should be here in the next few days), but I played a while with the simulator. At first, I must say I was a little disappointed. A lot of cool feature of the 48 are gone, RPN is not half as practical as it was, and RPL miss me a lot. The filesystem (sort of) that used to manage objects and variables too. It was just excellent.

If you liked the HP48 and want a faster machine with a larger display and much more expandability, why not consider an HP50G? You can program in RPL, SystemRPL, Saturn Assembly, ARM, or C (via HPGCC). As for Jazz, yeah it was very cool -- and still is. I updated it to the HP50G and it is much more robust now.

http://users.ju.edu/hduong/jazz
Title: Re: Let's hack the HP Prime!
Post by: MacBernick on December 05, 2013, 06:59:43 pm
Ouch, that sucks about the fire. >.<

And yeah, the reason why a lot of 48 features are gone is because the HP Prime was aimed at a completely different userbase than the older models. Instead of engineers/professionals, it was aimed towards students for the most part, and in the past, I often heard younger students complain about how confusing and hard RPN/RPL are, so forcing RPN/SysRPL upon them with no option to use algebraic mode and a Basic/Pascal-like language would have turned them away. The same thing happened with the 83+/84+ when FastRPL language came out: It showed big promises for programmers who wanted to program fast games without having to learn ASM, but to know FastRPL, you needed some ASM knowledge (the stack, for example). Now look at how popular Axe Parser is.

I know that, in fact I was not complaining really. This machine is a new born and it can takes time before a scene appear, if it actually happens.
If you liked the HP48 and want a faster machine with a larger display and much more expandability, why not consider an HP50G? You can program in RPL, SystemRPL, Saturn Assembly, ARM, or C (via HPGCC). As for Jazz, yeah it was very cool -- and still is. I updated it to the HP50G and it is much more robust now.

http://users.ju.edu/hduong/jazz

Nice to see this great tool is still alive !

The 50g was my first choice before I heard about the Prime. Might be an option if the Prime really have no success and/or really don't meet my needs.
Title: Re: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 05, 2013, 09:26:43 pm
What would be cool is an HP 51g: An HP 50g with functionalities identical to the 50g, but with the OS recoded from scratch for ARM instead of being an emulated Saturn OS, a 320x240 color LCD and the same processor speed as the Prime, while still keeping both SysRPL and Hp PPL as on-calc languages.
Title: Re: Let's hack the HP Prime!
Post by: MacBernick on December 05, 2013, 10:13:18 pm
The 50g OS adapted for the screen (res and colors), installable as an app on the Prime, and a good C/asm dk for the ARM, you have the ultimatest pro/students/hackers calc ever :p
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 05, 2013, 10:36:29 pm
That would be nice indeed, but still, the problem with the 50g is that the OS is basically a Saturn CPU emulator on which an improved HP 48 OS is running. Even with a 200+ MHz ARM processor, the fact the OS is running on a Saturn emulation layer makes it way slower than the HP 39gII and Prime OSes.

I wish that HP actually ported the 50g OS to ARM ASM rather than just sticking to Saturn ASM and using an emulator, the OS wouyld have ran much faster.

The HP Prime app idea is nice by the way.
Title: Re: Let's hack the HP Prime!
Post by: MacBernick on December 05, 2013, 10:55:03 pm
Would be great to have the 50g OS native for ARM, but that would mean restarting from scratch. Nothing HP will ever do I guess, and a veeeery long task for the community. Well, that's what did the guys that actually made the 50g OS, if I'm not wrong. Let's hope they have a Prime now ^^
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 05, 2013, 11:40:56 pm
Indeed, plus the resulting bugs and glitches >.< (although at least HP has done a good job at fixing many of them this time). Oh well, in the future, maybe people will release HP Prime OS patches that enables some 50g features or extend RPN mode. A better thing, though, would be applications letting you use extra functions, kinda like what some TI apps do.
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on December 06, 2013, 07:32:05 am
The 50g OS adapted for the screen (res and colors), installable as an app on the Prime, and a good C/asm dk for the ARM, you have the ultimatest pro/students/hackers calc ever :p
Ultimatest for hackers for sure but for students i doubt it. Schools would never embark on such an adventurous trip.
Quote
.. Let's hope they have a Prime now ^^
I wonder, are they still working for HP? ;)
Title: Re: Let's hack the HP Prime!
Post by: Han on December 07, 2013, 12:44:51 pm
Quote
Quote
.. Let's hope they have a Prime now ^^
I wonder, are they still working for HP? ;)

Among the users-turned-employees, I think Cyrille and Tim are the only ones left. Mika and Mozgy, two really awesome SATURN programmers have long disappeared from the HP "scene" from what I can tell.

As some of you may recall, Mika was the author of Jazz, which incorporated the ML debugger from Jan Brittenson.

Claude-Nicholas Feichter and Mika wrote ALG48.

Mozgy reverse-engineered the HPTools and created the GNU Tools, among other programs (e.g. Willy in the Mines adaption for the HP48).

Jean-Yves Avenard and folks from the MetaKernel worked for HP but I think they eventually branched off to Hydrix after the Australian office was killed off.
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on December 07, 2013, 01:07:42 pm
@Han: wow thanks for such a comprehensive answer!
Title: Re: Let's hack the HP Prime!
Post by: Han on December 07, 2013, 09:03:19 pm
@Han: wow thanks for such a comprehensive answer!

Not all those I listed were officially employed by HP though. They just were the "big guns" during the day. A lot of their work did make it into the HP49G/HP50G firmware, or toolchain, though.
Title: Re: Let's hack the HP Prime!
Post by: cutterjohn on December 08, 2013, 06:36:48 pm
That would be nice indeed, but still, the problem with the 50g is that the OS is basically a Saturn CPU emulator on which an improved HP 48 OS is running. Even with a 200+ MHz ARM processor, the fact the OS is running on a Saturn emulation layer makes it way slower than the HP 39gII and Prime OSes.

I wish that HP actually ported the 50g OS to ARM ASM rather than just sticking to Saturn ASM and using an emulator, the OS wouyld have ran much faster.

The HP Prime app idea is nice by the way.
Actually stock, it runs 75MHz.  You need to run another program to "uncap" it's speed.

That said, you know the ease of updating the prime, I can't help if it might not be possible to re-purpose the Prime in a similar fashion to the way in which the HP 30b was repurposed into WP 34s...

As even though the Prime isn't horrendously awful, I'd really have preferred the older 28/48/49/50 series "OS" re-written to ARM native... the CAS at least is LGPL, but I cannot recall if it's SRPL, Saturn ASM or what any longer as it's been so long since I've bothered to look(think back to 49g), which I think a good deal of the rest of the stuff is written in as well... have to chuck all the Saturn ASM and re-write those portions as make sense, in preferably something more amenable/portable like C excepting where necessary...

Probably won't be much of an impetus for this unless HP gives up on it and stops updating the firmware...
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 08, 2013, 06:41:53 pm
Oh right, I forgot about the app. And yeah having rewritten the old OS would have been a great idea (perhaps better, IMHO, providing that they also include HP PPL and make the calc more user-friendly for younger audiences). It's just a shame that this wasn't done with the 50g, since a lot of this platform hardware potential (regardless of it it runs at 75 or 200 MHz) is being wasted, as well as battery power, via slow emulation.

Welcome to the forums by the way! :)
Title: Re: Let's hack the HP Prime!
Post by: cutterjohn on December 08, 2013, 06:47:20 pm
Oh right, I forgot about the app. And yeah having rewritten the old OS would have been a great idea (perhaps better, IMHO, providing that they also include HP PPL and make the calc more user-friendly for younger audiences). It's just a shame that this wasn't done with the 50g, since a lot of this platform hardware potential (regardless of it it runs at 75 or 200 MHz) is being wasted, as well as battery power, via slow emulation.

Welcome to the forums by the way! :)
Thanks, just decided to finally join since it seems that the Prime has generated interest in HP calcs.  I know that Casios were kinda popular, but the fx-cg10 just didn't really grab my attention, and the fx-cp400, well all I can say is: Are they SERIOUS?! (This is a POS @ $140, maybe $60 it MIGHT compete w/a 50g which you can get for $80 on Amazon nowadays.)

...was also thinking, a pretty much complete maxima install on Android is ~100MB, and I hate to say it, but it's probably generally a better CAS than xCAS(IIRC that's the real name of the 49/50/Prime CAS... I think that Cyril de Brebbison is still working with HP at least for the CAS and some other parts of the "apps"...)
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on December 08, 2013, 08:36:16 pm
...
...was also thinking, a pretty much complete maxima install on Android is ~100MB, and I hate to say it, but it's probably generally a better CAS than xCAS(IIRC that's the real name of the 49/50/Prime CAS... I think that Cyril de Brebbison is still working with HP at least for the CAS and some other parts of the "apps"...)
Hmm, you just might be right!? If you don't know it yet, please have a look here Maxima On Android (http://ourl.ca/18114) for a little more.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 08, 2013, 08:42:48 pm
Oh right, I forgot about the app. And yeah having rewritten the old OS would have been a great idea (perhaps better, IMHO, providing that they also include HP PPL and make the calc more user-friendly for younger audiences). It's just a shame that this wasn't done with the 50g, since a lot of this platform hardware potential (regardless of it it runs at 75 or 200 MHz) is being wasted, as well as battery power, via slow emulation.

Welcome to the forums by the way! :)
Thanks, just decided to finally join since it seems that the Prime has generated interest in HP calcs.  I know that Casios were kinda popular, but the fx-cg10 just didn't really grab my attention, and the fx-cp400, well all I can say is: Are they SERIOUS?! (This is a POS @ $140, maybe $60 it MIGHT compete w/a 50g which you can get for $80 on Amazon nowadays.)

...was also thinking, a pretty much complete maxima install on Android is ~100MB, and I hate to say it, but it's probably generally a better CAS than xCAS(IIRC that's the real name of the 49/50/Prime CAS... I think that Cyril de Brebbison is still working with HP at least for the CAS and some other parts of the "apps"...)
Yeah as a long time TI fan, I was still happy to see people here take interest in other brand products and I myself took interest in them in the past as well, especially the Prime. As for the cg10, my main issue is the slow Basic language and I don't want to learn Lua to make faster stuff when I can already do it in Basic/PPL on the 84+/Prime. The FX-cp400 price tag is inexcusable considering even maths are slow. The hardware might be better, but the software is just inexplicably slow. Someone needs to teach Casio optimizing tricks.

As for HP, they just need to learn marketing better, so their calcs come out after most bad bugs get fixed, not before, and learn to promote their product outside the internet.

And yeah Maxima would have been great, although I guess this would have required a Flash memory upgrade, since the Prime only has 256 MB of it. Heck, Maxima would take more than half of my mobile phone's memory O.O
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on December 08, 2013, 08:53:23 pm
...
As for HP, they just need to learn marketing better, so their calcs come out after most bad bugs get fixed, not before, and learn to promote their product outside the internet.
...
I dare to suggest they try to hire you! :P
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 08, 2013, 09:19:21 pm
Considering I suck at anything lower level than TI-83+ BASIC (even Axe Parser), I doubt it :P, unless you mean for marketing, but if they really wanted to try harder, the HP administration would have replaced the marketing team a long time ago.
Title: Re: Let's hack the HP Prime!
Post by: willrandship on December 10, 2013, 04:26:33 pm
The best solution might just be to make a Linux port that runs at ~90 MHz. If we did it right, it could be possible to make libs for the Prime and nspire that would handle all the messy stuff, and from there, programs could be cross-compatible WITHOUT recompiling!
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 10, 2013, 11:11:22 pm
That reminds me, one thing that might have generated a lack of interest for hacking this calc is due to how powerful the on-calc language is. Since it's a compiled language, it is not slowed down as much as if it was interpreted during runtime. Also the language has very powerful commands such as sprites and polygons. It lacks direct memory access and stuff, but it's miles ahead of Lua and TI-BASIC. Even if the HP Prime ran at 100 MHz, it would still be more powerful than Nspire Lua in terms of game making.

I like the idea about cross-compatible programs between the Nspire and the Prime, though. O.O
Title: Re: Let's hack the HP Prime!
Post by: SpiroH on December 11, 2013, 09:49:32 am
Quote from: DJ Omnimaga
.., unless you mean for marketing,...
^Exactly(!), that's what I mean. ;)

Quote from: DJ Omnimaga
...
I like the idea about cross-compatible programs between the Nspire and the Prime, though. O.O
Yeeeah, easier said than done. We still lack the person to do the hard work, though. What a shame. :P
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on December 24, 2013, 01:15:44 am
Thanks to bb010g for posting this link on IRC http://ried.cl/en/franqueando-los-secretos-del-hardware-mediante-ingenieria-inversa/

Maybe that could be useful for Prime hacking?
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on April 04, 2014, 04:06:11 pm
Thanks to bb010g for posting this link on IRC http://ried.cl/en/franqueando-los-secretos-del-hardware-mediante-ingenieria-inversa/

Maybe that could be useful for Prime hacking?

WOW. This could be the breakthrough. For one, we could watch the USB port when, say, a new firmware is being installed...

And this article also seems to imply that HP ignores CRCs when transferring. If they ignore checking with firmware, our job could be a lot simpler.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on April 04, 2014, 05:33:16 pm
Yeah, apparently the HP Prime protection against third-party OSes and OS validation is very weak. It reminds me of PRIZM add-ins checksum. People hacked Casio PRIZM add-ins before the calc even came out lol. The main issue, though, is that making a new OS is incredibly hard. Even on the 83+, after 15 years there are still no third-party OS other than games and unfinished OSes with limited functionality. http://www.ticalc.org/pub/83plus/os/
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on April 04, 2014, 08:20:22 pm
The main issue, though, is that making a new OS is incredibly hard. Even on the 83+, after 15 years there are still no third-party OS other than games and unfinished OSes with limited functionality. http://www.ticalc.org/pub/83plus/os/

Well, I'd assume we can start out by figuring out how to send it slightly modified versions of the real OS, and then work our way up to the big stuff. Change a string in the help file, figure out the new CRC, send it. Stuff like that.
Writing a new OS at this point would be impossible. We know what the architecture is, but we don't know anything about the internals; what pieces of memory are linked to hardware, for example.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on April 04, 2014, 10:59:00 pm
Actually, what would be a good idea is if HP releases no firmware and the community just modifies the latest one to fix bugs. Adding program commands might not be a good idea, though, since people would make games and programs for the third-party OS and those games would not run on the official firmwares. I'm thinking more about full RPN or bug fixes.
Title: Re: Let's hack the HP Prime!
Post by: Adriweb on April 05, 2014, 03:11:27 am
Thanks to bb010g for posting this link on IRC http://ried.cl/en/franqueando-los-secretos-del-hardware-mediante-ingenieria-inversa/

Maybe that could be useful for Prime hacking?

WOW. This could be the breakthrough. For one, we could watch the USB port when, say, a new firmware is being installed...

And this article also seems to imply that HP ignores CRCs when transferring. If they ignore checking with firmware, our job could be a lot simpler.

Well, http://tiplanet.org/forum/viewtopic.php?f=55&t=13329&lang=en is older and directly better for "hacking" ;)

Nothing with Prime-tinkering done since, though, if I'm not mistaken (except transfers)
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on April 05, 2014, 05:22:47 am
Has anyone even tried to flash something else than the OS to see if it worked ? Also has the UART been tested ? There could be interesting boot logs that we know nothing about yet.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on April 05, 2014, 06:05:08 am
You mean the pins on the board marked with rx and tx?
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on April 05, 2014, 06:38:53 am
Yes I do.
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on April 05, 2014, 08:04:41 am
I just realized something. Recall the SDK OS version, and how it came with usbtool.exe to manually upload firmware to it? Well, I wonder if it'll take modified firmware files without complaint.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on April 05, 2014, 10:59:21 am
Perhaps it is some kind of debug interface. There should be interesting stuff on the uart.
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on April 06, 2014, 02:16:50 pm
Yeah Keoni that was the idea. On the Nspire there's some info output through rs232. Also it allows one to flash the boot2.
Iconmaster, I think TIPlanet managed to change some OS strings this way. My idea was to use this to flash custom bare metal code and see if it works. If so we could write a custom OS loader and start porting Linux. :D
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on June 14, 2014, 06:20:32 pm
Anyone still trying to crack open the prime?
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on June 15, 2014, 06:55:32 am
Once I get one I'm interested. Tiplanet has shown it's possible to modify the firmware easily so I plan to try and run bare metal code at first.
Title: Re: Let's hack the HP Prime!
Post by: aeTIos on June 15, 2014, 10:23:56 am
I might get a Prime. It seems really interesting. Whenever I get one, I'm interested :P
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on June 15, 2014, 12:05:04 pm
I probably won't try to hack it since I am not into low level and hardware stuff but if I find anything interesting I'll share it.

Also if you get a prime I hope you do code a bit for it too, unlike certain other Omni users :P
Title: Re: Let's hack the HP Prime!
Post by: bb010g on June 15, 2014, 10:08:50 pm
I probably won't try to hack it since I am not into low level and hardware stuff but if I find anything interesting I'll share it.

Also if you get a prime I hope you do code a bit for it too, unlike certain other Omni users :P
I'm working on it...school & finals...grumble grumble grumble
:blah:
Title: Re: Let's hack the HP Prime!
Post by: cyrille on June 24, 2014, 02:08:04 am
Hello,

Nothing on RS232, sorry...
No buffer overruns that I know of (else I would have fixed them...)
If any of you is interested in the data protocol between calcs, just ask...

Cyrille
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on June 24, 2014, 05:33:44 am
Welcome on omnimaga :D

Perhaps the uart is only used for flashing the bootloader for example and not for debugging.
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on June 24, 2014, 09:34:38 am
Welcome to Omni ! :D

Also, are you from HP or did you try that yourself ?
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on June 24, 2014, 03:10:53 pm
To be honest I am unsure, since he is posting in this particular thread and the HP staff can't really help us hack their own products, but we never know, since TI-Planet and MoHPC have an HP guy named Cyrille.

Regardless, welcome to the forums :D
Title: Re: Let's hack the HP Prime!
Post by: cyrille on June 25, 2014, 01:24:07 am
Hello,

Yes, from HP.

>Perhaps the uart is only used for flashing the bootloader for example and not for debugging.
nope, bootloader, when we need to flash it (which has never happend to me) is done through JTAG...

I can't help you hack Prime application, sorry, but I can help you do prety much anything else...

As you stated earlier, the application is a .elf file and you can replace the application by anything else that you compile and it should be started by the OS... then you are free to do whatever you want... but this transforms prime into a single purpose machine...

cyrille
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on June 25, 2014, 04:08:22 am
Would patching the application be fine too?
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on June 25, 2014, 04:59:01 am
Hello,

Yes, from HP.

>Perhaps the uart is only used for flashing the bootloader for example and not for debugging.
nope, bootloader, when we need to flash it (which has never happend to me) is done through JTAG...

I can't help you hack Prime application, sorry, but I can help you do prety much anything else...

As you stated earlier, the application is a .elf file and you can replace the application by anything else that you compile and it should be started by the OS... then you are free to do whatever you want... but this transforms prime into a single purpose machine...

cyrille

Oh great !
This means we could port Linux pretty easily. :D

Also Keoni, I think it's OK to patch the OS, but he (she ?) is not allowed to help us with that.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on June 26, 2014, 12:01:41 am
Yeah patching the OS to allow extra functionalities or fixing bugs would be a nice alternative too. Of course for the time being it would be best to keep things compatible with the official OS, though, and no matter what happens, we must NOT alter the exam mode code unless it's to fix exploits, otherwise they might start adding restrictions like TI to avoid the calc getting banned from tests. But yeah, patching the official OS then releasing an IPS patch or something wouldn't be a first, I guess, because this happened with the HP 50g too. We never know, though, because maybe HP will finally fix all bugs at one point, so such patch might not be necessary. IMHO for now a patch should only be limited to adding a command to run assembly language.
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on June 26, 2014, 12:15:28 pm
If we do it right it will be like Ndless, minus the need for an exploit : add the ability to run native executables and hooking so that the programs themselves modify OS functionality. :)
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on June 27, 2014, 08:15:00 am
A reminder to people who want to write patches for this thing: We already have half of the HP Prime's source code. It's called xcas. :P
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on June 27, 2014, 11:45:42 am
Indeed. O.O Also, I don't remember what license xcas is under but I'm pretty sure HP has to redistribute the source to the parts they used. Maybe they do idk.
Title: Re: Let's hack the HP Prime!
Post by: cyrille on July 02, 2014, 02:15:15 am
Hello,

xCas has multiple licencing alternatives, as described in the author's pages... GPL is not the only options...

Cyrille
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on July 02, 2014, 02:39:33 am
Oh OK thank you for making that clear.
Title: Re: Let's hack the HP Prime!
Post by: Shibe on July 14, 2014, 09:06:51 am
Hello,

I've discovered that when the HP Calculator is set to recovery mode (symb + reset) and plugged into a computer, there is a partition available named "HP CALC DEV" that can be accessed. And from what I read from gparted, it seems that around 247.12mb is still free, although I know that it isn't. I haven't been able to find anything online regarding this partition, and I wonder if it could be of any use. Would anyone happen to know what purpose the partition might serve?

Spoiler For Huge fucking image, beware:
(http://i.imgur.com/t8PBZDS.png)
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on July 14, 2014, 05:12:37 pm
Welcome to omnimaga!

Does this partition contain any files?
Title: Re: Let's hack the HP Prime!
Post by: Shibe on July 14, 2014, 05:17:24 pm
Thank you.

This partition doesn't contain any files. I ran the command `ls -la` to check for any hidden files, but there doesn't appear to be anything at all, just an empty partition.

(http://i.imgur.com/rLHs60v.png)
Title: Re: Let's hack the HP Prime!
Post by: willrandship on July 14, 2014, 05:18:46 pm
Also @street, if they just include xcas as a program running on top of the HP Prime kernel, and don't modify it at all, they don't have to give anyone any code.
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on July 14, 2014, 05:25:17 pm
Perhaps it's a place for us to put our own software on :3 (it's a stretch)
Title: Re: Let's hack the HP Prime!
Post by: ordelore on July 14, 2014, 05:52:59 pm
Perhaps it's a place for us to put our own software on :3 (it's a stretch)
Or maybe a swap partition?
Title: Re: Let's hack the HP Prime!
Post by: Shibe on July 14, 2014, 06:01:21 pm
Or maybe a swap partition?
I doubt it. The HP Prime's RAM is around 32mb mDDR and I doubt that they would make a swap partition that small if anything, but I could be wrong.
 
Title: Re: Let's hack the HP Prime!
Post by: Keoni29 on July 14, 2014, 06:06:12 pm
But why would a swap partition be called HP calc dev?
Title: Let's hack the HP Prime!
Post by: Deep Toaster on July 14, 2014, 08:30:33 pm
Could be used internally for developing calculator software? Since it's accessible from recovery mode. Just throwing ideas out there.
Title: Re: Let's hack the HP Prime!
Post by: bb010g on July 14, 2014, 09:50:27 pm
Could be used internally for developing calculator software? Since it's accessible from recovery mode. Just throwing ideas out there.
If so, it could be useful for hooking Linux in.
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on July 15, 2014, 12:05:58 am
I know this isn't related to hacking the calc, but  if someone is going to make a patched version of the official firmware, I think a good feature addition would be to show how much RAM and Flash are left from the program and application menus. I know the calc has a lot of both, but it's kinda annoying to not even know how much is left.
Title: Re: Let's hack the HP Prime!
Post by: cyrille on July 15, 2014, 02:45:51 am
Hello

Quote
When the HP Calculator is set to recovery mode, there is a partition available named "HP CALC DEV"(around 247.12mb is still free)

This is the data partition where user data is saved...

Cyrille
Title: Re: Let's hack the HP Prime!
Post by: iconmaster on October 06, 2014, 03:52:15 pm
I loaded the .BIN file from the old SDK OS into a ARM dissassembler (armU, to be exact), and I found that I can emulate it's basic operations from there. I discovered what memory addresses correspond to the splash screen bootup and the main input loop.

I'll post more specifics later.
Title: Re: Let's hack the HP Prime!
Post by: TIfanx1999 on October 06, 2014, 04:53:37 pm
Sounds pretty sweet! :D
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on October 06, 2014, 07:52:06 pm
I loaded the .BIN file from the old SDK OS into a ARM dissassembler (armU, to be exact), and I found that I can emulate it's basic operations from there. I discovered what memory addresses correspond to the splash screen bootup and the main input loop.

I'll post more specifics later.
Interesting, let us know :). What I still wonder is if it's possible to run native code directly from the official OSes or if it really has to be done via an hacked/modified OS. It would also be interesting to see if the community would be able to help HP fix some of the OS bugs.
Title: Re: Let's hack the HP Prime!
Post by: chickendude on October 19, 2014, 08:34:42 am
I'd love to work on opening the Prime up to native code, but that's all way above my head. Lack of native code execution has been the one thing holding me back from picking one of these up :/
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on November 09, 2014, 01:26:09 am
So um. The Prime is pretty open already. With the OS being a simple ELF I think we should instead of modifying it try to focus on writing a standalone shell that can boot the OS. That would make it much simpler, especially considering we won't have to update the shell for each new OS. We can figure out later how to load it as a library to access math functions and such from unofficial code.
HP made us a really awesome present by not putting any kind of code signature on this calc
Title: Re: Let's hack the HP Prime!
Post by: DJ Omnimaga on November 09, 2014, 02:10:54 am
I didn't think about that idea before actually. I am unsure if it would work, but if it did, then it would be kinda the opposite of Z80 calcs, in the way that instead of running a shell from an OS, you would run the OS from a shell, right?

The thing with modifying the OS directly is that it would be more work for the user to patch it and there would be high risks of bricking their calcs if they use the wrong IPS patch or something. Plus would IPS Patches even work with such file format anyway? And to find an exploit inside the OS itself it will be much more work, not to mention it might end up getting patched by HP if it was the result of a glitch. So your idea could be something worth investigating.
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on November 11, 2014, 03:49:13 pm
I didn't think about that idea before actually. I am unsure if it would work, but if it did, then it would be kinda the opposite of Z80 calcs, in the way that instead of running a shell from an OS, you would run the OS from a shell, right?
Exactly.

The thing with modifying the OS directly is that it would be more work for the user to patch it and there would be high risks of bricking their calcs if they use the wrong IPS patch or something. Plus would IPS Patches even work with such file format anyway? And to find an exploit inside the OS itself it will be much more work, not to mention it might end up getting patched by HP if it was the result of a glitch. So your idea could be something worth investigating.
You can't really brick the calc as long as the recovery firmware works afaict.
IPS patches are universal binary patches.
As for the exploit there's none to find. We can freely patch the OS, all we need it to hook a couple functions somewhere and we're all set.
My idea is still much easier to implement and won't require us to update the patches for each new HP OS. As long as we don't mess with exam mode we shouldn't have to fear HP.
Title: Re: Let's hack the HP Prime!
Post by: Vogtinator on November 11, 2014, 04:36:53 pm
Quote
My idea is still much easier to implement and won't require us to update the patches for each new HP OS. As long as we don't mess with exam mode we shouldn't have to fear HP.
The bad thing about a shell is that you can't see whether it's active. For ndless, you have a way to remove it certainly (filesystem format) but is there a similiar way on the HP?
Also, I'd it visible that there is possibly custom code running by displaying a message like ndless does on the home screen, that way you'll likely not get in trouble. At least I hope so :)
Title: Re: Let's hack the HP Prime!
Post by: Streetwalrus on November 11, 2014, 04:38:09 pm
Well since the shell runs before the os, it's more of a bootloader. Except that we won't try to patch the OS itself.
Title: Re: Let's hack the HP Prime!
Post by: Vogtinator on November 11, 2014, 04:40:19 pm
I would rather call that technique a rootkit :P