Repository navigation
mkvh: split large elf segments so the octane prom loads linux from disk - #793
Merged
techomancer merged 1 commit intoNov 20, 2026
Merged
Conversation
The Octane's PROM reads each ELF segment of a volume-header file with one SCSI command. Its ISP1040 driver lists the transfer one entry per 16 KB page in a fixed array of its per-adapter state (about 73 entries) and queues it on an 8-entry request ring, so a segment over about 720 KB never fits the ring and times out, and one over about 1.1 MB also writes its page list over the next adapter's state and panics the PROM. An 11 MB Linux vmlinux did the latter. IRIX's own volume-header files stay small. mkvh build now splits every PT_LOAD of an ELF executable that carries more than 512 KB of file data into consecutive 512 KB segments at the same offsets and addresses, rewriting the program header table in place when the bytes after it are free. --no-split keeps files unchanged. Linux 7.3.4 on the Octane now boots from dksc(0,1,8)vmlinux to a shell. Tests: sgi_vh split_load_segments_* (ELF32 and ELF64, in place and appended table), build_image_splits_an_oversized_kernel_only_when_asked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The Octane's PROM 4.17 could not load an 11.5 MB Linux
vmlinuxfrom the disk's volume header (boot -f dksc(0,1,8)vmlinux): it panicked withdriver_acquire: io_state.active deadlock. Booting over TFTP worked.The limit is in the PROM's own code, so a real Octane fails the same way. The PROM reads each ELF segment from the volume header in one SCSI command. Its ISP1040 driver then hits two fixed limits:
IRIX's own volume-header files stay under both limits (
sashis 267 KB).Change
mkvh buildsplits anyET_EXECELF segment with more than 512 KB of file data into consecutive pieces at the same offsets and addresses. The PROM loads them one after another, and Linux doesn't notice. The program header table is rewritten in place when there is room after it, as in a vmlinux, so the file keeps its size. Otherwise it is appended at the end of the file.--no-splitkeeps a file exactly as it is. Small files and relocatable files such assashare never changed.docs/octane-ip30.md(Disks) anddocs/cpu-test-support.md; CHANGELOG.Testing
cargo test --release --lib sgi_vh: 17 pass, 4 of them new. They cover ELF32 and ELF64, both places the new table can go, files that are left alone, andbuild_imagewith and without splitting.dksc(0,1,8)as 23 pieces. Linux 7.3.4 mounted its root on sda1 and reached a shell.🤖 Generated with Claude Code