starry/
main.rs

1#![no_std]
2#![no_main]
3#![doc = include_str!("../README.md")]
4
5#[macro_use]
6extern crate axlog;
7extern crate alloc;
8extern crate axruntime;
9
10mod entry;
11mod mm;
12mod syscall;
13
14#[unsafe(no_mangle)]
15fn main() {
16    // Create a init process
17    axprocess::Process::new_init(axtask::current().id().as_u64() as _).build();
18
19    let testcases = option_env!("AX_TESTCASES_LIST")
20        .unwrap_or_else(|| "Please specify the testcases list by making user_apps")
21        .split(',')
22        .filter(|&x| !x.is_empty());
23
24    for testcase in testcases {
25        let Some(args) = shlex::split(testcase) else {
26            error!("Failed to parse testcase: {:?}", testcase);
27            continue;
28        };
29        if args.is_empty() {
30            continue;
31        }
32        info!("Running user task: {:?}", args);
33        let exit_code = entry::run_user_app(&args, &[]);
34        info!("User task {:?} exited with code: {:?}", args, exit_code);
35    }
36}