Add user-space support library
This commit is contained in:
parent
dd6f186623
commit
d3c02f0f5b
|
@ -147,4 +147,9 @@ dependencies = [
|
|||
"snafu",
|
||||
"usize_conversions",
|
||||
"ux",
|
||||
"vesper-user",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "vesper-user"
|
||||
version = "0.0.1"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"nucleus",
|
||||
"vesper-user",
|
||||
"crates/tock-registers"
|
||||
]
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ version = "0.0.1"
|
|||
authors = ["Berkus Decker <berkus+vesper@metta.systems>"]
|
||||
description = "Vesper exokernel"
|
||||
documentation = "https://docs.metta.systems/vesper"
|
||||
homepage = "https://github.com/metta-systems/vesper"
|
||||
homepage = "https://metta.systems/products/vesper"
|
||||
repository = "https://github.com/metta-systems/vesper"
|
||||
readme = "README.md"
|
||||
license = "BlueOak-1.0.0"
|
||||
|
@ -38,6 +38,7 @@ bitflags = "1.2.1"
|
|||
cfg-if = "1.0"
|
||||
snafu = { version = "0.6", default-features = false }
|
||||
paste = "1.0"
|
||||
vesper-user = { path = "../vesper-user" }
|
||||
|
||||
#embedded-serial = "0.5.0"
|
||||
# jlink_rtt = { version = "0.1.0", optional = true }
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
# Vesper Kernel
|
||||
|
||||
This directory contains binary for the vesper kernel.
|
||||
|
||||
----
|
||||
|
||||
For more information please re-read.
|
|
@ -8,6 +8,8 @@
|
|||
//! Arch-specific kernel ABI decodes syscall invocations and calls API functions to perform actual
|
||||
//! operations.
|
||||
|
||||
use vesper_user::SysCall as SysCall;
|
||||
|
||||
// Syscalls (kernel API)
|
||||
trait API {
|
||||
// Three below (send, nb_send, call) are "invocation" syscalls.
|
||||
|
@ -45,18 +47,6 @@ trait API {
|
|||
// Plus some debugging calls...
|
||||
}
|
||||
|
||||
// @todo This is going to be in the interface library.
|
||||
enum SysCall {
|
||||
Send,
|
||||
NBSend,
|
||||
Call,
|
||||
Recv,
|
||||
Reply,
|
||||
ReplyRecv,
|
||||
NBRecv,
|
||||
Yield,
|
||||
}
|
||||
|
||||
fn handle_syscall(syscall: SysCall) -> Result<()> {
|
||||
match syscall {
|
||||
SysCall::Send => {
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
[package]
|
||||
name = "vesper-user"
|
||||
version = "0.0.1"
|
||||
authors = ["Berkus Decker <berkus+vesper@metta.systems>"]
|
||||
description = "Vesper user-space interface"
|
||||
documentation = "https://docs.metta.systems/vesper-user"
|
||||
homepage = "https://metta.systems/products/vesper"
|
||||
repository = "https://github.com/metta-systems/vesper"
|
||||
readme = "README.md"
|
||||
license = "BlueOak-1.0.0"
|
||||
categories = ["no-std", "embedded", "os"]
|
||||
publish = false
|
||||
edition = "2018"
|
||||
|
||||
[badges]
|
||||
maintenance = { status = "experimental" }
|
||||
|
||||
[dependencies]
|
|
@ -0,0 +1,8 @@
|
|||
# User-space Kernel Interface
|
||||
|
||||
This directory contains library for interfacing with the kernel through syscalls.
|
||||
This library also defines constants and types shared between kernel- and user-space.
|
||||
|
||||
----
|
||||
|
||||
For more information please re-read.
|
|
@ -0,0 +1 @@
|
|||
pub mod syscall;
|
|
@ -0,0 +1,3 @@
|
|||
pub fn syscall(number: u64) {
|
||||
asm!("svc #1234")
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: BlueOak-1.0.0
|
||||
* Copyright (c) Berkus Decker <berkus+vesper@metta.systems>
|
||||
*/
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
#[macro_use]
|
||||
pub mod aarch64;
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
pub use self::aarch64::*;
|
|
@ -0,0 +1,20 @@
|
|||
pub mod arch;
|
||||
|
||||
pub use arch::syscall;
|
||||
|
||||
pub enum SysCall {
|
||||
Send,
|
||||
NBSend,
|
||||
Call,
|
||||
Recv,
|
||||
Reply,
|
||||
ReplyRecv,
|
||||
NBRecv,
|
||||
Yield,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test_case]
|
||||
fn test_debug_output_syscall() {}
|
||||
}
|
Loading…
Reference in New Issue