Commit graph

513 commits

Author SHA1 Message Date
Sean Cross
7391b98f4e log-server: remove excess printing from log string
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:30:07 +08:00
Sean Cross
c6e12a5ecd kernel: remove dead code from hosted/irq.rs
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:29:36 +08:00
Sean Cross
08fb5e0a0b xous: add send() to String
This call can be used to send a string to a Server.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:28:47 +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
bb304d412a xous: add can_call_from_interrupt() to SysCall
This function can be used to determine if a particular syscall may be
called from an interrupt context.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:26:33 +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
8ac141af1b cargo: commit latest lockfile
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 21:28:33 +08:00
Sean Cross
4f2be0c0e1 shell: use log-server for message logging
This paves the way for no longer needing our own UART for this process.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 21:27:35 +08:00
Sean Cross
1ffc440565 graphics-server: use log-server for all message printing
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 21:27:06 +08:00
Sean Cross
e18219b078 log-server: add first draft of logging server
This server implements `log`, and comes with a `lib` that allows for
setting up logging.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 21:26:19 +08:00
Sean Cross
4650e865fb xous: String: add from_message() as an initializer
Allow creating a `String` from a `MemoryMessage`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 20:51:29 +08:00
Sean Cross
d76832dada kernel: services: return ServerNotFound when server isn't found
This is more intuitive than `OutOfMemory`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 20:43:59 +08:00
Sean Cross
2244a78f16 kernel: allow syscall processing when printing is disabled
Due to a missing comment, syscalls wouldn't work at all when printing
was disabled. Fix this.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 20:43:22 +08:00
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
f46f7c6e81 shell: use new String struct from xous
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 11:19:43 +08:00
Sean Cross
9192775e5e graphics-server: use String for String opcode
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 11:19:17 +08:00
Sean Cross
f149c086ef xous: add String
This is a basic String that can be passed as a Message.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 11:18:48 +08:00
Sean Cross
4df3296d99 cargo: commit lockfile
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:31:37 +08:00
Sean Cross
c33794c859 shell: use new graphics subsystem
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:30:34 +08:00
Sean Cross
7fc8dafc39 shell: add StringBuffer struct
Add a StringBuffer struct that can be used to create string messages.

This will eventually be promoted to Xous.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:29:58 +08:00
Sean Cross
2d4a2bf871 ticktimer: use millis instead of nanos on hosted
The `elapsed_ms()` function should probably return milliseconds rather
than nanoseconds. Time marches on.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:29:12 +08:00
Sean Cross
c7164c461d log-server: unify print messages for log_string
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:28:01 +08:00
Sean Cross
5823c23472 log-server: unify log messages
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:27:13 +08:00
Sean Cross
d9f858bcf0 log-server: remove pancurses dependency
This hasn't been required in a very long time.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:26:16 +08:00
Sean Cross
af1a7f5ba5 graphics-server: first general merge of gfxlib
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:22:03 +08:00
Sean Cross
7607b0f9ee graphics-server: remove embedded-graphics from backends
Use native drawing for these platforms.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:21:06 +08:00
Sean Cross
a2fd6b0438 graphics-server: remove dependency on embedded-graphics
The graphics server will implement its own routines.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:20: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
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
39c9ef30b7 xous: definitions: add memory() call to Result
This is used to get attached Memory from a Result, if any.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:13:09 +08:00
Sean Cross
8115c2e7cf xous: hosted: remove print!() monitoring network traffic
This was useful when tracking down network traffic issues. It is no
longer useful.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:12:32 +08:00
Sean Cross
a35a75b1f2 xous: carton: use send_message()
This function now works as expected.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:11:35 +08:00
Sean Cross
6225cf11b0 cargo: sync lockfile
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-29 19:48:23 +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
Sean Cross
7aab01c95d xous: fix memory messages in hosted environment
This fixes passing memory between clients and servers when running
n a hosted environment.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-29 19:40:41 +08:00
Sean Cross
ca32e4f9c1 macros: call xous::init() at init-time
This allows for hooking things like the panic handler.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-29 19:39:34 +08:00
Sean Cross
ef33cc577f macros: use matches!() to fix build warning
This is a new feature, and Rust really wants us to use it.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-29 19:39:12 +08:00
Sean Cross
67adccf16a xous: hosted: attach to debugger on panic
When a `panic!()` is hit and we're running in a hosted environment,
attach a debugger using `debug-here`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-29 19:38:27 +08:00
Sean Cross
0bce0eeb53 ticktimer: implement hosted version of ticktimer
This gets the basic ticktimer server working in a hosted environment.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-28 11:14:26 +08:00
Sean Cross
4334e7c23e shell: fix build for hosted
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-28 11:14:09 +08:00
Sean Cross
f9af2322f7 log-server: fix compiling for hosted builds
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-28 11:13:39 +08:00
bunnie
e0f3450b26 Merge branch 'master' of github.com:betrusted-io/xous-core 2020-10-15 13:15:38 +08:00