5 ms·
What about the boot sequence and driver enumeration? How is this handled in RISC-V? This has traditionally been one of the major obstacles to ARM - you need dif
by pjc50 9y ago
What about the boot sequence and driver enumeration? How is this handled in RISC-V? This has traditionally been one of the major obstacles to ARM - you need different kernels for two ARM devices with nominally the same core because of initialisation differences.
Devicetree makes this better but not 100% as simple as the old "legacy" PC boot sequence was. Ironically these days PCs are quite hard to boot too with UEFI.
- nickik 9y agoThere are still many issues left and it will not be easy to figure out all these things. It will have many of the same problems as ARM but hopefully the community can work on these.
- rwmj 9y agoFor servers, they're looking at ARM SBSA as a model. There's already some starting work on UEFI for RISC-V (done by HPE).
- Zaak 9y ago> There's already some starting work on UEFI for RISC-V That makes me deeply sad.
- rwmj 9y agoWhy? UEFI is open source. It's standardized, and provides standard interfaces to boot-time device drivers and to operating systems above. It provides a reasonable command line (TBH much preferable to u-boot). It works well with Linux and Windows. It's complicated, but it's solving a complicated problem.
- jabl 9y agoParts of this presentation has some explanation: https://schd.ws/hosted_files/osseu17/84/Replace%20UEFI%20with%20Linux.pdf https://schd.ws/hosted_files/osseu17/84/Replace%20UEFI%20wit... (obviously you can ignore Intel x86 specific stuff like the ME). OpenPOWER apparently does something similar, i.e. a minimal firmware that loads a Linux kernel + simple userspace from flash.
- rwmj 9y agoOn RISC-V the machine layer (like ME) will be completely open source, and so will UEFI. You're inventing a problem that doesn't exist.
- jabl 9y agoOpen source is a necessary but not sufficient criterion. Leaving aside the issue of user-replacable signing keys if some kind of measured boot system is in use, and availability of documentation so you can replace the firmware if you want, which isn't really UEFI's fault, there's other issues with UEFI as well. Such as: - Why does it take 8 minutes to boot a UEFI server vs. 17 seconds with NERF? Minnich's opinion is that it's the braindead way UEFI initializes stuff. E.g. if thingy A needs thingy B, it will initialize thingy B regardless of whether it has already been initialized, etc.. Leading to a combinatorial explosion. Whereas Linux builds a dependency tree and initializes each thing only once, in the correct order. - UEFI option ROM's apparently mostly contain x86-64 code and not UEFI byte code. Some clever guys at SUSE had managed to work around that on aarch64 by using qemu to run the option ROM's, and since the x86-64 and aarch64 data structure layouts are more or less the same (endianness, alignment etc.) they could share the memory space. I mean, it's an awesomely clever hack, but do we really want a Frankenstein thing like this be the bright future we're striving for? - UEFI is amazingly complicated. Say if you want to load the kernel over HTTPS, you need a TCP stack, HTTP, TLS etc. Sure, Linux is also complicated, but I'm sure Linux is 1000x more battle tested than the UEFI stack. And, if you're going to run Linux anyway, you're not increasing the attack surface by running Linux as your firmware & boot loader. And, if you're using booting Linux from the rom flash, you can use Linux native drivers to access the NIC, storage, USB, whatever and don't need the kind of hacks mentioned above on non-x86. Sure, using Linux as firmware & boot loader might be politically untenable to some proprietary OS vendors. But so what? Let them solve their own problems!
- daurnimator 9y agoSee http://www.youtube.com/watch?v=V2aq5M3Q76U http://www.youtube.com/watch?v=V2aq5M3Q76U
- Zaak 9y agoExactly. UEFI is a bad idea implemented badly.
- deleted 9y ago[deleted]
- jws 9y agoPCs are quite hard to boot too with UEFI Let's hope RISC-V can avoid something stunningly complex like ACPI while they are at it. You might be trying to write a secure OS of well reviewed code, then suddenly find that to reliably shut down a PC you need ACPI which drags in 100000 lines of code including an interpreter capable of accessing arbitrary physical addresses. (Or you just try all the shutdown mechanisms you've ever heard of and hope one of them nails the machine you are running on.) I wonder if hardware is easy enough now that a platform could require that all optional hardware respond with a UUID during an enumeration phase. That would have been a burden back in early ISA days when things were as simple as a couple registers on a card, but maybe now it isn't. Then the OS can handle the ones it knows about and leave the rest alone.
- tmzt 9y agoWhat about dtb and standardizing something like coreboot's libfirmware. Should it really be up to every hardware block to support full introspection? Doesn't that start to turn into PnPIsA? The eeprom solution starts to sound a lot like how Dimms are identified and configured.
- hinkley 9y agoLearning to write a better ACPI script for my lifebook was a big accomplishment for me, but ultimately lead me to a 13” MacBook Pro. I suspect it’s such a hidden part of the whole process of using a computer that few repercussions are felt. Since not enough negative PR value, it changes but slowly. Though it sure does suck for portability.
- tmzt 9y agoIt would be pretty cool to have a DSDT to kernel c compiler allowing us to port our laptops over to native power management over time. We should be able to write gpio chip drivers for the actual hardware which the interpreter normally targets and eventually eliminate ACPI from our systems.
- sliverstorm 9y agoI suspect it’s such a hidden part of the whole process of using a computer that few repercussions are felt. Not only hidden, but mostly does its job these days, and has been ignored by everyone so they can get on to writing "Uber but with ML". There's a shocking amount of stuff like that, made decades ago and still there just because... well, it's still working.
- ansible 9y agoHeh. Device Tree only deals with a fraction of the problem. Here's what I think would help: (warning: lots of work!) 1. Large database of free peripherals and foundational blocks. Not just UARTs and SATA controllers, but also network interconnects (crossbar), SDRAM controllers, and all the other bits that go into a modern System-On-Chip (SoC). Power management is a huge pain in general, and is widely different among chip families even from the same vendor. 1.A. Obviously, the above implies a decent set of open-source drivers for multiple operating systems for the peripherals. At the very least, you need support for a bootloader, a real-time OS, and Linux. Preferably with no binary blobs. 2. A standard for enumeration of these on-chip peripherals. There should be a way to query the chip itself to see what is included in the SoC, what device addresses they have, what options are enabled (like how many interrupts), and how the peripheral lines (if any) are connected (IO mapping). 3. Some widely-accepted standard for storing the board configuration as well. This could just be a I2C EEPROM, but it has to have a listing of everything connected to the SoC and how. This I2C is mapped to these pins, and has this accelerometer connected at this I2C address. And all the hardware manufacturers (who produce the boards) have to be convinced this is a good idea to have this extra cost (and space) built into their products. Only after all that would you have a fighting chance to boot a relatively generic kernel and have it actually run. And then have a fighting chance to have the ability for the end-user to upgrade the software after the manufacturer has ceased support. The cross-platform situation with PCs is light-years ahead of where we are in the embedded space.
- cjbprime 9y agoStep 3 is often achieved by having the firmware append a device tree blob to the kernel which contains all of the board setup. I think it's pretty widely adopted?
- ansible 9y agoYes, it is headed in that direction. There's more work needed in areas like uniform conventions for configuring peripheral pins and such, in my opinion. And then there's clock configuration, which is kind of a mess, because everything is hooked up differently on different SoCs that I've seen. It would also be nice if vendors always shipped up-to-date device tree source files for any board they ship.
- lloeki 9y ago> as simple as the old "legacy" PC boot sequence was. Some of the Hackintosh folks know how much this can be false. As soon as you step out of real mode / VESA graphics, all bets are off, those ACPI tables can be a real PITA, and you may have to fix stuff by extracting, editing and recompiling your SSDT/DSDT, at which point you generally wonder how the stock ones worked at all in the first place: missing symbols, broken CPU state tables... (well, deep inside you know, Windows/Linux are doing a hell of a job doing their best at working around all that mess)