Post Reply 
Linux already on HP Prime G2!
07-16-2019, 01:10 AM (This post was last modified: 07-16-2019 04:22 PM by compsystems.)
Post: #1
Linux already on HP Prime G2!
https://tiplanet.org/forum/viewtopic.php?p=244225

[Image: 7ISmr82t.png]
Full xcas someday =)

LO SUFICIENTEMENTE BUENO ES ENEMIGO DE LA EXCELENCIA.
Find all posts by this user
Quote this message in a reply
07-16-2019, 07:19 AM
Post: #2
RE: Linux already on HP Prime G2!
Very interesting, but risky. It requires G2 with hardware mods, including weldings.
Find all posts by this user
Quote this message in a reply
07-17-2019, 02:03 PM
Post: #3
RE: Linux already on HP Prime G2!
A very promising advance!
Once all the reverse engineering data is collected (he got a lot already), we shouldn't need any hardware mods anymore. The only reason for the hardware mods is to boot in the chip manufacturer mode, before loading any bootloader or firmware from HP. Having alternative firmware loaded by HP's boot loader and updated through the HP Prime connectivity kit should be possible, but more information is needed before anyone can get that done. It was done by Boric for the G1, there's no reason to think the ROM format for the G2 would be too different, but so far nobody knew what to put in that alternative ROM. Now there's at least a few pieces of the puzzle.
Find all posts by this user
Quote this message in a reply
07-17-2019, 05:29 PM
Post: #4
RE: Linux already on HP Prime G2!
Well, just about the only thing in common between G1 and G2 is that they look identical externally. They have completely different hardware, firmware, OS, recovery, booting mechanism and so on. Also, unlike the G1 we can't just hitch a ride on HP's firmware because a chain of trust is enforced (however, a root of trust is not enforced, so booting non-HP firmware is possible through the SoC's recovery, it does require opening the calculator up but hardware mods aren't necessary, I guess Zephray never tried to apply 3.3v on TP907 during reset).

I've had SoC's recovery and JTAG running since last December, but I just couldn't get the gosh darn DDR controller to work. That's the main breakthrough of Zephray (alongside reverse-engineering most of the hardware on the way) which allows running U-Boot and Linux on the calculator. I'm must say I'm thoroughly impressed by how quickly Zephray achieved such results in less than a week. Then again, reverse-engineering hardware is really not my cup of tea, it's cool seeing in action someone who actually knows what they're doing at this stuff.
Find all posts by this user
Quote this message in a reply
07-18-2019, 01:53 AM
Post: #5
RE: Linux already on HP Prime G2!
(07-17-2019 05:29 PM)Jean-Baptiste Boric Wrote:  Well, just about the only thing in common between G1 and G2 is that they look identical externally. They have completely different hardware, firmware, OS, recovery, booting mechanism and so on. Also, unlike the G1 we can't just hitch a ride on HP's firmware because a chain of trust is enforced (however, a root of trust is not enforced, so booting non-HP firmware is possible through the SoC's recovery, it does require opening the calculator up but hardware mods aren't necessary, I guess Zephray never tried to apply 3.3v on TP907 during reset).

Are you sure you can't replace the firmware? I don't know the specifics of this particular chip but in general even when enforcing secure boot only the lowest level bootloader needs to be signed (usually called BL1 or similar). Once the internal boot ROM verified that signature, control is transferred and it's entirely up to that code what can be loaded, and most other security features are just sitting there waiting to be enabled by that same signed code, if it doesn't do it then we are good. Typically that BL1 loads another 2nd stage bootloader like uboot, but that one only needs to be signed if whoever wrote BL1 requires it. Unless HP specifically required their firmware to be signed it shouldn't be. Perhaps there's some kind of checksum used to check integrity, but I don't think any signature would be required.
I think I remember a comment from Tim stating it wasn't locked but they had all the means ready to do so if somebody messed with the exam mode.

(07-17-2019 05:29 PM)Jean-Baptiste Boric Wrote:  I've had SoC's recovery and JTAG running since last December, but I just couldn't get the gosh darn DDR controller to work. That's the main breakthrough of Zephray (alongside reverse-engineering most of the hardware on the way) which allows running U-Boot and Linux on the calculator. I'm must say I'm thoroughly impressed by how quickly Zephray achieved such results in less than a week. Then again, reverse-engineering hardware is really not my cup of tea, it's cool seeing in action someone who actually knows what they're doing at this stuff.

The fact you got JTAG running shows they didn't try to activate the security features, since Freescale includes secured JTAG as well. These newer CPUs are much harder to bring up than the older generations so don't feel bad, I agree his progress was incredibly fast, a very talented individual.
Find all posts by this user
Quote this message in a reply
07-18-2019, 04:06 PM
Post: #6
RE: Linux already on HP Prime G2!
(07-18-2019 01:53 AM)Claudio L. Wrote:  Are you sure you can't replace the firmware? I don't know the specifics of this particular chip but in general even when enforcing secure boot only the lowest level bootloader needs to be signed (usually called BL1 or similar).

As I said, HP's firmware enforces a chain of trust, but the hardware does not enforce a root of trust. We can boot whatever we want, whether it's from the SoC's recovery or the NAND. However, once the calculator runs HP's official firmware it's a one-way trip until reset. The chain of trust extends to HP's official recovery, so you can't upload an unofficial firmware through it.

So yes, the firmware can be replaced, but unlike G1 we can't hitch a ride on HP's official firmware. Once HP's code runs, it's effectively game over until reset.
Find all posts by this user
Quote this message in a reply
07-18-2019, 08:44 PM
Post: #7
RE: Linux already on HP Prime G2!
(07-18-2019 04:06 PM)Jean-Baptiste Boric Wrote:  As I said, HP's firmware enforces a chain of trust, but the hardware does not enforce a root of trust. We can boot whatever we want, whether it's from the SoC's recovery or the NAND. However, once the calculator runs HP's official firmware it's a one-way trip until reset. The chain of trust extends to HP's official recovery, so you can't upload an unofficial firmware through it.

So yes, the firmware can be replaced, but unlike G1 we can't hitch a ride on HP's official firmware. Once HP's code runs, it's effectively game over until reset.

If you are right then, well... I guess HP slammed the door shut for us. It would've been nice to simply use the connectivity kit to flash alternative firmware like you did on the G1.
I'm thinking the right solution would be to somehow move HP bootloader to a different area of flash and put a more generic u-boot to boot from NAND (easier said than done unless you have done the hardware mod, even the simpler one you suggested of putting 3.3V on a test point would be a big deterrent for 99.9% of the users). Then a u-boot script could have a menu to either load HP's bootloader from the alternative location and launch it, or a custom firmware from the user.
In any case, just the fact it requires the users to open the calculators to do the mod means very few people would ever attempt it. What's the point in publishing anything for this platform if it's so hard to use it?

When the G2 was announced I had already started working on the newRPL port for the G1 (basic boot and drivers). I stopped because I thought there was no sense in working on yet another dead hardware platform, and was waiting and hoping for good news to start working on the G2 hardware. Now I'm afraid the G2 is as dead as the G1 for my use case. Even if we were able to do an open boot as I described above, only a couple of people would dare to do it.

This thread started as very good news, now I'm really disappointed.
Find all posts by this user
Quote this message in a reply
07-18-2019, 09:23 PM
Post: #8
RE: Linux already on HP Prime G2!
(07-18-2019 08:44 PM)Claudio L. Wrote:  When the G2 was announced I had already started working on the newRPL port for the G1 (basic boot and drivers). I stopped because I thought there was no sense in working on yet another dead hardware platform, and was waiting and hoping for good news to start working on the G2 hardware. Now I'm afraid the G2 is as dead as the G1 for my use case. Even if we were able to do an open boot as I described above, only a couple of people would dare to do it.

I would buy another G2 just for that purpose, just like I did a second 50g for newRPL, for which many thanks.

Cambridge, UK
41CL 12/15C DM15/16 71B 17B/BII/bII+ 28S 42S/DM42 48GX 50g 35s 30b/WP34S Prime G2
& Casios, Rockwell 18R :)
Find all posts by this user
Quote this message in a reply
07-19-2019, 01:20 AM
Post: #9
RE: Linux already on HP Prime G2!
(07-18-2019 09:23 PM)cdmackay Wrote:  
(07-18-2019 08:44 PM)Claudio L. Wrote:  When the G2 was announced I had already started working on the newRPL port for the G1 (basic boot and drivers). I stopped because I thought there was no sense in working on yet another dead hardware platform, and was waiting and hoping for good news to start working on the G2 hardware. Now I'm afraid the G2 is as dead as the G1 for my use case. Even if we were able to do an open boot as I described above, only a couple of people would dare to do it.

I would buy another G2 just for that purpose, just like I did a second 50g for newRPL, for which many thanks.

It's much more likely that someone would buy a pre-modded G2 with newRPL installed that could be easily updated with new code releases. Compare the price of a new G2 to that of a DM42, and have a look at Eric's ready-built WP34 for some ideas of feasibility.

~Mark

Who decides?
Find all posts by this user
Quote this message in a reply
07-19-2019, 02:45 PM
Post: #10
RE: Linux already on HP Prime G2!
(07-19-2019 01:20 AM)mfleming Wrote:  
(07-18-2019 09:23 PM)cdmackay Wrote:  I would buy another G2 just for that purpose, just like I did a second 50g for newRPL, for which many thanks.

It's much more likely that someone would buy a pre-modded G2 with newRPL installed that could be easily updated with new code releases. Compare the price of a new G2 to that of a DM42, and have a look at Eric's ready-built WP34 for some ideas of feasibility.

~Mark

Yes, assuming somebody would put the effort to buy, mod and re-sell a G2.
But that same person buying a modded G2 could:
a) Just buy a used (or new) G1 and never need a mod (and G1s price will come down, since the G2 is essentially identical but faster, there's no advantage whatsoever to the G1 vs G2). And I bet if the G2 marketing machine catches on, many people that already own a Prime would buy a G2 and sell their used G1's, bringing the price even further down.
b) For people that already have a G1, perhaps buy a G2 to be used as a Prime, then use their old G1s to flash newRPL.

I agree the price of DM42 is high, so is the 50g hardware nowadays. The G1 on the other hand, I can't think of any reason for the price to go up post-mortem. A quick historic review shows the calcs that became very expensive post-mortem had something unique or special, I don't see it on the Prime G1, since the G2 looks and works exactly the same save for the extra memory and speed (enlighten me if I'm wrong!).
Find all posts by this user
Quote this message in a reply
07-19-2019, 03:38 PM
Post: #11
RE: Linux already on HP Prime G2!
Of the entire population of all calculator users, what percentage of them use RPL? Of all those RPL users, what percentage of (them), would want a modified calculator in order to run RPL?

My sense is that by the time the population is filtered to those few that would buy a modified calculator, expressly for the purpose of using RPL, the actual number will be pretty small.

I have several calculators, many of them with RPL, and frankly, the only one I ever use is an hp prime (G2), anymore. In fact, most of my calc use is with the hp prime virtual calc, which I use pretty much every day. I would be completely content if RPL wasn't supported at all. RPL was a great idea, but python, and other computer software, makes even using a handheld calculator at all, less important than it ever was when RPL was the demand item.

It seems like RPL on the prime, is a tail-chasing exercise, with diminishing returns. If you have the "bound-to's" and are so driven that you have to prove this exercise, then no harm is done in the pursuit. If it is expected that running RPL on a modified calculator will be a huge forward techno-leap, I'm not thinking the masses will agree, or will beat a path to your doorway.

Good luck, it will be interesting to watch the activity unravel, one way or the other.
Find all posts by this user
Quote this message in a reply
07-21-2019, 10:52 AM
Post: #12
RE: Linux already on HP Prime G2!
(07-18-2019 01:53 AM)Claudio L. Wrote:  The fact you got JTAG running shows they didn't try to activate the security features, since Freescale includes secured JTAG as well.

I'm sure I recall CdB saying that they weren't going to make a big deal over security unless someone enables a way to fake the exam mode lights - and then they would have to crack down hard.
Find all posts by this user
Quote this message in a reply
07-23-2019, 08:48 AM
Post: #13
RE: Linux already on HP Prime G2!
(07-18-2019 01:53 AM)Claudio L. Wrote:  
(07-17-2019 05:29 PM)Jean-Baptiste Boric Wrote:  Well, just about the only thing in common between G1 and G2 is that they look identical externally. They have completely different hardware, firmware, OS, recovery, booting mechanism and so on. Also, unlike the G1 we can't just hitch a ride on HP's firmware because a chain of trust is enforced (however, a root of trust is not enforced, so booting non-HP firmware is possible through the SoC's recovery, it does require opening the calculator up but hardware mods aren't necessary, I guess Zephray never tried to apply 3.3v on TP907 during reset).

Are you sure you can't replace the firmware? I don't know the specifics of this particular chip but in general even when enforcing secure boot only the lowest level bootloader needs to be signed (usually called BL1 or similar). Once the internal boot ROM verified that signature, control is transferred and it's entirely up to that code what can be loaded, and most other security features are just sitting there waiting to be enabled by that same signed code, if it doesn't do it then we are good. Typically that BL1 loads another 2nd stage bootloader like uboot, but that one only needs to be signed if whoever wrote BL1 requires it. Unless HP specifically required their firmware to be signed it shouldn't be. Perhaps there's some kind of checksum used to check integrity, but I don't think any signature would be required.
I think I remember a comment from Tim stating it wasn't locked but they had all the means ready to do so if somebody messed with the exam mode.

(07-17-2019 05:29 PM)Jean-Baptiste Boric Wrote:  I've had SoC's recovery and JTAG running since last December, but I just couldn't get the gosh darn DDR controller to work. That's the main breakthrough of Zephray (alongside reverse-engineering most of the hardware on the way) which allows running U-Boot and Linux on the calculator. I'm must say I'm thoroughly impressed by how quickly Zephray achieved such results in less than a week. Then again, reverse-engineering hardware is really not my cup of tea, it's cool seeing in action someone who actually knows what they're doing at this stuff.

The fact you got JTAG running shows they didn't try to activate the security features, since Freescale includes secured JTAG as well. These newer CPUs are much harder to bring up than the older generations so don't feel bad, I agree his progress was incredibly fast, a very talented individual.
They said they will take steps "if somebody messed with the exam mode"?
Come on,according to their firmware ,I think they are too simple to block out others cracking their products.
They programed firmware badly ,which made it impossible to even use the storage space completely.
LMAO.
Find all posts by this user
Quote this message in a reply
Post Reply 




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