Commit graph

218 commits

Author SHA1 Message Date
Sean Cross
6e312ffc8a kernel: process: only print process inits when printing is enabled
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 20:42:57 +08:00
Sean Cross
e5003eee6d kernel: only print RISC-V exceptions when printing is enabled
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 20:42:25 +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
95ab9d3c02 kernel: server: unify print messages
Don't use `println!()`, and instead prefer to use `print!()` when in the
kernel.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:17:27 +08:00
Sean Cross
20a65b88f2 kernel: server: don't Forget Borrow and MutableBorrow messages
These should be returned to the client process after the message is
done, not forgotten straightaway.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:16:52 +08:00
Sean Cross
cb2d810b38 kernel: irq: prefix pagefault message with KERNEL(pid)
This unifies this message with other kernel messages.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:16:14 +08:00
Sean Cross
04a3493550 kernel: hosted: print status adding memory to return val
When returning memory to a thread, attach memory if present.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:15:32 +08:00
Sean Cross
74b3fde198 kernel: add memory from Results to network packets
If a Result contains attached memory, add that memory on to the network
packet that gets sent by the kernel.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:14:43 +08:00
Sean Cross
702676031e kernel: hosted: run rustfmt
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:14:33 +08:00
Sean Cross
5f6b42d534 kernel: hosted: print pid of a process that exited
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:14:02 +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
797d622cc7 kernel: use connect() for some kernel tests
Now that `connect()` works, use that for some tests rather than
exclusively using `try_connect()`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-14 19:19:01 +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
61fdd5be15 kernel: hosted: add current_tid() to Process
This allows us to mock the current TID for debugging purposes on hosted
environments.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-14 10:54:19 +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
Sean Cross
585e55e8b7 kernel: implement retry_instruction()
This function is used to decrement the program counter to re-run a given
instruction. This can be used as a cheap way to implement blocking
calls.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-14 10:04:36 +08:00
bunnie
62b625ec60 convert kernel debug to utra 2020-10-14 03:04:33 +08:00
bunnie
67c49ddbce clean up a warning 2020-10-14 03:04:25 +08:00
bunnie
4d21f2d868 intermediate progress on debugging return messages 2020-10-14 01:28:10 +08:00
Sean Cross
84b39c931a kernel: services: switch address space prior to passing messages
Switch address spaces to pass messages to the new process, and switch
backafterwards.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-13 22:56:04 +08:00
Sean Cross
39c7dced01 kernel: services: switch address space prior to passing messages
Switch address spaces to pass messages to the new process, and switch
backafterwards.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-13 22:54:43 +08:00
Sean Cross
53f1b3c416 kernel: main: make utralib incusion conditional
Only include utralib when running on baremetal.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-13 22:54:12 +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
bunnie
cab4c7d4a9 fix more UTRA issues; migrate to dual-UART for kernel/console messages 2020-10-13 05:22:19 +08:00
bunnie
9a50de8b4e refactor: utra -> utralib naming
this cleans up some namespace issues when including
the utra crate which also refers to utra::generated::utra,
and there are CONST at the crate-level, and also functions
at the module-level which need disambiguation. By naming
the crate utra-lib this saves a bit of syntatic wrangling
at the top of every file.
2020-10-12 03:56:10 +08:00
Sean Cross
28f5f79b7d kernel: re-enable fat lto
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-11 09:15:49 +08:00
Sean Cross
fb027c569b kernel: lock: add new dependencies for utra
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-11 09:15:45 +08:00
Sean Cross
9140482a6b lock: add missing lockfiles
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-05 10:52:26 +08:00
Sean Cross
d0d687a239 utra: fix build on non-hardware release
This adds svd2utra, which enables building for non-embedded harware.

It also fixes some build issues, and paves the way for generating UTRA
at compile-time.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-05 10:13:51 +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
fa23cfa88b kernel: services: update some debug comments
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-04 18:28:29 +08:00
Sean Cross
7843189c45 kernel: remove printing of "hello, world!"
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-04 18:28:02 +08:00
Sean Cross
a00151b4de kernel: use IRQ 0 for UART
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-04 18:27:49 +08:00
Sean Cross
5f4ee01a0d kernel: use fixed address for debug port
Don't use the hardware address, since it is not likely to be in
the universal address space.

Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-10-04 18:13:58 +08:00
Sean
bbab52be7f kernel: flush MMU when we rotate the SATP value
Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-10-04 18:12:27 +08:00
bunnie
711e5ea910 slot in utra references 2020-10-02 04:52:03 +08:00
bunnie
4cded404e3 fix offset of UART 2020-09-26 01:36:45 +08:00
bunnie
5deeebae3b the loader seems to be working now. 2020-09-26 00:03:46 +08:00
bunnie
44f1a6b307 Merge branch 'master' of https://github.com/betrusted-io/xous-core into dvt-hardware 2020-09-25 17:50:24 +08:00
bunnie
8cc85f4e11 mods for running on DVT hardware 2020-09-25 17:50:02 +08:00
Sean Cross
2575d13acd cargo: update lock file
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-23 10:59:38 +08:00