Better user programs with a special std. Sleep and exit are calling scheduler instead of wfi.
This commit is contained in:
@@ -4,3 +4,4 @@ version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
os-std = { path = "../../crates/os-std" }
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
fn main() {
|
||||
println!("cargo::rustc-link-arg=-Tilm.ld");
|
||||
}
|
||||
@@ -1,21 +1,11 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
os_std::custom_std_setup! {}
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(_panic_info: &core::panic::PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
||||
use os_std::syscall::write_string_temp;
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn entry() {
|
||||
let test = "Hello from PIC program loaded dynamically";
|
||||
unsafe {
|
||||
core::arch::asm!(
|
||||
"ecall",
|
||||
in("a0") 999,
|
||||
in("a1") test.as_ptr(),
|
||||
in("a2") test.len(),
|
||||
clobber_abi("system")
|
||||
);
|
||||
}
|
||||
fn main() {
|
||||
write_string_temp(
|
||||
"Hello from PIC program loaded dynamically with custom std and a better justfile, and syscalls !",
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user