TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Writing an OS in Rust, Second Edition

160 pointsby aarestadabout 7 years ago

4 comments

steveklabnikabout 7 years ago
<a href="https:&#x2F;&#x2F;os.phil-opp.com&#x2F;news&#x2F;2018-03-09-pure-rust&#x2F;" rel="nofollow">https:&#x2F;&#x2F;os.phil-opp.com&#x2F;news&#x2F;2018-03-09-pure-rust&#x2F;</a> provides a lot more context here.<p>I am <i>extremely</i> excited by this work. One of the hardest parts of hacking on a hobby OS is the environment. My own project has been hampered for nearly a year because I switched to Windows and couldn’t get the tooling working. (A combination of my lack of Windows knowledge and a lack of desire to spend random Saturdays figuring out obscure toolchain issues.) And that’s with rustc already being a cross compiler.<p>This now means that, with Rust, getting going on any platform Rust supports is now trivial. It’s quite exciting.
评论 #16558197 未加载
评论 #16558791 未加载
bogomipzabout 7 years ago
What a great book!<p>I had a question about the section &quot;A Freestanding Rust Binary&quot; specifically the the &quot;start attribute&quot; section. The author states:<p>&quot;The ! return type means that the function is diverging, i.e. not allowed to ever return. This is required because the entry point is not called by any function, but invoked directly by the operating system or bootloader. So instead of returning, the entry point should e.g. invoke the exit system call of the operating system.&quot;<p>Is this explicitly &quot;diverging&quot; marking a Rust specific bit of housekeeping? For instance I wasn&#x27;t aware of any parallel in the C runtime but maybe someone could shed some light on this?
评论 #16558360 未加载
评论 #16559061 未加载
bb88about 7 years ago
I&#x27;ve seen a series of these types of articles, and I&#x27;m not sure if they&#x27;re trying to make the next linux or doing it for fun.<p>One problem to me is drivers, drivers, drivers. Linux has a bunch of &#x27;em. Other operating systems, not so much.
评论 #16557635 未加载
评论 #16558019 未加载
评论 #16557579 未加载
评论 #16559464 未加载
评论 #16558244 未加载
ape4about 7 years ago
That was interesting. I found the headstands necessary to write to a raw address a bit taxing. In C you&#x27;d just use the `volatile` keyword. But being able to localize unsafe code is a big win.
评论 #16559611 未加载