D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Java on Pi

 

On Fri, 15 Jun 2012, tom wrote:

On 15/06/12 12:25, Gordon Henderson wrote:
On Fri, 15 Jun 2012, tom wrote:

On intel and amd you can just:
cat /proc/cpuinfo
and more or less paste the flags into a make file and away you go.
I'm surprised arm doesn't do that.
Flags?

gordon @ pi0: fgrep -i flags /proc/cpuinfo
gordon @ pi0:

The full cpuinfo is:

gordon @ pi0: cat /proc/cpuinfo
Processor       : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 898.66
Features        : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 0002
Serial          : 00000000c6a516f6

Yes, that's a serial number and it's different for every chip. It's used
to initialise the Ethernet MAC...

eth0      Link encap:Ethernet  HWaddr b8:27:eb:a5:16:f6

The cpuinfo won't tell you if the underlying OS is compiled for armel or armhf, however th 'vfp' Feature is the floating point unit present. I don't have access to any other ARM processor to compare.
Maybe I'm being naive but when compiling/linking to get the best out of an app (or an OS for that matter) the flags (in my experience ) features from the above are used to guide the build. I'm surprised that a debian build specifically for the Pi doesnt take this into account from the start. And presumably the same can be done for the java for it.
Ask the Debian people for the definitive answer, but my interpretation is 
as follows: Debian chose to support only TWO ARM architectures; One with 
floating point and one without. On the floating point side, since there 
are several variants on the ARM, they chose that which comes with the 
ARMv7 architecture (and above). They treat ARMv6 and below as not having 
floating point. AIUI, ATMv7 FP instructions are not compatable with ARMv6, 
and vice versa, and Debian did not want to support what (presumably) they 
thought was a minority chip at the time they released Squeeze.
This is why there is an independant group of people producing a Debian 
release which does support the floating point natively on the ARM.
As far as apps are concerned, there are 2 conflicting ABIs in the ARM 
world. One which passes FP numbers in FP registers and one which passes 
them in integer registers - and I don't think it's easy to tell which your 
running on. The processor flags/features will not tell you because that 
was a decision made at distribution compile/implementation time. You can 
compile binaries to use the VFP instructions on the armel but you still 
need to know if you're compiling for armel or armfp. I understand the 
default ABI for the distribution is set in GCC.
Gordon

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq