News for hackers. Stuff that matters.
Re:RISC-V OS using Rust: Filesystems by fluffything on Tuesday May 12, 2020 @04:21PM (#23159198)
This is awesome. I've been following along for a while, so please keep it up.

I wish someday we'll get something like the ESP32 boards but with RISCV.

Re:RISC-V OS using Rust: Filesystems by pavehawk2007 on Tuesday May 12, 2020 @04:53PM (#23159640)
Thanks!

You might want to check out the Kendryte K210. I'm trying out these boards for development. They are designed with two (I think) 64-bit RISC-V cores with a hardware FPU. https://www.seeedstudio.com/blog/2019/09/12/get-started-with...

I've flashed mine a few times, but I'm still working to getting it to work. The documentation isn't very good, so I'm working to reverse engineer some aspects of it.

This is a low cost alternative. Of course, we could go with the SiFive Unleashed (64-bit) or the SiFive HiFive1, which uses a 32-bit RISC-V CPU in an Arduino form factor. https://www.sifive.com/boards

The SiFive Unleashed cost me a cool $1k, so I'm still scared to mess with it.

Re:RISC-V OS using Rust: Filesystems by FullyFunctional on Tuesday May 12, 2020 @06:04PM (#23160552)
The Kendryte is pretty limited in many ways, not least that it's permanently limited to 8 MiB of DRAM (AFAIK).

The most interesting route is using an FPGA. There are many examples of running RISC-V softcores on FPGAs (for example, Berkeley's RocketChip) and many boards that support a decent amount of memory (even beyond 1 GiB).

Re:RISC-V OS using Rust: Filesystems by pavehawk2007 on Tuesday May 12, 2020 @06:21PM (#23160756)
I tried some of SiFive's evaluation cores. They limit you quite a bit unless you pay. Furthermore, many of the FPGAs worth their salt were quite expensive. The K210 in the MaixBit form is only $20, and it comes with a camera and LCD. For hobbyists, I think it's a good compromise.

I looked at the Xilinx FPGAs--the ones SiFive recommends, but they're quite pricey.

Which FPGAs had you had luck with?

Re:RISC-V OS using Rust: Filesystems by pcein on Tuesday May 12, 2020 @11:55PM (#23163317)
I haven't used them myself, but these boards look awesome, and they are supported by an end-to-end open source toolchain:

1. https://www.crowdsupply.com/1bitsquared/icebreaker-fpga 2. https://www.crowdsupply.com/radiona/ulx3s 3. https://groupgets.com/campaigns/710-orangecrab

Re:RISC-V OS using Rust: Filesystems by fluffything on Wednesday May 13, 2020 @06:58AM (#23165607)
I was looking at getting this Maixduino kit since it appears to be the cheapest solution that satisfies my constraints (RISCV core + WiFi):

https://www.seeedstudio.com/Sipeed-Maixduino-Kit-for-RISC-V-...

I'm not sure what's the status of programming these from Rust. I suppose that you will probably need to build your own toolchain that links the Seeedstudio libraries.

Re:RISC-V OS using Rust: Filesystems by pavehawk2007 on Wednesday May 13, 2020 @10:05AM (#23166978)
RISC-V has their own supported toolchain. You can get it here: https://github.com/riscv/riscv-gnu-toolchain.git

With Rust, you can do what I did with my OS. It can compile out of the box. The kendryte has a "BSP" (base support package) that is essentially a minimal OS, but it is written in C.

Re:RISC-V OS using Rust: Filesystems by fluffything on Wednesday May 13, 2020 @11:15AM (#23167659)
Yeah, I was thinking more about what to do with the OS afterwards. That board has lots of things on it, including wifi, so I'll probably would like to use some of that.

It would be unfortunate to have to re-implement the wifi driver in Rust, but I suppose I'll just have to link parts of the C toolchain instead, creating Rust wrappers, etc.

Re:RISC-V OS using Rust: Filesystems by FullyFunctional on Thursday May 14, 2020 @11:44PM (#23188676)
Well, FPGA are more flexible but cost more than a cheap microcontroller that is true. There are way too many good options, but to pick one with a fantastic community: ULX3S
Re:RISC-V OS using Rust: Filesystems by colejohnson66 on Wednesday May 13, 2020 @04:26PM (#23171431)
Have you checked out SiFive’s HiFive1?[0] It’s an Arduino Uno sized board, but instead of a weak ATMega328p, it’s a (relatively) powerful RISC-V processor. It also has a BT and Wi-Fi chip.

[0]: https://www.sifive.com/boards/hifive1-rev-b

Re:RISC-V OS using Rust: Filesystems by MrBuddyCasino on Tuesday May 12, 2020 @06:14PM (#23160688)
No need to wait, the ESP32-S2 has a RISC-V as its low-power core.
Re:RISC-V OS using Rust: Filesystems by sitkack on Tuesday May 12, 2020 @09:53PM (#23162569)
ESP32-S2 has two ULP co-processors, with one based on RISCV instruction set architecture (ULP-RISCV) and the other on finite state machine (ULP-FSM).

ULP-RISCV has the following features:

    support for IMC instruction set
    thirty-two 32-bit general-purpose registers
    32-bit multiplier and divider
    support for interrupts
    boot by the CPU, its dedicated timer, or RTC GPIO
https://www.espressif.com/sites/default/files/documentation/...
Re:RISC-V OS using Rust: Filesystems by MrBuddyCasino on Wednesday May 13, 2020 @06:00AM (#23165255)
Interesting, wasn't aware. Is the ULP-FSM the same as the one in the original ESP32? I thought that one was programmable / Turing-complete, so not just a FSM?
Re:RISC-V OS using Rust: Filesystems by sitkack on Wednesday May 13, 2020 @04:30PM (#23171486)
I have never used the ULP-FSM, the new docs for ESP32-S2 are fascinating. My S2 is on its way, I don't yet have the hardware in hand.