{% raw %}
Michelle Ramur

Phil these tutorials are awesome, keep going!

Philipp Oppermann

Thanks a lot :)

Fabio Cesar Canesin

What is your view on Redox ? https://github.com/redox-os...

Philipp Oppermann

I think it's very impressive how complete it already is and how fast it progresses. Really excited for its future!

Philipp Oppermann

There's some great discussion on /r/rust and hackernews!

Ben Anderson

Awesome tutorials! Please please please keep writing them :)

Philipp Oppermann

Thanks so much! Sure I will :)

Ben Anderson

I'm left wondering where you got all this knowledge from? Is such low level systems programming a hobby or a job?

Philipp Oppermann

I'm a computer science student and I've taken some great OS courses. It's also a hobby of mine and I've experimented with a lot with toy x86 kernels and Rust. Most of the x86 information is from the OSDev wiki and the Intel/AMD manuals.

I also have a great research assistant job since November, where I try to bring Rust to an ARM Cortex-M7 board.

Joe ST

This is one of my favourite series, you're really doing such a great job of explaining bare-metal stuff to us all thank you!

Philipp Oppermann

Thanks, glad you're liking it!

Andrew Nurse

I actually encountered the println deadlock earlier while debugging something and solved it in a slightly different way. The problem generally occurs when a second println is encountered while evaluating one of the arguments to an outer println. So, I changed println to call a helper function called print_fmt which took in a core::fmt::Arguments. I used the format_args macro (https://doc.rust-lang.org/n... to evaluate the arguments and produce the core::fmt::Arguments, which I pass to print_fmt. Only within print_fmt do I actually take the lock on the WRITER, which means that all the expressions in the println! have been fully evaluated.

The advantage being you can nest println's as far as you want and you won't deadlock :)

See my implementation here: https://github.com/anurse/Oxygen/blob/dfda170b3f3d45eca20d4a1366e5d62384d7b2e4/src/vga.rs

Great posts by the way, loving the series!

Philipp Oppermann

Thanks! I really like your solution. I wanted to fix the nested-println-deadlocks too, but totally forgot to do it… However, the print_error solution also has advantages. For example, it always displays the error, even when we handle asynchronous hardware interrupts in the future.

So I think that I'd like to keep the print_error solution but also integrate your println changes (in order to fix deadlocks on nested printlns). I'm just not sure how to integrate it. Maybe I'll just add another section to the end of this post (just before `What's next`)…What do you think?

Philipp Oppermann

I just thought about this again and I think I will switch to your solution. It's much cleaner and avoids the output data race completely. Thanks again for proposing it!

Edit: Implemented in #249

{% endraw %}