Linux is coming to the Prime.
It should have been there a long time; the chip it runs on, the S3C2416, has been supported for a long time. Recently gaining access to tools for jtag, I decided I would go and connect things up, not realizing that the newer revision of Prime didn't even have jatag pins broken out on the front of the board. I bought a prime, and started working.

Tonight, I got up and running with a shell. There's nothing else here but the shell, actually, and many things don't work. But I got the LCD and serial port working, which is easily enough to test with.

Here's a picture of the shell up and running on tty0:


The sources can be found on my github:
linux
ripem build with loader
qemu for Prime
Since I don't have a good setup for the initramfs running right now, I'm going to figure out how to get buildroot up and running. As long as I'm not too busy with school, I'll figure out how to make a keyboard driver and get the rest of the theoretically working platform drivers (usb, touchscreen) working. If anyone wants to help, go ahead!

x-posting this to Omni and CW
Wow, that's neat! Is it just a proof of concept right now and you hope to find out the limitations of the calculator, and/or do you have specific goals in mind that you hope to achieve?
I didn't really have many plans for this, really, so I guess a little of both. I'd like to get it to be a small, portable linux machine, but I don't really have any real endpoints to reach for.
Congrats on getting this running! I hope there's enough space for getting USB host-mode, wifi+WPA, and an IRC client running on it Wink

I'm assuming you've only been using jtag for this, but have you considered testing sending this as a firmware update? I'm assuming you'd have an easier time recovering from problems with jtag accessible. There are some docs floating around (I have some on a borked wiki) about the update procedures, not sure where libhpcalcs is on this.
Right now, everything fits inside a 2M image, but that is only a busybox with sh and init, and the kernel. There are no other utilities, so far at least. The prime has 256M of flash available, and I'm pretty sure that is relatively easy to get working with Linux.

This is sent as a firmware upgrade, in fact. I just replace the PRIME_OS.ROM in the firmware directory with my own, and the prime updater uploads the image.

The newer revision of Prime doesn't have jtag accessible like those seen in https://www.cemetech.net/forum/viewtopic.php?t=11158, sadly. If I can't do anything else, and need recovery I will try looking at the back of the board, but I'd like to avoid that if possible.
Hooloovoo wrote:
The newer revision of Prime doesn't have jtag accessible like those seen in https://www.cemetech.net/forum/viewtopic.php?t=11158, sadly. If I can't do anything else, and need recovery I will try looking at the back of the board, but I'd like to avoid that if possible.

If there's anything dangerous that you need to test, I still have mine in working order that should be old enough to have JTAG pads exposed.
Very cool Hooloovoo!

Have you looked into any options for having a loader/launcher from the PrimeOS? I wonder if any of the image loading code or similar would allow us to get code exec such that we don't have to replace the whole OS.

Plan B would be get something like Octave or xcas running so it can still be used as a calculator. that said I have no clue how much space we actually have on there with a working system.
I haven't looked into it, but I expect that a loader program wouln't be extremely difficult.
I'm not sure that those would be very happy with the 32M of ram, but I'm not really sure. I'd have to do some experiments once everything is somewhat working.
Hooloovoo wrote:
I haven't looked into it, but I expect that a loader program wouln't be extremely difficult.
I'm not sure that those would be very happy with the 32M of ram, but I'm not really sure. I'd have to do some experiments once everything is somewhat working.

IIRC the primes actual CAS is built on xcas or at least was rumored to be when it was released so I suspect that would be doable. Octave would likely want more ram though yeah.
Yes, the Prime's OS uses a patched version of giac/xcas. Upstream fixes and improvements are being integrated upon every release, but at the time of every release, the giac/xcas version (mostly) frozen several weeks earlier is effectively outdated, obviously.

While I'm all for arbitrary OS running on any platform, as shown by my useless third-party firmware PoC three years ago, the urgency to exploit the Prime's standard OS is made much lower than on the Nspire by HP's open stance and the ease of replacing the Prime's OS Smile
The move would obviously be followed by retaliation from HP and locking down the platform, though real lockdown might not occur until people mess with the exam mode, as stated by the development team: http://www.hpmuseum.org/forum/thread-4707-post-42038.html#pid42038 .
There's another post from either Tim Wessman or Cyrille de Brébisson, clearly spelling out that they'd have to quickly fix any vulnerability used by a native code exploit in the standard OS, and IIRC start locking stuff down (which would take away time from actual feature development), but I can't find it now.
Wow!! I remember working on the jtag my sophomore year and now this is finally happening! I'm super happy to see this after so long :) Great work! Too bad the new prime doesn't have any jtag pins though, I really love this calculator and it has saved me many a time on tests...

I still have all the hardware and the original jtag'd prime, so maybe I can lend a hand if anything dangerous needs to be tested... I need to make time for this hobby again.
Great to finally have Linux on the HP Prime! Very Happy

I managed to compile the kernel but is there any info on actually building a boot image?
I used a basic busybox image. I haven't built it in a while, but I think the last config I used was http://hooloovoo.blue/files/busybox.config
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement