Commit Graph
3 Commits
Author SHA1 Message Date
zachdoxsee 4e18000798 Merge upstream main into task/329-gate-a1
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-25 01:56:31 +01:00
zachdoxsee 830f93ff14 loader: address review of process exit and the Gate A1 program (#329)
- An ExitProcess call in a TLS callback is a normal startup outcome with
  its status. The remaining callbacks and the entry point do not run.
- Exit closes Winsock sockets and task-queue handles as well as kernel
  objects, and open_handle_count counts all three tables.
- Startup reserves the page holding the entry-return and callback-return
  addresses, so an image mapped over them is refused and a guest
  allocation there fails.
- The Gate A1 program checks unequal memcmp results and compares the
  bytes it read back without memcmp.
- The gate test builds in a directory of its own per test process.
- The build script checks its tools and their libraries with file,
  lipo -archs and otool -L.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 19:55:20 +01:00
zachdoxsee 47cb26ebdd loader: add process exit and the Gate A1 compiled C program (#329)
A guest can now end its process. kernel32.dll!ExitProcess stops execution
with the new ExitReason::ProcessExit(status), keeping all 32 bits of the
status, and never ends the host. A returning entry point does the same
with EAX: startup puts an exit address under the entry point. The exit
closes every guest handle, and the DbtEngine that ran the guest executes
no further guest instruction.

Gate A1 is an original C program with no C library linked. The test
builds it from source with clang and an LLD, runs it through
run_synthetic_startup, the standard services and the DBT at four
optimization levels, and checks its exit status, report, files and
memory against values recomputed in Rust. Three controls must fail in
the stated way. Gate A stays open until the hosted milestone, A2.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 17:42:09 +01:00