Re: NetBSD ppc64 & ppc64le support?

Greg Troxel <[email protected]> Wed, 07 May 2025 19:19:14 -0400
Newsgroups gmane.os.netbsd.ports.ofppc,gmane.os.netbsd.ports.powerpc
Message-ID <[email protected]>
Chris Hanson <[email protected]> writes:

> On May 7, 2025, at 3:54=E2=80=AFPM, Greg Troxel <[email protected]> wrote:
>>=20
>> Chris Hanson <[email protected]> writes:
>>=20
>>> NetBSD appears to use the powerpc architecture name like FreeBSD but th=
e eb/el suffixes like Linux, so my first inclination is that the NetBSD arc=
hitecture names would be powerpc64 and powerpc64el.
>>=20
>> If you mean "should we change the code to align with X", idk.
>>=20
>> If you are asking "how are things now", then read build.sh.
>
> Thanks, looks like the MACHINE_ARCH is referred to as powerpc64 in build.=
sh so that=E2=80=99s what should probably be kept to so changes are minimal=
ly invasive.
>
> It also looks like there=E2=80=99s already a GENERIC64 kernel config for =
ofppc so maybe a different machine isn=E2=80=99t needed?

There are more or less three layers, and beware I'm a little fuzzy;

  MACHINE_ARCH which is equal to CPU type in that for a userland
  program across NetBSD, you just need the same MACHINE_ARCH.

  MACHINE is about more than just the CPU type, how you deal with the hardw=
are.

  then there is a kernel for specific hardware, and if it's reasonable
  to have one MACHINE for a group of hardware types, with different
  kernels, we do.  And if the same kernel can run on multiple hardware
  types, even better.

A good example of this grouping is evbarm which has a ton of boards, but
they are all close enough.  And some have separate kernels and multiple
different boards can run GENERIC.

ofppc seems to be a separate MACHINE, and there is sys/arch/ofppc.  I
would guess the whole way the kernel deals with the hardware is just
different enough.

Reading build.sh, I only really see eb/el for mips.  My guess is that
there were both kinds, from not-DEC and DEC, whereas ppc is more of an
IBM thing where ~everbody uses eb.