No description
- C++ 91.8%
- CMake 6.4%
- Shell 1.2%
- C 0.6%
| cmake | ||
| docs | ||
| include/ramfs | ||
| src | ||
| tests | ||
| third_party | ||
| tools | ||
| .gitignore | ||
| .gitmodules | ||
| CMakeLists.txt | ||
| README.md | ||
injectable-ramfs
An injectable, single-process, volatile RAM filesystem for Windows and Linux. Userspace only — no FUSE, no kernel modules.
- Windows: a DLL injected at spawn via
Microsoft Detours, hooking the
Nt*Filefamily inNTDLL. - Linux: a
.soinjected viaLD_PRELOADthat uses funchook to inline-detour the libc filesystem wrappers. Regular files are backed bymemfd_create()so most fd-level syscalls go straight to the kernel.
A user-supplied list of host paths (e.g. /tmp/build, C:\work\out) is
redirected to RAM; everything else falls through to the real OS.
See docs/PLAN.md for the full design and milestone breakdown.
Status
- M0 — plan + repo scaffold. ✅
- M1 — Linux PoC:
open/read/write/close/stat/mkdir/unlink/rename/getdents64anddup/dup2/dup3/fcntl(F_DUPFD)hooks installed via funchook. Single-process bash redirection round-trips through ramfs. ✅ - M3 — Core extracted into
ramfs_core; all OS-agnostic logic runs in the unit tests with no injection. ✅ - M4–M5 — Windows skeleton only.
ramfs_win.dllbuilds against Detours when present;NtCreateFileis the single attached hook today and the rest of the Nt* surface is staged out per PLAN §12. - M6 — pending.
Build
cmake -S . -B build # fetches funchook via FetchContent
cmake --build build -j
ctest --test-dir build # runs 16 unit tests + 1 Linux smoke test
To skip the funchook fetch (core + Windows skeleton + spawn launchers only):
cmake -S . -B build -DRAMFS_USE_FUNCHOOK=OFF
Run
./build/ramfs-spawn --root /tmp/ram -- bash -c '
printf "hi\n" > /tmp/ram/x
read -r got < /tmp/ram/x
echo "got=$got"
'
Repo layout
docs/ design and notes
include/ public C++ headers
src/core/ OS-agnostic ramfs (inodes, namespace, locks, storage)
src/platform/windows/ Detours DLL + Nt* hooks
src/platform/linux/ funchook-based LD_PRELOAD shim
tools/ spawn-time launchers (one per platform)
tests/ core unit tests + per-platform integration
third_party/ git submodules: detours, funchook
Out of scope (v1)
- Attach to an already-running process.
- Cross-process / shared-memory state.
- Copy-on-write overlay from the real filesystem.
- Snapshot / restore.
- Full async I/O fidelity on Windows.
- Static binaries / Go programs that bypass libc on Linux.