News for hackers. Stuff that matters.
Re:Writing an OS in Rust: Advanced Paging by zaarn on Monday January 28, 2019 @11:12AM (#19018569)
Atm the barriers are all the unstable features you need to rely on as well as rust and LLVM bugs.

The LLVM bug I've encountered makes it impossible to properly handle interrupts with error codes unless you use [naked], which is unreliable in my experience.

The Rust bugs are on one hand a None variable being initialized to a Some() value and a bug where rust injects a few instructions between inline assembly that corrupt the stack.

These problems can usually be worked around in some ways, it's annoying and means the rust compiler is not quite there yet.

However, with rust it's easier to reason about why an error occured than in C, atleast in my experience, although some things can only be found out by trial and error (corrupted stack or hitting undefined instructions), as a result I would predict that Rust could result in a lot more fun designs and architectures than simply writing a Microkernel (Redox).

Re:Writing an OS in Rust: Advanced Paging by steveklabnik on Monday January 28, 2019 @11:15AM (#19018603)
> a None variable being initialized to a Some() value

Did you file a bug about this? this seems extremely bad.

Re:Writing an OS in Rust: Advanced Paging by zaarn on Monday January 28, 2019 @03:04PM (#19020572)
No, I'm waiting on a fix for the other bugs first since I've monkey patched this one so far by using some unsafe.
Re:Writing an OS in Rust: Advanced Paging by pcwalton on Monday January 28, 2019 @08:30PM (#19022898)
> The Rust bugs are on one hand a None variable being initialized to a Some() value

Wait. There has to be more going on there than just that—perhaps it's some interaction with naked functions?—or else we'd be seeing crashes everywhere from this.

Re:Writing an OS in Rust: Advanced Paging by zaarn on Tuesday January 29, 2019 @04:23AM (#19024973)
Well, there is only a single place were this happens reproducable. All other None values are fine in the same binary. The variable is not touched by any code I haven't verified over this.

I don't have any naked functions in the relevant binary either.