fix: stream ELF program loading instead of buffering whole files
ElfLoad read the entire binary into one kernel heap allocation before copying segments out. The heap grows through ReallocConsecutive, so a 40 MB cc1plus required 10k physically contiguous pages - effectively impossible after boot with a 368 MB ramdisk module resident, and the failed spawn surfaced as posix_spawnp ENOENT in the gcc driver. The loader now reads the ELF header and program header table (bounded at 64 entries), then copies each PT_LOAD page and the PT_TLS template directly from the VFS into freshly mapped process pages. Peak kernel memory per load drops from fileSize to one page regardless of binary size. Boot-smoke verified: all userspace loads through this path. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
78ce551688
commit
2f1010b02e
2 files changed
+60
-54
No files matched your search
@@ -12,4 +12,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define MONTAUK_BUILD_NUMBER 22
|
||||
#define MONTAUK_BUILD_NUMBER 23
|
||||
Reference in new issue
Block a user