The old strategy was to only do context switching
from within the PendSV handler. This worked fine
until now because all syscalls were handled either
atomically or just returned -EAGAIN if the
resource was locked or busy. However, with the
introduction of I/O wait, we need to be able to
sleep directly from within the kernel by moving
the context switching completely into the kernel.
It was inevitable, tbh. I really wanted to do
everything entirely from scratch, but all those
hardware registers are just too much to be
maintained by a single person. And since i plan
on supporting different boards at some point in
the future, it would be complete madness to redo
everything for that board.
This is an initial, rudimentary attempt at integrating the scheduler
into the kent hierarchy. There are likely gonna be drastic changes
in the future, and i haven't even tried running the whole thing.
But hey, the code compiles again now!
Ardix is being relicensed to GPL v3 or later. I have no idea whether you
can just do this if you feel like it or if it has any consequences, but
i kinda don't really care that much about it. Any changes made after
this commit will definitely fall under the GPL though, and considering
that only few things are really working yet anyways this is good enough
for me.
Living as a sheep herder on a lonely island is becoming an increasingly
appealing option the more i am exposed to my stupidity and inability
to memorize the return values of basic libc functions that i even
implemented myself two fucking months ago.