This fixes the case where there is only one process active and it tries
to send messages to itself, or it yields to itself.
This closes issue #42.
Signed-off-by: Sean Cross <sean@xobs.io>
This allows us to use println early on even before it's initialized,
which will allow us to ignore prints to an uninitialized port.
Signed-off-by: Sean Cross <sean@xobs.io>
Memory that was marked as reserved-but-not-in-use could get reallocated.
Practically speaking, this caused threads to share stack, which makes
things spooky.
Signed-off-by: Sean Cross <sean@xobs.io>
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.
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>
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>
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>
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>
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>
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>
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>
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>