Repository navigation
Foundation: nommu のスロット方式をアリーナ方式と再配置可能な WAX に置き換える - #177
Merged
Merged
Conversation
ページアロケータとプロセスごとのアリーナ、WAX v3 の RELOCATABLE(relocation table と heap_hint)、 llvm-src32 の --pie/--heap-hint を追加し、Foundation の全プログラムを --pie でビルドする。 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011HTdnvAqSYxxtyGHv9j9d3
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011HTdnvAqSYxxtyGHv9j9d3
src3453
commented
Oct 25, 2026
エントリごとにブロックを探すと、数千エントリの画像で起動が遅くなり、 disk 起動テストの STOP_TICKS に間に合わなくなっていた。 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011HTdnvAqSYxxtyGHv9j9d3
Owner
Author
|
CI の Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #175
V(Extension V)のない CPU でのユーザーメモリ管理を、固定スロット(1 プロセス 1 スロット)から、nommu Linux のような方式に置き換えます。V のある CPU のページ表バックエンドは変えていません。
判断したこと(レビューしてほしい点)
doc/spec_WAX_v3.mdを 3.1 に): flags bit 2RELOCATABLE、header 128/132 に relocation table(位置と件数)、136 にheap_hint。エントリは「リンク時アドレス + 種類(0: データ語、1: LDIH/LDIL の組)」。スタックは最下位ブロックの直下で、初期 R30 は配置後の origin。固定アドレスの v2/v3 画像は今までどおり動き、アリーナが取れなければFND_E_ADDRESS_CONFLICTです。--pie/--heap-hint(llvm-src32): 2 回リンク(0x01000000ずらし)の差分から relocation を作り、説明のつかない差はエラーにします。Foundation の全プログラム(init・各サービス・シェル・/bin)を--pieでビルドします。mem_growは nommu のbrkと同じく、アリーナを動かせず、末尾が空いているときだけ伸びます。大きなヒープが要る画像は--heap-hintで最初に求めます。FND_MM_SLOT_ONLY→FND_MM_NOMMU_ONLY、FND_MM=slot→FND_MM=nommu(slotは build.py で別名として残しています)。fnd_proc_create_builtinと一部のテストは、旧スロットの範囲を指定してアリーナとして確保します。frame_refs)にしました。Foundation: COWとproc_forkによるプロセス複製を実装する #176(COW/fork)の参照数管理とつなげています。fork は従来どおり VM 専用です。foundation/tests/sgc/guest.cの FIFO 満杯検査は VDP フレームの位相に依存して不安定だったので、フレームをまたいだら待って再試行するようにしました(nommu で spawn の時間が変わり表面化)。変更
mm(アリーナ API)、proc(plan_arena、spawn_image、アリーナの解放)、wax(wax_inspect、wax_rebase、relocation)tools/wax/wax3.py、tools/llvm-src32/{driver,v3}.py、foundation/boot/build.pytests/wax(relocation、PIE を 3 つ同時起動)、tests/shellほかmemory/2026-10-25-issue-175-nommu-arena.md確認したこと
tests/{irq,rle,code,disk_cache,pkcl}、toolchain の phase1/wax_loader/fork/vm_kernel/wal_from_cFND_MM=nommu): シェル 29 件、disk・fb・sgc・libsgc・tinybasic・wav・sgub・bmpview・chip8・console・pec・panic・fs・lzma・irq・rle・code・pkcl、上記 toolchain テストpython3 -m unittest discover -s foundation/tests/wax(ホスト)cargo test全体Generated by Claude Code