From a4dce7f4d920e492d38c32ad3e42efdcfef3b3f1 Mon Sep 17 00:00:00 2001 From: claude Date: Sun, 12 Jul 2026 01:19:32 +0000 Subject: 🌭 plan9-kencc-linux: кросс-тулчейн Plan9 (cc/as/ld) + EFI-болванка MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - build_arch.sh / build_al.sh: сборка kencc-компиляторов, ассемблеров, линкеров всех арок (5/6/8/v/q/k) на Linux-хосте через plan9port. - патчи под musl/gcc: sbrk->mmap, round/log2->p9*, Runemask, swcmp const, -fcommon, machcap/omachcap, /sys рантайм-файлы. Подробно в PATCHES.md. - bin/: готовые 8c 6c 5c vc qc kc + 6a 6l (Linux/musl x86_64). - efi/: болваночный bootx64.efi (PE32+) тем же тулчейном (6a+6c+6l+dd), референс — 9legacy nboot/efi; ESP-образ через mkesp.py. Co-Authored-By: Claude Opus 4.8 --- efi/fetch_ref.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 efi/fetch_ref.sh (limited to 'efi/fetch_ref.sh') diff --git a/efi/fetch_ref.sh b/efi/fetch_ref.sh new file mode 100644 index 0000000..67b726b --- /dev/null +++ b/efi/fetch_ref.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Тянет из 9legacy референсный EFI-загрузчик (nboot/efi) и достаёт из него +# pe64.s (PE32+ обёртка), efi.h и mem.h. Это НЕ наш код — это Plan9/9legacy, +# поэтому качаем, а не храним в репе. Наш код — hello.c/efi_build.sh/mkesp.py. +set -e +cd "$(dirname "$0")" +echo ">> качаю 9legacy nboot.diff ..." +python3 -c "import urllib.request; urllib.request.urlretrieve('http://9legacy.org/9legacy/patch/nboot.diff','nboot.diff')" +python3 - <<'PY' +import re +d=open('nboot.diff').read().splitlines() +want={'pe64.s','efi.h','mem.h'}; cur=None; buf=[]; out={} +for l in d: + m=re.match(r'^\+\+\+ .*/nboot/efi/(\S+)', l) + if m: + if cur: out[cur]='\n'.join(buf) + cur=m.group(1) if m.group(1) in want else None; buf=[]; continue + if cur is not None: + if l.startswith('--- '): out[cur]='\n'.join(buf); cur=None; continue + if l.startswith('+'): buf.append(l[1:]) +if cur: out[cur]='\n'.join(buf) +for k,v in sorted(out.items()): open(k,'w').write(v); print(' извлёк', k, f'({len(v.splitlines())} строк)') +PY +echo ">> готово: pe64.s efi.h mem.h (референс 9legacy)" -- cgit v1.2.3