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>
Due to an initial misunderstanding of how the RISC-V is architected,
contexts were going to be an emergent property of the kernel.
However, after further consideration, contexts must now be baked into
the kernel. Switching between contexts can be handled by the scheduler,
but the kernel must keep track of processor registers.
Keep track of context IDs and ensure they are sane. With this patch,
interrupts work, as does basic context switching.
Signed-off-by: Sean Cross <sean@xobs.io>
We were loading both the context and the banked context, which resulted
in an invalid context being selected. This caused a cascading failure.
Load only the lower halfword in order to correctly enter the interrupt
context.
Signed-off-by: Sean Cross <sean@xobs.io>
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>