Skip to content

Instantly share code, notes, and snippets.

View runlevel5's full-sized avatar

Trung Lê runlevel5

View GitHub Profile
@runlevel5
runlevel5 / chimera-linux-ppc64-qemu-install.md
Created July 2, 2026 09:18
Installing Chimera Linux (ppc64, big-endian) on a QEMU/libvirt VM

Installing Chimera Linux (ppc64, big-endian) on a QEMU/libvirt VM

This documents a from-scratch install of Chimera Linux on a pseries QEMU/KVM VM running on a POWER9 host, with a PReP boot partition and GRUB (powerpc-ieee1275 target).

Verification status: the GRUB/PReP step (grub-install /dev/vda1) and overall flow have been run for real and reported straightforward. Package names and dinit-specific commands below are verified against Chimera's actual repo and official docs, but the full sequence hasn't been run

@runlevel5
runlevel5 / arch-power-ppc64-install.md
Created July 2, 2026 08:49
Installing Arch POWER (ppc64 (big-endian) or ppc64le (little-endian)) on a QEMU/libvirt VM

Installing Arch POWER (ppc64 (big-endian) or ppc64le (little-endian)) on a QEMU/libvirt VM

This documents a from-scratch install of Arch POWER Linux distribution on a pseries QEMU/KVM VM running on a POWER9 host, with a PReP boot partition and GRUB (powerpc-ieee1275 target). It also captures every pitfall hit along the way — each one cost real debugging time, so they're called out explicitly rather than silently avoided.

Endianness note: this was run and verified end-to-end on powerpc64 (big-endian). Arch POWER also publishes a powerpc64le (little-endian)

@runlevel5
runlevel5 / quake3e_jit_bug.md
Last active June 30, 2026 02:52
quake3e JIT: value left live on the opStack is corrupted across a taken conditional branch (all backends)

JIT: value left live on the opStack is corrupted across a taken conditional branch (all backends)

Summary

When a value is left live on the QVM opStack across a conditional branch and the branch is taken, the compiled VM can return a wrong result. The bytecode interpreter produces the correct value. Reproduces on current master (fe57ee9) on all three JIT backends — x86_64 (vm_x86.c), aarch64 (vm_aarch64.c) and ppc64le (vm_powerpc.c) — deterministically, with a 13-instruction function: no data input, no syscalls, no undefined behaviour.

@runlevel5
runlevel5 / gist:8b4bbff69df87eeb9d25fcf0e29339cf
Created May 11, 2026 02:02
Raptor Blackbird firmware: upstream vs downstream forks
# op-build (open-power) vs Raptor downstream — comparison
Date: 2026-05-11
Our tree: `~/Work/op-build` on branch `bump-linux-6.12.87` / `amdgpu-navi23` (forks from open-power/op-build master @ `59464d53`)
Raptor tree: `~/Work/op-build-blackbird` at tag `raptor-v2.10` (Feb 15, 2024)
Raptor repo URLs:
- `gitlab.raptorengineering.com/openpower-firmware/machine-talos-ii/op-build.git` (used by our local clone)
- `gitlab.raptorengineering.com/openpower-firmware/machine-blackbird/op-build.git` (Blackbird-specific variant, shares most code)
@runlevel5
runlevel5 / nacl-ppc64le-porting.md
Created March 27, 2026 02:07
NaCl SFI Design for ppc64le

NaCl SFI Design for ppc64le

Overview

Google Native Client (NaCl) uses Software Fault Isolation (SFI) to sandbox untrusted native code. Each supported architecture has a unique SFI implementation. The closest existing analogy for ppc64le is the MIPS 32-bit port: both use fixed-length instructions, pure software isolation (no hardware segments), and dedicated mask registers.

NaCl currently supports: x86-32 (hardware segments), x86-64 (base register + zero-extension), ARM 32-bit (bic masking), and MIPS 32-bit (mask registers). No PPC support has ever existed.

Common SFI Invariants (All Architectures)

@runlevel5
runlevel5 / gog_installer_unsupported_platform.md
Last active February 25, 2026 05:51
How to run GOG Installer (mojosetup) on unsupported architecture?

Installing GOG Games on Unsupported Architecture with Native MojoSetup

GOG's Linux game installers (.sh files) are Makeself archives that bundle a custom mojosetup binary (x86_64) to handle the installation UI and file extraction. On non-x86 architectures like PPC64LE or RISCV, the bundled binary won't run natively. This document describes how to compile mojosetup from source for your architecture and use it to run any GOG .sh installer, with support for stdio, ncurses (TUI), GTK2, GTK3, and GTK4 (graphical) interfaces.

Background

@runlevel5
runlevel5 / vinsertd_vextractd_ppc64le.md
Created February 19, 2026 12:05
PPC64LE's behaviour of vinsertd/vextractd

test_vinsertd.c:

#include <stdio.h>
#include <stdint.h>
#include <altivec.h>
typedef union {
    vector unsigned char v;
    uint64_t u64[2];
    uint32_t u32[4];
@runlevel5
runlevel5 / PLAN.md
Created February 8, 2026 13:17
Improvement plan to speed up Yamagi Quake 2 software renderer

SIMD Optimization Plan for the Software Renderer

This document covers the feasibility analysis and implementation plan for adding SIMD acceleration to the Yamagi Quake II software renderer (src/client/refresh/soft/).

Table of Contents

  1. Architecture Overview
  2. Current Bottlenecks

Great choice! Monkey Island 1 (The Secret of Monkey Island) uses the SCUMM engine (v5) and has well-established tooling. The Talkie CD version adds voice acting, which you'd keep while translating text. Overview You'll need to:

  1. Extract text strings from game data
  2. Translate to Vietnamese
  3. Create/modify fonts to support Vietnamese characters
  4. Repack the game data
  5. Test with ScummVM Tools You'll Need | Tool | Purpose |
@runlevel5
runlevel5 / zig-0.15.2-ppc64le.log
Created October 17, 2025 00:48
Full compilation log of zig 0.15.2 on Linux PPC64LE (Fedora 43)
[tle@fedora ~/W/zig]$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ab8e1cddd..eb2f60dbf1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -793,7 +793,7 @@ if(MSVC)
else()
set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2")
set(ZIG1_COMPILE_FLAGS "-std=c99 -Os")
- set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-sanitize=undefined -fno-stack-protector")