296 points · by rwmj · 9y ago · 72 comments
The road is long for RISC-V but I think the project is progressing about as fast as one can hope for. Thanks to everybody who helps with this.
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.
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.
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.
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.
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.
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)
One problem is that games are usually closed source and are rarely freed. Another problem is that there are no open graphics driver for common single board computers. The latter problem is being worked on by the amazing Mesa project. What can be done about the former?
I worry that games will be abandoned and never be freed. The copyright of movies eventually expires and they become a common good. What about closed binaries compiled for obsolete hardware and software?
"Oh yeah, all those old folk at the turn of the milennia had this thing called copyright and all their code was proprietary so we no longer can run or use 99% of software written between 1970 and 20XX".
"And there are these files where it was a felony to be able to access them!"
Wow those guys were sure dumb. Now all our information is open and shared and makes the world a better place and anyone can use it or improve it!
All I can is lets hope its only until a 20XX that we get over the facade of IP being worth the cost.
And it won't be that far from archaeologists being prevented to decipher any ancient language. If today's copyright laws existed in historic times we wouldn't have precious documents copied by monks nor the Rosetta Stone. It's just dumb crazy how this works.
As for movie copyright, this is the true purpose of DRM -- to try to make copyright eternal by locking away the content behind strong-enough encryption and then licensing the keys. And of course, breaking DRM (even if the content itself is no longer protected by copyright) is a felony.
>Another problem is that there are no open graphics driver for common single board computers. The latter problem is being worked on by the amazing Mesa project. What can be done about the former?
Can you tell me more about this?
Mali 400 (Allwinner A20) https://github.com/yuq/mesa-lima
Adreno 2xx, 3xx, 4xx https://github.com/freedreno https://mesamatrix.net/
VC4 (Raspberry Pi) https://github.com/anholt/mesa/wiki/VC4
If the VC4 or Mali driver mature, then that'd be a huge step forward.
Related Question:
Why is Google developing a new operating system for their devices from scratch? Will this operating system be incompatible with all existing software? Or will it be compatible with software and hardware platforms like this one through some sort of compatibility layer?
https://news.ycombinator.com/item?id=13649523
https://news.ycombinator.com/item?id=15041567
https://news.ycombinator.com/item?id=15059349
The other option that is coming is from lowrisc.org, but they are a small team so it's taking a long time and have no idea when they might be thinking of delivering hardware.
[1] https://www.sifive.com/products/freedom-e310/
That would be a fun thing to to do.
[1] https://rwmj.wordpress.com/2016/07/25/risc-v-on-an-fpga-pt-1...
[2] https://rwmj.wordpress.com/2016/07/26/risc-v-on-an-fpga-pt-4...
https://forums.sifive.com/t/building-linux-for-custom-u500/2...
I assumed SiFive was waiting for the privileged instructions to be finalized before making real chips. But people have been running Linux on their stuff on FPGA for a while now.
Also, how is this different to: https://wiki.debian.org/RISC-V ?
Functionality wise, what's been merged is only a subset.
ABIs have changed after we did this. We get the first long-term stable ABI with 4.15 kernel and glibc 2.27 (hopefully). At that point Fedora, Debian, and others can reboot efforts.
Pull request: http://lkml.iu.edu/hypermail/linux/kernel/1711.1/04263.html