Upgrade for RiscLua 5.70 on the RPi2
GavinWraith (26) 1563 posts |
You can download an upgrade for RiscLua 5.70, on the Raspberry Pi 2 only, from http://www.wra1th.plus.com/lua/risclua.html . Drag the upgrade over a copy of !lua to get an RPi2-optimized version, but be careful not to use it on systems that do not use the Cortex-A7, such as the earlier Raspberry Pi. |
Jeffrey Lee (213) 6048 posts |
Hmm, perhaps we could do with a tutorial (or library?) on how to correctly detect CPU/FPU features. Then at the least it should be able to pop up an error saying “sorry, I don’t run on this CPU”. |
GavinWraith (26) 1563 posts |
Here is a little BASIC program that will tell you if your computer is OK for the upgrade for RiscLua. It is very specialized. A general feature-detector would be a much bigger beast. Sorry it is a rabbit out of a hat.
|
Rick Murray (539) 13806 posts |
As an alternative, you could ask the HAL? After determining the CPU type, the Pi revisions field is thus. Here is some code I have to detect running on a Pi, as a certain API feature gets messed up in interesting ways on the Pi (and only the Pi) if probing is attempted. So, I detect this.
This works by looking to see if the processor type is ‘2’ (BCM blah blah). If so, you’ll need to probe the board type (returned in offset +64 or +68 (I forget which) – do This stuff really really ought to be a simple OS_ReadSysInfo call… |
Jeffrey Lee (213) 6048 posts |
Hmm, perhaps I should have said “how to properly detect” instead of “correctly”. Or made it 40pt bold flashing text. Gavin’s on the right track (check the CP15 instruction set feature registers), but falls a bit short because it doesn’t check to make sure the feature registers exist. However Rick’s method is much worse because it checks against a hardcoded list of known hardware, meaning that it’s guaranteed to fail on all new machines. |
GavinWraith (26) 1563 posts |
I am in awe of those who can mess with this stuff. I formulated the BASIC program above by looking at http://infocenter.arm.com/help/topic/com.arm.doc.ddi0464f/BABCIIJC.html . I suppose it is a question of experience. But it would be nice to be able to ask why? occasionally. I wonder if there is any mileage in hearing a manual spoken aloud? set to music? interpreted in dance? Dame Millicent will now sing excerpts from the chapter on the Window Manager from Vol III of the RISC OS PRMs, accompanied by the massed choirs of several notable usergroups . |
Rick Murray (539) 13806 posts |
That can be done. Use styles. ;-)
For his needs, yes. He requires a specific processor feature.
Given that the Pi IIC breaks if you try sending requests to invalid IIC buses (result: system configuration reverts to defaults and cannot be altered (until system rebooted)), all I needed to know was “it’s a Pi”. I use the processor type for this as when I wrote the code we already had four different types (old B, new B, A, module). The alternative is what, exactly? Poke around looking for certain modules like BCMVideo? Can you say that will never change?
Because Acorn made their own machines and their own OS, the system is actually rather bad at identifying itself. OS_ReadSysInfo should be able to tell you the machine type; and Gavin’s information should be somewhere in OS_PlatformFeatures (if I remembered the name correctly). Machine type and processor capabilities ought to be a SWI call away, not this complicated. |
Jon Abbott (1421) 2641 posts |
Totally agree, there should be an agreed CPUID list and an OS_ReadSysInfo call to retrieve the current CPUID. The code I use in ADFFS is as follows (untested on OMAP, Pi2 etc). PXA and Iyonix complicate things somewhat as their ID’s are lower, so I add &1000 so <>StrongARM comparisons still work. CPUID – CPU type
|
Jeffrey Lee (213) 6048 posts |
Given that the Pi IIC breaks if you try sending requests to invalid IIC buses (result: system configuration reverts to defaults and cannot be altered (until system rebooted)), all I needed to know was “it’s a Pi”. I use the processor type for this as when I wrote the code we already had four different types (old B, new B, A, module). The alternative would have been to realise that providing example code for detecting buggy OS versions is somewhat off-topic from a discussion about detecting CPU features, and to have kept your trap shut ;-) More seriously though, have you submitted a bug report for that IIC issue? It sounds like a pretty serious bug, and one that should be pretty easy to fix. Remember that we can’t be relied upon to fix bugs if we don’t know that they exist! |