
RISC-V OS using Rust: Graphics - azhenley
https://blog.stephenmarz.com/2020/07/24/risc-v-os-using-rust-graphics/
======
varbhat
Linus Torvalds once told this about C++ :

[https://lore.kernel.org/lkml/Pine.LNX.4.58.0401192241080.231...](https://lore.kernel.org/lkml/Pine.LNX.4.58.0401192241080.2311@home.osdl.org/)

" any compiler or language that likes to hide things like memory allocations
behind your back just isn't a good choice for a kernel "

This was about C++ . So,given that Rust is similar to C++ , How does this
quote applies to Rust?

Edit: I am getting downvoted for this post. Downvoters,any reasons?

~~~
dthul
Didn't downvote you, but maybe because it's quite off topic?

~~~
yjftsjthsd-h
Discussing the suitability of Rust for OS development (based on the comments
of the developer of a major OS) seems completely on topic when discussing
writing an OS in Rust.

~~~
d1plo1d
I could be wrong but I interpreted the down votes as about incorrectly
equating of Rust and C++ allocations. There are a few replies that address
this better then I can (I'm limited here in that I grok Rust but not C++) but
I believe the comment would have been more correct to draw similarities
between C and Rust explicit allocation then C++ and Rust.

Hence why Linus is allowing Rust for certain Kernel aspects whereas he has
previously rejected C++:
[https://www.theregister.com/2020/07/13/rust_code_in_linux_ke...](https://www.theregister.com/2020/07/13/rust_code_in_linux_kernel/)

------
gnarbarian
I love the recent accelerated development of the risc v stack.

Anxiously waiting for the day I can purchase a riscV raspberry pi like SoC
with fully oss hardware and Ready for Linux.

~~~
pavehawk2007
I think until they get into the mass production market, risc-v will be fairly
expensive compared to the Rpi. Take a look at the full stack Hifive Unleashed
($1000) or the cheaper Hifive1 (revb):
[https://www.sifive.com/boards](https://www.sifive.com/boards)

~~~
andoriyu
Well, Hifive Unleashed is a dev board with tons of features for developer, a
market where $1000 is pretty okay price. It has DDR4 ECC RAM,

RPi is another story: it's a single board computer with exposed GPIO and used
to be shipped with ancient GPU.

Hifive1 is more of a competitor to Arduino if you can call it that. They even
have the same pinout for expansion.

They are quite pricy, like you said, due to early adopter fee. However, you
gotta understand that SiFive develop their cores and unlike Arduino RPi can't
just slap something that is already produced and ready to be mounted on a
board.

~~~
pavehawk2007
I've been trying to use the Sipeed Maixduino. It's much like the hifive1
except it uses the Kendryte K210, which is a fully supported RV64GC dual-core.
It even supports supervisor and user modes. It's also relatively cheap. The
problem is that documentation is lacking, so I'm having to reverse engineer
their BSP:
[https://maixduino.sipeed.com/en/](https://maixduino.sipeed.com/en/)

------
Koshkin
Using virtio to demonstrate how set a pixel looks unjustifiably complicated.
Queues, requests, responses!.. By contrast, using the framebuffer in Linux is
a breeze. (Doing this in DOS was easier still.)

~~~
pavehawk2007
I'm writing this from the OS's perspective. Linux abstracts this away, but we
have to do it to get the same abstraction. You can see under the user space
portion how simple it is to grab a framebuffer, which is then mapped into user
space. Then we have full access to RGBA values.

