//! hello — the first rs-dos external binary (ADR 0006 Phase 2 gate). //! //! Prints one line through the injected Exports table and exits 0. //! Exercises the whole chain: PE32+ load, relocation, ABI call, task exit. #![no_std] #![no_main] use rsapi::Exports; #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! { loop { core::hint::spin_loop(); } } /// The image entry point — the loader jumps here with the ABI arguments /// (exports table, argc, argv). The conventional UEFI name is kept so /// the PE looks normal; the signature is the rs-dos ABI. #[unsafe(no_mangle)] pub extern "C" fn efi_main( exports: &'static Exports, _argc: usize, _argv: *const rsapi::Arg, ) -> i32 { let msg = b"hello, world - from an external binary"; let line = rsapi::Line { ptr: msg.as_ptr(), len: msg.len(), }; if (exports.put_line)(line) { 0 } else { 1 } }