Hacker News new | past | comments | ask | show | jobs | submit login

I'm not sure I would buy a RISC-V board yet. In particular it is still in the stage where knowledge about the platform has to be hard coded rather than probed at runtime. For example the location of MMIO devices like CLINT (time/interrupt controller) and physical memory attributes. The spec says something like "the platform must provide a method for software to discover this" but it doesn't specify how and as far as I know the current method is that it should read the manual!

There is a placeholder CSR mconfigptr that I believe is intended to fix this by pointing to a DeviceTree blob which would solve this (someone correct me if I'm wrong) but none of that is standardised yet.

I work on RISC-V and I think it's great and ARM should be very very worried but if you buy this you're on the bleeding edge and don't expect the software experience you'd get on x86 or even RPi. Give it a few years and I expect the story will be very different.




>In particular it is still in the stage where knowledge about the platform has to be hard coded rather than probed at runtime.

Avoidance of fixed memory addresses is intentional and by design.

The boot and platform specifications cover how to deal with this.

In its simplest form, when your code runs, you get a pointer to a DTB in a specific register.

More complex variants include the RISC-V UEFI protocol (ratified) as well as the (work in progress spec) ACPI protocol.


I think the solution is simple: ACPI


I don't have any experience of ACPI but it doesn't not sound like a sane alternative to DeviceTree:

https://stackoverflow.com/a/56235466/265521

> ACPI is the unprofessional, hackish attempt of bios and board vendors to solve a small subset of the problems that DT already solved long ago.

> In November 2003, Linus Torvalds—author of the Linux kernel—described ACPI as "a complete design disaster in every way".

I'm not sure Linus has the best design sense but it doesn't sound like he is wrong here:

> Much of the firmware ACPI functionality is provided in bytecode of ACPI Machine Language (AML), a Turing-complete, domain-specific low-level language, stored in the ACPI tables.[7] To make use of the ACPI tables, the operating system must have an interpreter for the AML bytecode. A reference AML interpreter implementation is provided by the ACPI Component Architecture (ACPICA). At the BIOS development time, AML bytecode is compiled from the ASL (ACPI Source Language) code.

Wtf.


What would you use instead of bytecode? I think the problem with ACPI is the clunky implementation, not the basic ideas themselves.


I'm still learning about this stuff to be honest, but I don't really understand what problems would need bytecode in the first place? What is implemented in ACPI in bytecode?


CPU and OS independent methods. For example to shutdown, reboot or change video mode. Much easier to run a bytecode sandboxed on any platform.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: