Sean Cross
83da8c4e7d
syscall: remove commented-out pid code
...
This isn't used.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-03 21:20:21 +08:00
bunnie
0889e83401
Merge remote-tracking branch 'betrusted/hardware'
2021-03-02 21:51:41 +08:00
bunnie
96a19baa8d
state before refactor of status to own process
2021-03-02 19:25:41 +08:00
Lina Ceballos
d18500f4d6
adding license and copyright headers
2021-01-25 14:54:00 +01:00
Sean Cross
8d99ee06cf
kernel: fix extra-parens warning in syscall
...
Remove an extra set of parenthesis.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-13 21:09:14 +08:00
bunnie
4ef581a266
riddled with race conditions, but...sort of works
2021-01-08 05:20:53 +08:00
Sean Cross
7b50d00eb8
repo: run cargo fmt
...
This reformats line endings to be consistent, and reinforces the
contents of `.gitattributes`.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-03 18:31:51 +08:00
Sean Cross
f49518f7d5
kernel: add connect_for_process()
...
This allows one process to establish a connection to a server on behalf
of another process.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 23:25:41 +08:00
Sean Cross
b094f1147b
xous: implement sender.pid()
...
This is mostly an implementation detail, but appears to work.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 22:38:35 +08:00
Sean Cross
85b6357d26
kernel: implement CreateServer
...
This implements CreateServer, which creates a server with a random name.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:58:14 +08:00
Sean Cross
25e4d16de3
xous-os: rename CreateServer to CreateServerWithAddress
...
Servers will, by default, get randomly-assigned SIDs. Certain servers
will want to have well-known SIDs, such as the log server or the
nameserver. These will use a separate call in order to perform this
priveledged operation.
A subsequent patch will add `CreateServer`.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:33:33 +08:00
Sean Cross
8927ef00a2
kernel: add TryReceiveMessage support
...
This is a nonblocking form of ReceiveMessage.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-25 20:26:21 +08:00
Sean Cross
e3cb05baf5
kernel: syscall: send WouldBlock to retry messages
...
This is handled by the client library to re-send the request.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 20:04:37 +08:00
Sean Cross
65c8c6eef5
kernel: implement and use klog!() macro
...
This replaces the majority of println!() and print!() calls, and works
on baremetal and hosted modes.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 17:24:28 +08:00
Sean Cross
eecd9c2367
kernel: syscall: return Ok for yield() on hosted
...
When running in Hosted mode, a yield shouldn't do anything.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 17:23:53 +08:00
Sean Cross
8a3f6a2b43
kernel: fix mutableborrow message returning
...
We weren't properly updating the packet when a mutableborrow was getting
returned.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-23 15:19:02 +08:00
Sean Cross
4e6a189e4e
kernel: fix returning scalars in interrupt context
...
This is now allowed.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-11 16:06:08 +08:00
Sean Cross
2698333382
kernel: allow making syscalls from an interrupt
...
This enables calling some syscalls from within an interrupt context.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 17:59:26 +08:00
Sean Cross
7ab2338ff3
kernel: add in_irq parameter to syscall::handle()
...
This parameter will determine whether a syscall is being handled from
within an interrupt context. This is because certain calls cannot be
called from such a context.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:27:39 +08:00
Sean Cross
719549a2cb
xous: rename ReturnToParentI -> ReturnToParent
...
This syscall isn't the only one that can be called from an interrupt
context.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:26:19 +08:00
Sean Cross
49d3ce8a6f
kernel: syscall: unify print!() messages
...
Use `print!()` instead of `println!()` in order to make error messages
easier to read in the debug console.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:19:28 +08:00
Sean Cross
b3d918358e
kernel: syscall: don't error on unaligned memory when Hosted
...
When running in a Hosted environment, unaligned memory is not an error,
so don't return `BadAlignment`.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:18:50 +08:00
Sean Cross
fa9a3e0954
kernel: rework hosted network protocol
...
This fixes issues regarding passing memory between processes.
We now properly catch `ReturnMemory` and give the memory back.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-29 19:46:17 +08:00
bunnie
9a8c402cc2
add hosted mode bits back in
2020-10-14 23:04:54 +08:00
bunnie
6ff8c8518c
Merge branch 'master' of github.com:betrusted-io/xous-core
2020-10-14 23:02:14 +08:00
bunnie
ac4d79ea68
logging server bringup
2020-10-14 23:01:57 +08:00
Sean Cross
80a003c839
kernel: syscall: implement connect()
...
This implements the `connect()` syscall as a blocking version of
`try_connect()`.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-14 19:18:16 +08:00
bunnie
5cf8e9e3bc
Merge remote-tracking branch 'origin/master' into ticktimer
2020-10-14 15:30:47 +08:00
Sean Cross
54a8de2776
kernel: fix return_scalar and return_scalar2
...
These didn't correctly set the thread status in the server when
returning a value. Instead of marking a server as runnable, it remained
in an idle state.
This correctly sets the thread status in the server, and resumes the
client.
This has been tested in Renode as well as using `cargo test`.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-14 11:16:21 +08:00
Sean Cross
ecd2d00f47
kernel: fix return_scalar2
...
This call did not work, because it wasn't properly returning control to
the parent process.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-14 10:54:23 +08:00
Sean Cross
e5100bcb33
kernel: syscall: implement SendMessage
...
SendMessage is a blocking version of TrySendMessage, except this call
will block if the server queue is full.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-14 10:14:43 +08:00
Sean Cross
0c344efb60
kernel: syscall: move do_yield() to its own function
...
This will allow us to call `Yield` for other operations that need to be
blocking.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-14 10:14:43 +08:00
bunnie
4d21f2d868
intermediate progress on debugging return messages
2020-10-14 01:28:10 +08:00
bunnie
154384e3bb
output hex for kernel debug
...
makes it much easier to read memory allocation requests
2020-10-13 16:15:15 +08:00
Sean Cross
d4f0496371
kernel: remove unused debug data
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-04 19:08:29 +08:00
Sean Cross
8759f552f7
kernel: syscall: allow returning to the kernel
...
If nothing is running, don't crash when the timer hits.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-04 18:28:58 +08:00
Sean Cross
e5583a7646
kernel: fix message sender parameter
...
The `sender` was, previously, somewhat mislabeled. It was a combination
of PID and TID, except when it wasn't.
Instead, make this value a combination of ConnectionID and queue index.
This makes it easier to reason about which connection we're responding
to.
Additionally, don't expose teh global Server Index Table to userspace
programs.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-23 10:52:22 +08:00
Sean Cross
435612a370
kernel: syscall: use new is_blocking() call
...
This removes the need to manually specify whether a call is blocking.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 22:14:03 +08:00
Sean Cross
43002b8627
kernel: add blocking scalars
...
Add a new type: BlockingScalar, that can be used to do blocking scalar
calls such as sleep().
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 22:05:18 +08:00
Sean
1b59719a74
kernel: hosted: support per-thread memory messages
...
Previously, each process could return one chunk of memory. With this
change, processes can now return one chunk of memory per thread. This
enables multiple threads to lend memory to a server.
Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:20:16 +08:00
Sean Cross
cd7f8f67fc
kernel: rename Connect/SendMessage to TryConnect/TrySendMessage
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:39:29 +08:00
Sean Cross
8f70c0640c
kernel: fix server indexing
...
Server IDs were being improperly indexed, resulting in a
probably-invalid server index being returned.
Adjust these so that correct server indices are returned.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-29 22:10:24 +08:00
Sean Cross
bb17038bfe
kernel: rename "xous" to "xous-kernel" in import
...
Cargo appears to cache packages in the workspace when multiple packages
use the same crate. Unfortunately, Xous uses different features
depending on whether it's running in the kernel or in userspace.
Pull the kernel version of "xous" in under a different namespace in
order to force it to use a different build.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-17 18:37:40 +08:00
Sean Cross
31f63c3f5f
kernel: threads work now
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-10 22:05:06 +08:00
Sean Cross
1d23bc5aae
kernel: first multiple threads working
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-10 21:17:48 +08:00
Sean Cross
a467d6fcc7
kernel: baremetal: 2nd process starts to run and crashes
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-10 16:06:38 +08:00
Sean Cross
e7a4927943
kernel: down to 7 compile errors
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-09 19:21:54 +08:00
Sean Cross
ea3a473c9f
reworking memory allocation
...
The kernel should run in a `no_std` environment, which means it must
currently run without `alloc`. We have our own allocation methods when
running on baremetal hardware.
Begin the work to break out the allocation method so that it will work
on both desktop and baremetal environments.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-03 17:40:57 +08:00
Sean Cross
869ebcff8b
kernel: get tests and running working
...
This fixes process creation so that it works for both tests and running
it as a program.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-29 22:37:03 +08:00
Sean Cross
19222c34a9
kernel: get shutdown and multi-clients working
...
THis now has proper authentication for tests.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-28 13:28:14 +08:00