Live data from Hacker News

Making a RISC-V Operating System Using Rust

web.eecs.utk.edu

11–20 of 47 posts

Re: Making a RISC-V Operating System Using Rust

#12
post #8

I really really like the first sentence > RISC-V ("risk five") and the Rust programming language both start with an R, so naturally they fit together

"Because I wanted to" should be reason enough. But for those who demand a better justification, this is very specific ;-)

Re: Making a RISC-V Operating System Using Rust

#13
post #7

Earlier quoted context omitted.

What would a "focus on graphics" mean? A GUI and windowing system, or just graphics processing?

I want it to be a video game console :) I think our students would have a lot of fun with that.

If you do, definitely ping flohofwoe, who a) maintains a Zig port of his lightweight Sokol graphics API and b) has a penchant for retro consoles.

https://github.com/floooh/sokol-zig

Re: Making a RISC-V Operating System Using Rust

#14
post #8

I really really like the first sentence > RISC-V ("risk five") and the Rust programming language both start with an R, so naturally they fit together

When RISC-V inevitably renames itself CISC-V, then what language would naturally fit together?

And don't say cobol.

Re: Making a RISC-V Operating System Using Rust

#15
post #13
post #7

Earlier quoted context omitted.

I want it to be a video game console :) I think our students would have a lot of fun with that.

If you do, definitely ping flohofwoe, who a) maintains a Zig port of his lightweight Sokol graphics API and b) has a penchant for retro consoles. https://github.com/floooh/sokol-zig

The zig wrapper is only a minimal experiment and work in progress now, also I've hit a little bug :)

https://github.com/ziglang/zig/issues/3211

BUT the sokol_app.h and sokol_gfx.h headers require an underlying platform 3D-API (e.g. GL, D3D11 or Metal) and window system to setup the swap chain. On a bare metal machine with only a 2D framebuffer they're not all that useful unfortunately.

Re: Making a RISC-V Operating System Using Rust

#16
post #14
post #8

I really really like the first sentence > RISC-V ("risk five") and the Rust programming language both start with an R, so naturally they fit together

When RISC-V inevitably renames itself CISC-V, then what language would naturally fit together? And don't say cobol.

C++?

Re: Making a RISC-V Operating System Using Rust

#18

Rust is build around the expectation that allocations happen automatically and can never fail. I’m curious to see how they deal with this in a kernel...

Rust, the language, strictly speaking, knows nothing about allocation at all.

The standard library assumes infallible allocation currently. Kernels generally do not use the standard library.

(Okay, STRICTLY speaking there’s a hack for Box in the language right now but it’s not about the allocation part and Box is technically defined in the standard library with Magic(tm) and so isn’t relevant in an OS dev context, as you won’t use the standard library and therefore Box. Rust-the-language never implicitly inserts heap allocations, including Box, anywhere.)

Re: Making a RISC-V Operating System Using Rust

#20

Rust is build around the expectation that allocations happen automatically and can never fail. I’m curious to see how they deal with this in a kernel...

The Rust standard library is. The Rust Core library (the far more minimal library that gets used when you mark a crate as #![no_std]) does not. That's how the other "OS in Rust" and "allocator in Rust" projects work.
Post reply on HN