From b2ba9d160afa16289fed96bd0e347bd638ca21c7 Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Fri, 10 Jul 2026 20:43:25 +0300 Subject: [PATCH] relibc: add DEBUG marker write before relibc_verify_host Temporary debugging aid to determine whether relibc_start_v1 is reached before the init process crashes. Writes a marker to /scheme/debug/no-preserve at the very start of relibc_start_v1, before any setup or verification. --- src/start.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/start.rs b/src/start.rs index 915056e5b5..481f13632c 100644 --- a/src/start.rs +++ b/src/start.rs @@ -160,6 +160,14 @@ pub unsafe extern "C" fn relibc_start_v1( static __init_array_end: extern "C" fn(); } + // DEBUG: Earliest possible output before any other init + if let Ok(mut f) = unsafe { + redox_rt::call::open("/scheme/debug/no-preserve", redox_rt::flag::O_WRONLY, 0) + } { + let _ = redox_rt::call::write(f.as_raw_fd(), b"START: relibc_start_v1 entered\n"); + let _ = redox_rt::call::close(f.as_raw_fd()); + } + // Ensure correct host system before executing more system calls unsafe { relibc_verify_host() };