Add userland exec path: ELF VFS loader, stack/auxv/TLS setup, and related filesystem/paging fixes#29
Merged
pradosh-arduino merged 2 commits intomainfrom Mar 22, 2026
Conversation
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.
Motivation
execpath that can load ELF binaries directly from the VFS and start them in ring 3 with correct arguments, environment and auxiliary vector metadata.Description
elf_image_info_tand extended ELF APIs withelf_load_from_memory_exandelf_load_from_vfs_exto return entry and PHDR metadata, plus helpers for reading program headers from VFS and staging PHDRs into user memory.elf_vfs_seek,elf_vfs_read_exact,elf_vfs_read_exact_path) and a streaming mapperelf_map_program_header_from_vfsto map and copy PT_LOAD segments without requiring the whole image buffer.userland_exec, stack/argv/env building including auxv entries (PHDR/PHNUM/PHENT/PAGESZ/ENTRY/RANDOM/PLATFORM/EXECFN), TLS initialization atUSER_TLS_VADDRwith glibc-compatible TCB layout, and updatedenter_userland_atto zero registers beforeiretq.sys_execvenow copies argv/envp and callsuserland_exec,cmd_execforwards arguments touserland_exec(with a busybox default), and helpers to copy/free user string arrays were added.fat32_read_fat, improved FAT16 cluster walking withfat16_next_cluster_with_fallbackand robustfat16_readseeking, addedfast_virt_to_physandvirt_to_physalias, and minor paging mapping/flag adjustments to support user mappings.isr.cand richer meltdown logging inmeltdown.cto include interrupt/error codes and register snapshots.Testing
Codex Task