[TUHS] Porting the SysIII kernel: boot, config & device drivers

Dan Cross crossd at gmail.com
Sun Jan 1 07:10:47 AEST 2023


On Sat, Dec 31, 2022 at 2:08 PM Clem Cole <clemc at ccc.com> wrote:
> On Sat, Dec 31, 2022 at 10:02 AM Dan Cross <crossd at gmail.com> wrote:
>> [snip]
>> SBI was/is an attempt to define a common interface to different
>> devices using RISC-V CPUs, but it's growing wildly and tending more
>> towards UEFI+ACPI than something like OpenBoot, which was much
>> simpler.
>
> UEFI+ACPI got/gets a bad rep because of the original IBM BIOS implementations.

I'm going to push back on this slightly: UEFI+ACPI get a bad rap
because, well, they're really pretty bad. Oh sure, some things are
reasonable: the ACPI table formats aren't awful. But I've been inside
a couple of these now and phew golly, they stink pretty badly. The
code is poor quality, and encourages running blobs of really dubious
provenance. See below....

>> In general, the idea of a BIOS isn't terrible: provide an interface
>> that decouples the OS and hardware.
>
> Exactly - the idea is actually a good one.  But the problem was the BIOS designed/implemented by HW people, but OS folks.  Things like concurrency minimum use of the CPU was not in the higher order bits.
>
>> But in practice, no one has come
>> up with a particularly good set of interfaces yet. Ironically,
>> BSD-style autoconfig might have been the best yet.
>
> ??Maybe because it was OS types who knew what the OS needed to discover/report/deliver back from the HW.

Perhaps this is what it is, but I think taking a step back and looking
at the problem more generally, it's because they're mutated into
solving the wrong problem. Consider AML: isn't this something that
ought to be handled in, I don't know, a device driver? Yes, that
driver may need access to some platform-specific firmware to abstract
the details, but an entire virtual machine running random code to
provide abstractions for the firmware writers who are running,
basically, a parallel operating systems is a bit on the nose. This
goes way beyond OpenBoot's forth modules on option ROMs (which were
kind of a nifty idea for device discovery and such things).

Mothy Roscoe gave a really interesting keynote at OSDI'21:
https://www.youtube.com/watch?v=36myc8wQhLo

I love how he describes the interfaces we have now as having
"congealed." But in some ways, UEFI+ACPI are the antithesis of what
the OS should be doing.

        - Dan C.


More information about the TUHS mailing list