Skip to content

Split heavy commands out of corebox into standalone binaries#14

Open
mikeysklar wants to merge 1 commit into
speccy88:masterfrom
mikeysklar:feat/corebox-standalone
Open

Split heavy commands out of corebox into standalone binaries#14
mikeysklar wants to merge 1 commit into
speccy88:masterfrom
mikeysklar:feat/corebox-standalone

Conversation

@mikeysklar

Copy link
Copy Markdown
Collaborator

corebox is a ~212 KB busybox multicall binary, so running any of its applets (df/grep/sed/head/...) needs a single 256 KB contiguous block (order-6) on this no-MMU target. Fragmentation eventually denies that even when total free memory looks fine, giving binfmt_flat order:6 allocation failures (errno -12) after some uptime.

This builds the most-used heavy text tools as their own ~80–120 KB binaries (the same way cat/ls/ps already are), so each only needs a 128 KB contiguous block (order-5) — half the requirement, and far likelier to survive fragmentation. corebox keeps the colder applets and shrinks to ~157 KB.

Promoted to standalone: grep (with egrep/fgrep), sed, df, head, tail, wc, cut, tr, uname.

Note: a coarse 2-way split does not help — two ~150 KB halves are both still order-6. The ~92 KB busybox/uClibc floor per binary means it has to be individual binaries to drop an order.

Verified on Fruit Jam hardware: grep/df run as order-5 standalones in memory states where the order-6 monolith failed to load.

🤖 Generated with Claude Code

corebox is a ~212 KB busybox multicall binary, so running any of its
applets (df/grep/sed/head/...) needs a single 256 KB contiguous block
(order-6) on this no-MMU target. Fragmentation eventually denies that
even when total free memory is fine, giving binfmt_flat order:6
allocation failures (errno -12) after some uptime.

Build the most-used heavy text tools as their own ~80-120 KB binaries
(the same way cat/ls/ps already are), so each only needs a 128 KB
contiguous block (order-5) -- half the requirement, far likelier to
survive fragmentation. corebox keeps the colder applets and shrinks to
~157 KB.

Promoted to standalone: grep (with egrep/fgrep), sed, df, head, tail,
wc, cut, tr, uname.

Verified on Fruit Jam hardware: grep/df run as order-5 standalones in
memory states where the order-6 monolith failed to load.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant