Commit graph

35 commits

Author SHA1 Message Date
Sean Cross
bef0168c20 kernel: more warning fixes
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-09 22:14:14 +08:00
Sean Cross
ba30b4919d kernel: remove more warnings
Still haven't run it on real hardware, but this removes more warnings
from the system.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-09 21:52:28 +08:00
Sean Cross
8ccecb6d99 kernel: down to 12 errors again
Slowly chipping away at it.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-09 20:59:31 +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
ebf568dadd baremetal: slowly whittling down the number of errors
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-09 16:14:34 +08:00
Sean Cross
285b92401e mem: get tests working again on hosted
This fixes all tests so they now work (and pass!) when running in a
hosted environment.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-03 18:15:56 +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
ef0ef924c8 fix more clippy warnings
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-29 22:48:48 +08:00
Sean Cross
cece761ff1 xous: SID: convert to using newtype
Rather than simply casting a tuple as a type, create a new struct SID.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-29 20:03:21 +08:00
Sean Cross
0ffbaa369a kernel: fix remaining warnings
This just silences them, which isn't great in the long run.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-14 15:16:51 +08:00
Sean Cross
05ccba9450 kernel: implement move test
We can now `Move` memory from one "process" to another.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-13 18:31:51 +08:00
Sean Cross
40ed6365e2 first memory message works
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-13 17:41:50 +08:00
Sean Cross
9f1b1e7ec8 kernel: tests: get both tests working
We now have two tests. These tests may be run either in parallel or in series.

If they are run in parallel, then they will each have their own thread
local storage, and each will initialize things from scratch.

If they are run in series, then the thread local storage will be reused
between the two processes.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-25 17:41:17 +08:00
Sean Cross
2786ad697b kernel: get scalar message passing working again
This gets basic scalar message passing working again. With this, the
following operations may be performed:

    * Starting a server
    * Connecting to a server
    * Sending a scalar message

Care must be taken to not overflow a server's queue, particularly if
writers are faster than readers.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-16 16:34:49 +08:00
Sean Cross
723529ba20 wip: working on getting message passing working
The goal is to get a basic message passing engine working that will also
function as a device that works on real hardware.

This is still reworking it to function correctly on a desktop system.
Once that is working, it will be reworked to function once again on
hardware.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-15 18:13:10 +08:00
Sean Cross
21c46de60e kernel: move to allow hosted init
This prepares for new calls to init SystemServices and the MemoryManager
so that they can be initialized with something other than a
KernelArguments struct.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-03 18:28:22 +08:00
Sean Cross
9c5cb3da32 kernel: properly share pages between processes
This improves page sharing.  Permissions are retained during sharing,
and we should now be able to share multiple pages.  Additionally, this
lays the groundwork for mutable sharing.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-03 12:28:44 +08:00
Sean Cross
bdb8eac9ad MemoryRange: move to using this struct for memory ranges
This is a combination of MemoryAddress and MemorySize.  This is
guaranteed to be not null.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-01 10:28:36 +08:00
Sean Cross
a947d7fd79 kernel: clean up most warnings
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-31 18:37:19 +08:00
Sean Cross
abce9eb0c1 message::move: implement movable messages
This is the first implementation of message passing with moving memory.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-31 18:03:19 +08:00
Sean Cross
8c3f931445 messaging: first message passing example
THis commit allows us to pass Scalar messages between processes.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-30 16:07:58 +08:00
Sean Cross
0be1b8b94c kernel: mem: don't unilaterally hand memory to userspace
If it's needed for use in the kernel, don't hand it over.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-23 12:58:13 +08:00
Sean Cross
ebe3efc097 kernel: properly zero out pages prior to handing them to userspace
Until now, we were relying on luck to ensure pages were zeroed.
However, now we properly zero pages in the kernel before handing them
off to userspace.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-17 11:35:38 +08:00
Sean Cross
85522602ea kernel: silence warnings and remove excess prints
These prints were used to debug errors in the new process switching
architecture.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-16 19:03:10 +08:00
Sean Cross
022bedc8e3 kernel: refactor processes to support banking
We now have a concept of context banking.  When an interrupt fires, the
process context is banked.

As part of this, process-level data is now stored in the page within the
process itself.  This reduces memory consumption and allows us to have
features such as a hash within each process itself.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-16 18:22:59 +08:00
Sean Cross
99d19866cf kernel: mem: zero out memory as part of alloc()
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-14 22:11:57 +08:00
Sean Cross
77c07f0d79 mem: add map_page()
This shortcut function ensures a page is mapped.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-14 22:06:00 +08:00
Sean Cross
7a3e038e6b syscall: add intial CreateServer call
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-13 22:41:25 +08:00
Sean Cross
c2008e5fe8 syscall: implement map_memory wrapper
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-13 20:33:08 +08:00
Sean Cross
08e416c776 kernel: support omitting virtual address when mapping
This forms the basis for message passing.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-13 12:44:23 +08:00
Sean Cross
967464df93 kernel: mem: rename last memory address variable
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-13 09:52:53 +08:00
Sean Cross
fb3da7294c mem: turn function comment into rustdoc
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-13 08:32:44 +08:00
Sean Cross
87676c0fc5 mem: start implementing find_virtual_address()
Right now it just returns the address, which is exactly what we had
before.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-12 17:01:40 +08:00
Sean Cross
c1b575507d mem: better handling of memory alloc failures
Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-12 16:51:14 +08:00
Sean Cross
f50ec67553 initial commit
This pulls together many disparate repositories into one xous-core
repository.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-10 12:13:05 +08:00