Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial libstd support for Xous #104101

Merged
merged 17 commits into from
Sep 19, 2023

Commits on Aug 22, 2023

  1. libstd: add xous to libstd

    Add the `xous` target to libstd. Currently this defers everything to the
    `unsupported` target.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    61cfb17 View commit details
    Browse the repository at this point in the history
  2. std: xous: add os-specific ffi calls

    Xous has no C FFI. Instead, all FFI is done via syscalls that are
    specified in Rust. Add these FFI calls to libstd, as well as some of the
    currently-supported syscalls.
    
    This enables Rust programs to interact with the Xous operating system
    while avoiding adding an extra dependency to libstd.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    7892cfb View commit details
    Browse the repository at this point in the history
  3. std: xous: the basics of os

    Add the basics to get the operating system running, including how to
    exit the operating system.
    
    Since Xous has no libc, there is no default entrypoint. Add a `_start`
    entrypoint to the system-specific os module.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    9afc1e9 View commit details
    Browse the repository at this point in the history
  4. std: net: skip tests on xous

    Network functionality is not yet ready for merging.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    778e803 View commit details
    Browse the repository at this point in the history
  5. std: fs: skip fs tests on xous

    The xous filesystem support is not yet ready for merging.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    0b80057 View commit details
    Browse the repository at this point in the history
  6. std: process: skip tests on xous

    Xous does not yet support spawning processes.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    112d101 View commit details
    Browse the repository at this point in the history
  7. bootstrap: builder: don't add origin paths on xous

    Don't add the origin rpath when calling the linker. This is unnecessary
    on Xous since there is no dynamic linker, and Xous can use an ordinary
    bare-metal linker with no rpath options.
    
    As part of this patch, the logic was inverted so that the "else" clause
    contains everything except "windows" and "xous".
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    dffc864 View commit details
    Browse the repository at this point in the history
  8. std: xous: add alloc support

    Basic alloc support on Xous is supported by the `dlmalloc` crate. This
    necessitates bumping the dlmalloc version to 0.2.4.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    823cba9 View commit details
    Browse the repository at this point in the history
  9. panic_abort: call __rust_abort on xous

    Xous does not properly handle invalid instructions. Instead, call
    `__rust_abort` and exit normally.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    dfff5bf View commit details
    Browse the repository at this point in the history
  10. std: xous: add services support

    Xous has a concept of `services` that provide various features.
    Processes may connect to these services by name or by address. Most
    services require a name server in order to connect.
    
    Add a file with the most common services, and provide a way to connect
    to a service by querying the name server.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    10dad67 View commit details
    Browse the repository at this point in the history
  11. std: xous: add output support for stdio

    Add support for stdout. This enables basic console printing via
    `println!()`. Output is written to the log server.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    4af7d2c View commit details
    Browse the repository at this point in the history
  12. std: xous: add support for time

    Add support for determining the current time. This connects to the
    ticktimer server in order to get the system uptime.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    efa470d View commit details
    Browse the repository at this point in the history
  13. std: xous: add thread support

    Add initial support for threads on Xous. This includes thread creation
    and joining.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    d36e516 View commit details
    Browse the repository at this point in the history
  14. std: xous: add thread_local_key

    Add an implementation of thread local storage. This uses a container
    that is pointed to by the otherwise-unsed `$tp` register. This container
    is allocated on-demand, so threads that use no TLS will not allocate
    this extra memory.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    46a4ec3 View commit details
    Browse the repository at this point in the history
  15. std: xous: add support for locks

    Add support for Condvar, Mutex, and RWLock. These are all backed by the
    ticktimer server.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    6413844 View commit details
    Browse the repository at this point in the history
  16. Cargo.lock: bump compiler_builtins to 0.1.101

    The Xous operating system has no libc, and relies on `compiler_builtins`
    to supply basic functions such as `memcpy`. Bump the version to 0.1.101
    to pull in a version of this crate with the flag enabled for Xous.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    00280c8 View commit details
    Browse the repository at this point in the history
  17. std: enable feature(slice_ptr_len) on xous

    Xous passes slice pointers around in order to manipulate memory.
    This is feature-gated behind `slice_ptr_len`. Xous is currently
    the only target to use this feature, so gate it behind an OS flag.
    
    Signed-off-by: Sean Cross <sean@xobs.io>
    xobs committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    6c32a64 View commit details
    Browse the repository at this point in the history