Commit graph

306 commits

Author SHA1 Message Date
bunnie
0889e83401 Merge remote-tracking branch 'betrusted/hardware' 2021-03-02 21:51:41 +08:00
bunnie
2d59adbe0e fix thread scheduling bug
the code originally would pick the same thread over and over again
this fix starts the thread search at one plus the current thread
wrapping around to one plus the current thread, so we always try
to pick a new thread compared to the current one, instead of
generally picking the same thread most of the time.
2021-03-02 21:46:14 +08:00
bunnie
4b0f50293f another intermediate commit 2021-03-02 21:15:40 +08:00
bunnie
96a19baa8d state before refactor of status to own process 2021-03-02 19:25:41 +08:00
bunnie
d1609d2a31 another commit checkpoint. somehow, i have a race condition now. 2021-03-01 15:08:08 +08:00
bunnie
70aa5b792b check in for inspection 2021-03-01 14:40:39 +08:00
bunnie
0dc40f4185 attempt to separate fontmaps and loader out of kernel 2021-02-27 02:12:19 +08:00
bunnie
e175d922f0 Merge branch 'hardware' 2021-02-18 02:35:40 +08:00
bunnie
5cdf597a5b fixup tests 2021-02-18 02:35:11 +08:00
bunnie
cb77dde6d8
Merge pull request #39 from betrusted-io/hardware
Synchronize in the rkyv changes
2021-02-18 02:07:13 +08:00
bunnie
0af72ffb6d clean up Sendable references and warnings 2021-02-17 23:29:20 +08:00
Sean Cross
6119c78bc7 kernel: riscv: really fix sharing logic
We're comparing numbers and not MMUFlags, so invalid values crept in.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 17:35:13 +08:00
Sean Cross
b6a28a85fc kernel: riscv: invert shared logic
This logic was backwards.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 17:28:49 +08:00
Sean Cross
e9a1da25b0 kernel: riscv: mark address_available() as false when shared
When a page is shared, only report an address as being available when
we receive a `BadAddress` error when doing the translation. Otherwise,
assume it is in use.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 17:23:05 +08:00
Sean Cross
3b85392877 kernel: riscv: return ShareViolation when memory is shared
When memory has been shared, it is no longer valid. However, it is still
"in use".

Return a `ShareViolation` error in this case so we can check for it
elsewhere.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-17 17:23:05 +08:00
Sean Cross
fbad2e4391 kernel: riscv: don't allow multi-sharing of lends
Initially, we wanted to be able to immutably lend data in a one-to-many
fashion. However, this has proven challenging, and doesn't have any
immediately obvious useful benefits.

For now, only allow one-to-one immutable lends.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-16 20:26:27 +08:00
Sean Cross
b9a4e11a64 kernel: riscv: use bit flags for irq handler
Instead of hardcoding bit values, use the symbolic names. This will
ensure we don't make mistakes by using magic numbers.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-16 20:25:42 +08:00
bunnie
b803d7d4e9 commit that captures the multiple lend bug 2021-02-16 12:42:11 +08:00
bunnie
2b003f8a7d intermediate checkin 2021-02-16 00:28:44 +08:00
bunnie
2a46f541f2 add PID identification facility to help with debugging 2021-02-15 19:15:58 +08:00
bunnie
fc8290cdb4 futzing around and something is kind of working on xous-string port to rkyv 2021-02-15 00:05:42 +08:00
Sean Cross
715e76bee0 kernel: allow connection IDs to be u32
In an effort to homogonize platforms, we are moving away from `usize` in
favour of `u32`. Allow the `CID` type to be a `u32` in the kernel by
casting it to a `usize` as necessary.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-04 10:29:12 +08:00
Lina Ceballos
520c5aa18f
adding license info to README 2021-01-25 14:57:39 +01:00
Lina Ceballos
d18500f4d6 adding license and copyright headers 2021-01-25 14:54:00 +01:00
Sean Cross
6cf140f2da kernel: riscv: don't print valid page faults
Some page faults are valid, and shouldn't be printed unless they fail.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-13 21:09:40 +08: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
Sean Cross
e87eb112ae kernel: debug: fix const warnings
This makes debug a const, which prevents it from getting copied all over
the place.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-13 21:09:05 +08:00
bunnie
4ef581a266 riddled with race conditions, but...sort of works 2021-01-08 05:20:53 +08:00
bunnie
9716eba039 Merge remote-tracking branch 'origin/master' into hardware 2021-01-07 20:34:04 +08:00
Sean Cross
b16ad82e56 kernel: riscv: print out allocated address
This will aid in debugging.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-07 18:50:48 +08:00
Sean Cross
05464b945b kernel: print out panic messages
This enables `println!()` but avoids the excessive debug spew

Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-07 18:50:19 +08:00
Sean Cross
b884c8ed4f kernel: riscv: use page base addr when allocating pages
When allocating a page, it is only assigned a physical address once it
is actually needed. This on-demand paging works well, however we were
assuming that the first address of a page was accessed first.

This fixes an issue where a Message is allocated but the first byte
isn't accessed first.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-07 13:40:21 +08:00
Sean Cross
6cbec94953 kernel: riscv: use page base addr when allocating pages
When allocating a page, it is only assigned a physical address once it
is actually needed. This on-demand paging works well, however we were
assuming that the first address of a page was accessed first.

This fixes an issue where a Message is allocated but the first byte
isn't accessed first.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-07 13:34:42 +08:00
bunnie
b7263f7ef0 Merge remote-tracking branch 'origin/master' into hardware 2021-01-04 03:19:23 +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
bunnie
63234411e2 get fcc test working 2021-01-02 03:04:28 +08:00
bunnie
3ceb41208c checkpoint: problems with pds send line (borrowed memory) 2021-01-01 03:44:42 +08:00
Sean Cross
a36ceb00c2 kernel: use crossbeam for tests
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-30 16:51:21 +08:00
Sean Cross
c9cb50b579 kernel: use crossbeam-channel internally
This provides better performance than MPSC.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-30 16:50:28 +08:00
bunnie
ed5624635b Merge branch 'master' of https://github.com/betrusted-io/xous-core into hardware 2020-12-14 17:58:39 +08:00
bunnie
c9a18125df add hardware TRNG support to kernel (issue #16) 2020-12-14 17:57:29 +08:00
Sean Cross
ddd57c30bd kernel: fix compile error when debug-print enabled
This tracks a variable that has been renamed, and was preventing the
kernel from compiling when debug printing is enabled.

This fixes #19.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-14 17:02:58 +08:00
hasheddan
1953c0f9d9
Update kernel README.md links to other docs
Fixes links in kernel directory README.md to top-level documentation.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-12-06 10:41:53 -06: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
1fa83d1d94 xous: make MessageSender a struct
This is now an object instead of an alias for `usize`, in preparation
for adding a `.pid()` function.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 22:16:24 +08:00
Sean Cross
1f1a535801 kernel: fix pid generation for non-test case
When compiling under non-test scenarios, the `rand` create conflicts
with the new `rand` module.

Disambiguate this field.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 21:12:18 +08:00
Sean Cross
168ffe004e kernel: use create_server() for some tests
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:59:21 +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