Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Jan 2019 11:34:07 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Jonathan Chen <jonc@chen.org.nz>, freebsd-arm@freebsd.org
Subject:   Re: What's the difference between armv6 and armv7?
Message-ID:  <1546367647.78877.105.camel@freebsd.org>
In-Reply-To: <CAJuc1zPRyNkzAMZxS2wSyJa4JVSdOLLo5kogRssZUOJMBiPQ8A@mail.gmail.com>
References:  <CAJuc1zPRyNkzAMZxS2wSyJa4JVSdOLLo5kogRssZUOJMBiPQ8A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 2019-01-02 at 06:36 +1300, Jonathan Chen wrote:
> Hi,
> 
> Sorry if this sounds like a simple question, but what is the
> difference between armv6 and armv7 TARGET_ARCH? I had opportunity to
> try out both for STABLE-12 the past few days, and the resultant
> kernel
> and binaries both work for the RPI2. The file(1) output doesn't
> appear
> to offer any distinguishing features either:
> 
> rpi2:~,6:35am> file /usr/bin/true
> /usr/bin/true: ELF 32-bit LSB executable, ARM, EABI5 version 1
> (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for
> FreeBSD 12.0 (1200500), FreeBSD-style, stripped
> 
> Thanks

For a long time, freebsd made no distinction between armv6 and v7 and
everything worked pretty well. The few places where the minor
differences between v6 and v7 mattered were in the kernel, and it
detected the hardware type at runtime and coped.

Pretending that v6 and v7 were the same caused problems mainly for
ports, which  sometimes compile differently for v6 and v7 (they use
#ifdef). Running a v6 kernel and world on v7 hardware may mostly work,
depending on which ports/pkgs you use, but that's really an accident.

The only real armv6 systems that freebsd supports are the original rpi
and rpi-b (the ones with the single-core processor). Everything else is
v7 for 32-bit or v8 for 64-bit. Your rpi-2, being multi-core,
definitely needs to be running v7.

To see the difference in a binary, use "readelf -A" and look
for Tag_CPU_arch in the output. (I guess file(1) should be taught to
find those tags and report the file type with more detail.)

-- Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1546367647.78877.105.camel>