Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - TimKelly

Pages: [1]
1
Firmware / Migrating the build environment/true portability
« on: February 04, 2026, 12:04:30 pm »
Hi All,
I wanted to again express my appreciation to Raptor CS for access to the hardware. I used that access to do a lot of bare metal testing as well as access to the lowest levels of the firmware, in an effort to build a truly portable build environment.  This has been a fantastic learning experience.  I sent the following summary to Raptor a few months ago, but then took some time off from computers and failed to post the summary to the forums (unless my memory is worse than I remember).

I have done a lot of digging into the internal boot process, specifically the SBE, and while in theory the boot process can be replaced, in practice this appears to be extremely labor intensive.  I have been working with Public Domain POSIX Make

https://frippery.org/make/

to rewrite the Makefiles to be strict POSIX 2024.  The GNU syntax in the Makefiles ties the build process very closely to GNU toolchain.  They are not compatible with FreeBSD's make.  The solution is strict POSIX 2024, but there are 28 Makefiles and 30 .mk files that need to be rewritten.

Note that strict POSIX 2024 does not support out-of-tree building, where the source code is in one directory and the object files are in another.  The main cause (effect?) of this is that implicit target rules can not use variables, so $(OBJDIR).o: is not a valid target.  The IBM writers of the SBE Makefiles leaned very heavily on GNU's extensions, to the point where I would describe the effort as "lazy."  I suspect at least a few of the Makefiles were generated by scripts.

I have rewritten several Makefiles, enough to dig deeper into the SBE build process.  The C++ implementation/includes on FreeBSD are not compatible with Linux's C++ implementation.  The naming for #ifndef is different, leading to duplication of std functions.  In a particular case, xip, the two source files are .C, but one of them does not contain any C++ while the other only contains five lines total, out of 3,237 in the file.  That file fails to compile because of the duplicate:

In file included from p9_xip_tool.C:41:
In file included from /usr/include/c++/v1/string:591:
In file included from /usr/include/c++/v1/__algorithm/remove.h:12:
In file included from /usr/include/c++/v1/__algorithm/find.h:16:
In file included from /usr/include/c++/v1/__bit/countr.h:15:
In file included from /usr/include/c++/v1/__bit/rotate.h:15:
In file included from /usr/include/c++/v1/limits:581:
/home/tkelly/raptor/talos-sbe/src/import/chips/p9/procedures/ppe/pk/../include/std/type_traits:46:19: error: reference to 'integral_constant' is ambiguous
   46 |         const _Tp integral_constant<_Tp, __v>::value;
      |

This failure appears to trace to

std::string i_ddLevelStr;   //Same

which is used as

ddLevel = strtol(i_ddLevelStr.c_str(), NULL, 16);

or similar for a total of two assignments and four references.  Again, the word "lazy" comes to mind.

There are deeper uses of C++, of course, such as

numRingIds = P9_RID::NUM_RING_IDS;

The namespace for P9_RID can be found in

src/import/chips/p9/utils/imageProcs/p9_ringId.C

I do not see anything that could not have been accomplished with C99 or later.  I suspect these files were designed to be compatible with AIX and IBM's compiler, not to be portable.  I have never seen any C++ code that could not be accomplished with C and a simpler compiler.

There are 391 files in the SBE that have C++ :: operators, totaling 8,178 lines.  I do not see this as being readily portable to C, and as a result of conflicts with other operating system and compiler implementations of C++, not really portable at all.

The native Linux build environment for the SBE can not compile successfully.  I suspect that within Raptor the build environment has been steadily patched and an attempt to build from scratch has not been undertaken in some time.  I suspect that even simple changes upstream could have a devastating effect on Raptor, should it occur in certain places or if certain people leave (and their knowledge with them).  This is an unfortunately common experience, and in large software efforts can lead to terrible inertia.

The sheer complexity of the boot process and dependency on external parties leaves me with no choice but to stop development.  This is not an easy decision to make.  I am partial to PowerPC, and enjoy working so close to bare metal.  However, I can not see a path forward while maintaining the simplicity I am trying to implement.

I am deeply concerned about the performance limits with the RISC-V chips I have seen, but their simplicity and low cost offers the hint of a path forward.  Personally, I would really be excited to see Raptor hardware running multi-core RISC-V, if the "open" philosophy can be maintained.  I am deeply concerned that many of the major players in the RISC-V and Open Compute sphere are the very same players that have undermined openness in tech for decades.  I rarely find a RISC-V SBC that isn't actually tied to blobs required to run the proprietary peripherals, and even entire toolchains are vendor-dependent.  Don't even think about asking if the firmware can be replaced.

As I previously noted in another post, the SG2000 chip was actually a surprisingly good performer for the 1w of power it consumed, although something was clearly impeding it, possibly the i- and d-caches being very, very small.  However, Pine64 and Milk-V were able to deliver boards for as little as $13.

Say it was possible to scale up to a 64 RISC-V core like the SG2000 (which I think is embargoed in the U.S. now), and it consumed 64 watts at peak power.  From my (homemade real-world integer-based) benchmarks, it would take 1.4 times to complete a parallel task as would a 16 core Raptor system (running SMT4), at half the power consumption (each one takes 76 times the elapsed time on the 64 thread Raptor system).  To me this hints of a cost-effective opportunity to scale multi-CPU, with some hardware enhancements.  Just a thought.

Again, my many thanks to Raptor CS and their efforts.

tim

2
Hi Everyone,
Raptor and I have collaborated on establishing a bare metal development environment for FreeBSD, currently at 14.3:

$ uname -a
FreeBSD FreeBSD_LE 14.3-RELEASE FreeBSD 14.3-RELEASE releng/14.3-n271432-8c9ce319fef7 GENERIC powerpc
$ lscpu
Architecture:            powerpc64le
Byte Order:              Little Endian
Total CPU(s):            32
Model name:              IBM POWER9

We are supporting little-endian FreeBSD.  This is provided and hosted by Raptor (thanks!!!).   The details of the installation (for big-endian FreeBSD) are available at

https://wiki.raptorcs.com/wiki/Installing_Big-endian_FreeBSD

but the implementation is transparent.   I also added a couple new wiki entries over at the

https://wiki.raptorcs.com/wiki/Main_Page

on installing Bigendian FreeBSD on a QEMU VM, if you want to try that, as well as profiling SMT performance on Debian on bare metal.

If you are interested in developing within the FreeBSD development environment or porting software to Raptor machines on bare metal FreeBSD, please let me know.  In particular, the PMCs are not being handled properly and the power usage monitoring doesn't even exist.  This prevented me from doing a full apples-to-apples comparison against Debian, as the two OSes handle SMT very differently.  Please note this is not an endorsement  of FreeBSD, nor am I a FreeBSD developer or associated with them.

tim


3
Applications and Porting / [DEV] applying patches to old version of gcc
« on: September 10, 2025, 06:20:11 pm »
Hello,
I am currently trying to build the Self-Boot Engine component natively on a Raptor Blackbird, running Debian

 # uname -a
Linux 99-224-155-23 6.1.0-37-powerpc64le #1 SMP Debian 6.1.140-1 (2025-05-22) ppc64le GNU/Linux

It has gcc/g++ 12.2.  Unfortunately, the SBE code has code that violates C++17 standards, which were implemented with g++ 11.  I need to build gcc/g++ 10, which is not supported so there not a binary package available.  However, the source code is available at

https://sources.debian.org/src/gcc-10/10.2.1-6/debian

It does not compile

 build/genhooks -d \
       ../.././gcc/doc/tm.texi.in > tmp-tm.texi
 genhooks: No place specified to document hook TARGET_ASM_OPEN_PAREN

The solution to this appears to apply patches as noted at

https://lists.debian.org/debian-gcc/2011/10/msg00002.html

Patches to Debian for gcc are available at

https://sources.debian.org/src/gcc-10/10.2.1-6/debian/patches

The problem is I can not see a unified patch that applies all of them, nor can I figure out which ones I will specifically need, since many of them are architecture and language specific.  I applied one patch, bootstrap-no-unneeded-libs.diff, but it failed on one of the two files.  It may be due to necessary changes that other patches apply.

Does anyone have any advice?  I am not particularly versed with Linux or gcc (not my preferred development environment).

Thank you,
tim

4
Firmware / Cross-build compiler environment for SBE
« on: September 08, 2025, 01:58:22 pm »
Does anyone have a link to the directions to build the cross-build compiler environment necessary to compile the Self-Build Engine source code?  The source code has many references to

# Makefile for P9-XIP image code and tools; works on X86 Linux hosts.

ifndef GCC-TOOL-PREFIX
GCC-TOOL-PREFIX = $(CROSS_COMPILER_PATH)/bin/powerpc-eabi-
endif

TCC     = $(PPETRACEPP_BIN_DIR)/ppetracepp $(GCC-TOOL-PREFIX)gcc
CC      = $(PPETRACEPP_BIN_DIR)/ppetracepp $(GCC-TOOL-PREFIX)gcc

I would like to build that cross-build environment natively on Debian on Raptor, as part of my effort to port the building of SBE to strict POSIX 2024 for portability to other build environments.

Thank you,
tim

Pages: [1]