Try loading code at runtime

This commit is contained in:
2026-02-13 17:22:23 +01:00
parent a53e11d6dd
commit 27a3847c13
28 changed files with 96 additions and 144 deletions

6
test_pic/Cargo.toml Normal file
View File

@@ -0,0 +1,6 @@
[package]
name = "test_pic"
version = "0.1.0"
edition = "2024"
[dependencies]

3
test_pic/build.rs Normal file
View File

@@ -0,0 +1,3 @@
fn main() {
println!("cargo::rustc-link-arg=-Tilm.ld");
}

24
test_pic/src/main.rs Normal file
View File

@@ -0,0 +1,24 @@
#![no_std]
#![no_main]
use core::arch::global_asm;
#[panic_handler]
fn panic(_panic_info: &core::panic::PanicInfo) -> ! {
loop {}
}
#[unsafe(no_mangle)]
pub extern "C" fn entry() {
let test = "Hello from user mode";
unsafe {
core::arch::asm!(
"ecall",
in("a0") 999,
in("a1") test.as_ptr(),
in("a2") test.len(),
clobber_abi("system")
);
}
loop {}
}