Files
k-os/crates/apps/echo/src/main.rs

19 lines
380 B
Rust

#![no_std]
#![no_main]
extern crate libkos;
use types::bounded::CapSlot;
use libkos::syscall;
#[unsafe(no_mangle)]
extern "C" fn main() {
let ep = CapSlot::const_new(0);
if let Ok(syscall::Received::Call { words: [w0, w1, w2, w3], .. }) = syscall::receive_msg(ep) {
let _ = syscall::reply([w0.wrapping_add(1), w1, w2, w3], None);
}
syscall::exit();
}