lots of terrible stuff going on, nothing tested, but we have
a baseline of whatever they put in C directly forced into Rust.
A lot of really naughty things going on with raw pointers in this
driver -- it's going to be a challenge to oxidize.
this is an actually usable driver for end applications.
maybe some massaging needs to be done on shared resources, but
from the i2c standpoint this can do SMB, I2C transactions with
a fairly "normal" API.
this works by blowing apart the structure and re-assembling
it on the other side. The reason we can't simply pass it
is because the hardware pointer to the core register violates
a Rust safety rule, but Rust doesn't know that this pointer
points to a hardware register that's immutable and static versus
a regular block of memory that can go away.
the logger is the console output. so, unfortunately, this is
where the console input is tied to in hardware.
We want the logger to be 100% dependency free, so we must
rely on a simple "well known server" (e.g. a server with a fixed
address) to bounce keyboard input into the keyboard service itself.
This does mean that anyone who knows the name of that server can
simply inject key presses into the system!
this API has the unfortunate problem that only one process
can manage all the IRQs for all the serial ports, due to the
concentration of all IRQs into a single register bank.
That being said, it does support registering multiple repsonders
in a somewhat ergonomic fashion.
The loader bringup now has some IRQ testing built into it.
Couldn't actually get an IRQ to trigger, but it has to do something
more with me not getting the RV IRQ machine bits configured right
than anything else. However, the stub is useful for confirming
which IRQ bits actually fire on the UDMA UART implementation,
which is the big point. There's an ambiguity in the wiring
of the UDMA block which isn't explained at all, which is the
fact that there's an RX interrupt and an RX_CHAR interrupt.
I still don't know what RX_CHAR does, but the RX interrupt
does fire when a character is received, so that's the one
we're going to use.