Subject: ARM and RPM

From: [email-masked]
Date: Wed, 24 Jun 1998 13:22:30 -0400 (EDT)

I'm working on RPM and designing a rpmrc we can all live with.
I need to know what "uname -m" people see other than "sa110",
and what the ARM architecture is for that processor.

Thanks.

-- 
Andrew E. Mileski           mailto:[email-masked]
Software Developer
Corel Computer Corp.        http://www.CorelComputer.com/
OSC-CCC Technical Liaison   http://www.NetWinder.org/
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Matthew Wilcox <[email-masked]>
Date: Wed, 24 Jun 1998 18:57:45 +0100 (BST)

[email-masked]
> and what the ARM architecture is for that processor.

You can find all the details in linux/arch/arm/kernel/setup.c
`arm2', `arm250' and `arm3' are all ARM Architecture 2 processors.  ie
they only have 26-bit modes.
`arm6', `arm610' `arm7' and `arm710' are ARM Architecture 3 processors.
For applications, this should be no different to `sa110' (which is ARM
Architecture 4).
If an `arm810' machine is ever supported, this is also ARM Architecture 4.
I doubt Linux will ever support the `arm1'  ;-)  Though if anyone fancies
it I know someone who has one... ;-)

-- 
Set Alias$Case Set Alias$[ |||| |MSet Alias$Otherwise Set Alias$[ \ Matthew
"" |MSet Alias$When If %0=%%0 Then Set Alias$[ "" ||MIf %0=%%0    \ Wilcox
Then Set Alias$Otherwise Set Alias$[ |||||||||||||||| ||MIf       \
%0=%%0 Then Set Alias$When Set Alias$[ ||||||||||||||||
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Philip Blundell <[email-masked]>
Date: Wed, 24 Jun 1998 20:37:01 +0100

>it I know someone who has one... ;-)

It would certainly have giggle value, but I think it might be a bit too 
painful.

p.

---

From: Neal Crook <[email-masked]>
Date: Thu, 25 Jun 1998 08:35:52 +0100

>From the ARM ARM (Architecture Ref. Manual):

"Architecture "Version 4" added halfword loads and stores, sign-extending byte and
half-word load, a new privileged mode and defines several new undefined instructions"

The ARM7, ARM710, StrongARM1 (eg SA-110) are all Version 4 architectures, as is ARM9.
In fact, Most ARM7 are ARM7T (they include the Thumb instruction set) which is
architecture 4T.

Neal.

---

From: Matthew Wilcox <[email-masked]>
Date: Thu, 25 Jun 1998 11:14:04 +0100 (BST)

Neal Crook
> In fact, Most ARM7 are ARM7T (they include the Thumb instruction set) which is

Incorrect.  ARM710 is Architecture 3.  All Thumb cores are Architecture 4.
This does include the ARM7T.  There do not exist any processors which
support both Thumb and 26-bit modes, therefore the ARM710 which runs
RISC OS in 26-bit mode does not have Thumb.  ARM8, ARM9 and StrongARM
cores are all Architecture 4.

---

From: Stefan Hanske <[email-masked]>
Date: Fri, 26 Jun 1998 11:19:05 +0200 (METDST)

> and what the ARM architecture is for that processor.

You can have a look at the kernel source, esp. the file 
arch/arm/kernel/setup.c. There is a list of all known processors declared 
and how they are names. This is mostly the same way, ie. arm710, arm610, 
arm3, arm250, arm3...
(I'm not sure anymore if it's arm600 or arm6).

----------------------------------------------------------
|mailto: Stefan Hanske ([email-masked] |
|WWW : http://www.rzuser.uni-heidelberg.de/~shanske      |
|phone: I'm not silly                                    |
|--------------------------------------------------------|
| And don't forget to remember what you remembered not   |
| to forget to remember...				 |
----------------------------------------------------------

---

From: Stefan Hanske <[email-masked]>
Date: Fri, 26 Jun 1998 11:21:56 +0200 (METDST)

> it I know someone who has one... ;-)

What's that one, actually. Is it the 6502 ??? This would *really* be a 
gag, having Linux running on that. I know about some sort of unix shell 
emulation that was running on C64, but it was nothing at all.

---

From: Matthew Wilcox <[email-masked]>
Date: Fri, 26 Jun 1998 12:00:48 +0100 (BST)

Stefan Hanske
> emulation that was running on C64, but it was nothing at all.

No.. The 6502 was the 6502, manufactured by Motorola.  The ARM1 came in
a BBC copro case with up to 4MB of RAM, iirc.  They're rather rare and
difficult to get hold of, and I'd love to offer a good home to one..

You certainly couldn't get a modern unix running on a 6502, though
original development was done on a machine with a 64k address space,
so you could maybe port 6th Edition if you have a degree in Advanced
Masochism.  And the source code is even in the Lions book, and it's only
10,000 lines.

---

From: David Alan Gilbert <[email-masked]>
Date: Fri, 26 Jun 1998 12:49:34 +0100

Stefan Hanske wrote:
> What's that one, actually. Is it the 6502 ??? 

No, the ARM1 is rather like an ARM2, but the LDR/STR instructions can take
address offsets with register based shifts (i.e. the address offset is
basically the same as a data opp second operand I think) - you'll
notice that the hole where the undefined instructions are corresponds to that.
I think there was some other differences as well (copro support??)
but thats the one I remember.

Dave

-- 
----------------------------------------------------------------------
- Dr. David Alan Gilbert - WARNING! This is a beta release .signature-
- Work:    dg @ cogency.co.uk        - +44-(0)161-428-9444           -
- Home:    gro.gilbert @ treblig.org -                               -
----------------------------------------------------------------------
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Richard Bradbury <[email-masked]>
Date: Fri, 26 Jun 1998 13:32:05 +0100

> and what the ARM architecture is for that processor.

I've always been baffled by "uname -m".  It is supposed to return the
machine architecture, but in fact returns the CPU type.  The Intel Linux
box I use returns "i586" and the variety of other Unix boxes I use give
things like "alpha", "sun4u", "RISC" (a MIPS chip) and "9000/725"
(HP PA).

A newer version of GNU uname (1.16) offers the "-p" option for processor
type.  This should really be where things like "i486", "arm710", "sa110"
and so on should appear.

So the question is what can "-m" usefully return?  Should it be a generic
CPU architecture ("ix86", "alpha", "arm3", "arm4") or should it be an
indication of the hardware type ("a5k", "riscpc", "phoebe", "ebsa",
"shark", "cats", "netwinder")?

The trouble is that with some PCs and workstations, the CPU type implies
a particular machine architecture: Intel chip means IBM PC with ISA and
PCI buses.  This is clearly not the case for the wide variety of ARM
Linux machines already out there.

At the end of the day, I think it's got to be about binary compatibility.
If two machines can run the same set of binaries, then they should return
the same value for "uname -m".

In a multi-platform Unix environment, I want to be able to write things
like:

  PATH=$PATH:$HOME/bin/`uname -m`_`uname -s`

In fact, we run a special version of "arch" here which sorts everything
out automatically.  For example, "arch -bin" reports the correct generic
binary directory name: "ix86_linux", "alpha_osf1", "mips_ultrix", etc.
In other words, it makes up for the deficiencies of "uname" as
implemented in 57 different varieties by the Unix community.

For ARM Linux we could have "arm4" for architecture version 4 CPUs and
"arm3" for older processors.  Or simply "arm" for everything.

Comments anyone?

-- 
R.

---

From: Matthew Wilcox <[email-masked]>
Date: Fri, 26 Jun 1998 16:47:12 +0100 (BST)

David Alan Gilbert
> notice that the hole where the undefined instructions are corresponds to that.

... except they don't actually work ;-)

> but thats the one I remember.

The biggy is MUL.  Anyone up for writing a MUL-emulator..?  ;-)

---

From: Alan Cox <[email-masked]>
Date: Fri, 26 Jun 1998 17:52:22 +0100 (BST)

> things like "alpha", "sun4u", "RISC" (a MIPS chip) and "9000/725"

i386,i486,i586 and i686 are architectures, just like sun4c sun4d sun4e
sun4m and sun4u

> "shark", "cats", "netwinder")?

It should report the CPU class arm3/arm4 etc

> "arm3" for older processors.  Or simply "arm" for everything.

arm3/arm4 feels right

---

From: Philip Blundell <[email-masked]>
Date: Fri, 26 Jun 1998 18:48:03 +0100

>"arm3" for older processors.  Or simply "arm" for everything.

I'd suggest just `arm' for everything.  As you say, there are other ways to 
find out the precise CPU type if you want it.  Having `uname -m' return the 
processor type just means that autoconf needs to be able to munge all of the 
possibilities back to generic `arm' and will mean updating all these scripts 
when a new CPU comes along.

(Also, I believe this is more in line with what other Linux ports do.)

p.

---

From: Ian Jeffray <[email-masked]>
Date: Fri, 19 Jun 1998 09:50:25 +0100 (BST)

> notice that the hole where the undefined instructions are corresponds to that.

Yes... very odd... know why they did that?

> but thats the one I remember.

I thought that the ARM1 didnt have MUL ... but I could be wrong.

Ian
-- 
Ian Jeffray // Tel: 0131 346 0124 // Mobile: 0378 392 963 // [email-masked]

---

From: Paul Koning <[email-masked]>
Date: Mon, 29 Jun 1998 09:15:29 -0400

>>>>> "Alan" == Alan Cox <[email-masked]> writes:

 >> For ARM Linux we could have "arm4" for architecture version 4 CPUs
 >> and "arm3" for older processors.  Or simply "arm" for everything.

 Alan> arm3/arm4 feels right.

Agreed, but how about adding "t" for Thumb when present?  Or is that
not interesting for our purposes?

	paul

---

From: Philip Blundell <[email-masked]>
Date: Mon, 29 Jun 1998 14:54:40 +0100

>not interesting for our purposes?

It's not, really.  If somebody wanted to actually _use_ the Thumb instruction 
set then they could invent a name for that, but there's no real need to encode 
the mere presence of Thumb in the name.

p.

---

From: "Andrew E. Mileski" <[email-masked]>
Date: Mon, 29 Jun 1998 10:23:12 -0400

> (Also, I believe this is more in line with what other Linux ports do.)

This will make it difficult impossible distinguish an ARM3
compatible RPM from an ARM4 one.  RPM relies on "uname -m".

---

From: Richard Bradbury <[email-masked]>
Date: Mon, 29 Jun 1998 16:15:20 +0100

On Mon, 29 Jun 1998 10:23:12, "Andrew E. Mileski" wrote:
>
> > I'd suggest just `arm' for everything.
>

I was under the impression that there was only one set of ARM Linux
RPMs which ran on both ARM v3 and ARM v4 architecture CPUs.

I am mistaken, or is this a distinction made by the Corel port and not
by Russel's?  (What exactly _is_ the relationship between these two
ports?)  Is binary compatibility possible with a.out but not with ELF
due to memory management difficulties on ARM v3?

Did we ever decide whether the ARM610 was v3 or v4?  If the former, is
it right to lump the ARM3 and the ARM610 together given their
different memory management hardware?

So many questions...  I think I need a lie down :-)

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Mon, 29 Jun 1998 16:59:04 +0100 (BST)

> compatible RPM from an ARM4 one.  RPM relies on "uname -m".

However, as far as RPMs and user programs are concerned, there is
very little point in distinguishing between the processors alone.
For a.out, since everything runs in 26-bit mode, it is irrelevent.
For ELF, the fact that the binary runs in 32-bit mode doesn't
affect it's compatability with the older machines.  Currently,
the only thing that I can think is affected by the processor -
the floating point emulator.  On Acorn systems, the keyboard
mapping that is loaded is influenced by the processor type
(since an ARM3 can only mean an older keyboard, whereas ARM610
and up implies newer keyboard).

Ok, you could optimise the binaries, for instance, to use StrongARM
ldrh/strh instructions, but uname -m won't tell you if the machine
is capable of running these, since that is more dependent on the
platform than processor.  (RiscPC can't use StrongARMs ldrh/strh
instructions since IOMD isn't up to it).  It also won't tell you
the endianness of the machine, since that is again up to the
platform designers.

Hence, the use of 'uname -m' as it stands for selecting RPMs is
meaningless, whether it returns the processor architecture version
or the actual processor type.

Is there a hole here?  I think so, since on the ARM, the processor
type/architecture is not sufficient to completely define the
machine.  There is some extra information that is required to
properly define the machine type.

Since uname -m is supposed to 'Print the machine (hardware) type.',
it would make more sense if it returned something like:

	armv4h-little	for Corel's Netwinder/DECs EBSA285
	armv4-little	for Acorn's RiscPC with StrongARM
	armv3-little	for Acorn's RiscPC with ARM610/710

The older machines present some problem, because they don't have
a defined version.  However, we could say that ARM3 (with swp) is
version 2, and ARM2 without is version 1, so we end up with:

	armv2-little	for Acorn's A5000
	armv1-little	for Acorn's Archimedes

This then allows for the case where someone decides to build a
big-endian ARM system (quite possible, since the ARM chips
support it), and it's hardware type would be:

	armv4h-big

Obviously, these could be abbreviated to armv4hl, armv4l and
armv4b.  A more accurate description could be obtained by using

	armv4-riscpc

but I think that that would be going too far.

Note: arch (/bin/arch) uses the same source of information, so
any changes here also affects the output of this program as well.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.uk.linux.org/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Mon, 29 Jun 1998 17:03:32 +0100 (BST)

> the mere presence of Thumb in the name.

Except of you're RPMs were compiled for Thumb (and hence wouldn't work on
a StrongARM, for instance).  Don't forget that the Thumb instructions
are effectively a different dialect.

It would also be incorrect to use a separate new name for a Thumb-capable
processor since it is still capable of running the full ARM instruction
set.  Maybe this is something that can be addressed in the /usr/lib/rpmrc
using the compatibility matrix?
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.uk.linux.org/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

---

From: Philip Blundell <[email-masked]>
Date: Mon, 29 Jun 1998 18:17:31 +0100

>different memory management hardware?

The ARM3 is actually a v2 CPU.  The ARM6/7 is v3.

p.

---

From: "Andrew E. Mileski" <[email-masked]>
Date: Tue, 30 Jun 1998 16:01:37 -0400

> RPMs which ran on both ARM v3 and ARM v4 architecture CPUs.

StrongARM is ARM4 architecture, and not compatible with
ARM3 architecture processors.  The most notable difference
is half-word load/store.