From 13b9231f6eea9a88fc83ef7395ae0909ba6f67b1 Mon Sep 17 00:00:00 2001 From: xteink <[email protected]> Date: Mon, 20 Jul 2026 17:49:07 -0400 Subject: [PATCH] Add xteink fork dev tooling (native flake devShell + README) --- README.xteink.md | 39 +++++++++++++++++++++++++++++++++++++++ flake.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 README.xteink.md create mode 100644 flake.nix diff --git a/README.xteink.md b/README.xteink.md new file mode 100644 index 0000000000..f8737f2b90 --- /dev/null +++ b/README.xteink.md @@ -0,0 +1,39 @@ +# xteink QEMU fork + +Espressif's QEMU fork carrying the xteink X3/X4 (ESP32-C3) machine model and a +wasm32 TCG backend (ported from [ktock/qemu-wasm](https://github.com/ktock/qemu-wasm)), +used by [xteink-web-emulator](../xteink-web-emulator) to run CrossPoint firmware +in the browser. + +## Branch + +- `main` — the working branch. Base is Espressif's `esp-develop-9.2.2-20260417` + (`40edccac`). + +## Remotes + +- `origin` — https://ssh.gitea.va.reichard.io/evan/qemu-xteink +- `upstream` — https://github.com/espressif/qemu +- `qemu-wasm` — https://github.com/ktock/qemu-wasm (source of the wasm32 backend) + +## Building + +### Native (parity check — authoritative) + +```sh +nix develop +./configure --target-list=riscv32-softmmu --with-devices-riscv32=xteink --enable-gcrypt +ninja -C build qemu-system-riscv32 +``` + +### WebAssembly + +Driven by the parent repo, not here: + +```sh +cd ../xteink-web-emulator +make web-dev # incremental build straight from this tree +``` + +The parent's `scripts/build-qemu-wasm.sh` compiles this checkout inside the +emsdk Docker image defined in `xteink-web-emulator/qemu/wasm/Dockerfile`. diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000..edb63b4ab2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + description = "Espressif QEMU fork with the xteink X3/X4 (ESP32-C3) machine and a wasm32 TCG backend"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + # Native build/test shell. The wasm target is built by the parent + # xteink-web-emulator repo via its emsdk Docker toolchain, not here. + # + # nix develop + # ./configure --target-list=riscv32-softmmu --with-devices-riscv32=xteink \ + # --enable-gcrypt && ninja -C build qemu-system-riscv32 + devShells.default = pkgs.mkShell { + inputsFrom = [ pkgs.qemu ]; + packages = with pkgs; [ + gnumake + git + ninja + meson + pkg-config + libgcrypt + libslirp + pixman + dosfstools + mtools + ]; + }; + } + ); +}