If you've been wondering what I've been up to at @oxidecomputer, wonder no more: oxide.computer/blog/hubris-an…

Super glad that this is finally open source, so I can sing my co-workers' praises in public and not private 😀
In short, Hubris and Humility are a brand new OS and debugger for embedded systems. 100% Rust.
There's a lot of things that are really, really cool here, far too many for Twitter. I've done a lot of work on our build system, which is one of those cool things: it is layered on top of Cargo to build the entire image.
hubris was one of the things that really drew me to oxide. really lucky to have such great co-workers.
One fun thing folks always ask about OSes written in Rust: what's the deal with unsafe?

well, the kernel itself is just under 2300 lines of Rust code. `rg "unsafe"` spits out one screen of results for me; we have 7 invocations of 'unsafe' *except* for arch\arm_m.rs which has 22
there's also a few unsafe extern "C" fns, for things like SysTick handler, the syscall entrypoint, stuff like that.
individual tasks use unsafe to access hardware as well, of course. being a microkernel a lot of stuff that would be in the kernel in a monolithic kernel is in userspace here.
we do use nightly. but *only*:

* inline asm
* naked functions

inline assembly is on its way to being stabilized: github.com/rust-lang/rust… but we need one or two bits that won't be stable just yet, iirc
i wanted try blocks once but resisted the temptation; we're very close to being on stable, and if we let nightly flags proliferate, we'll never get there
another cool thing: system calls are defined in terms of Rust semantics. so we can have safe system calls! here's the definition of "reply": /// Implementation of the R...
(well this is actually part of the definition, note it's not a 'pub fn')
this is the bit you'd actually want to call, exposed in our "userlib" library for writing tasks. #[inline(always)] pub fn sy...
this leads me to another interesting thing: because system calls can take borrows, this means we can do stuff that's hard to do in non-rust systems, for example, "please loan some memory of mine to this task over here" which is very cool imho
okay so i should also say some cool stuff about humility

building a debugger also sounds wild at first... but it's brought a lot of cool advantages
so like, for example: the build process outputs an archive with all debugging info. no need to store any of that on the device itself; give humility an archive and point it at the device and it'll give you all that nice stuff, remotely
you want top on your embedded device? this is how you get top on your embedded device

(humility can query for the system state every $INTERVAL and print that out for you!)
lots of good stuff in here SUBCOMMANDS:     apptable  ...
another favorite of mine is "humility diagnose", which basically tries to figure out what is going wrong for you.

it can check if any task is faulting, it'll try to see if time is going backwards or not advancing for some reason, stuff like that

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with steveklabnik

steveklabnik Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @steveklabnik

30 Sep
*bong rip*

Wonder what Benjamin would think about NFTs. Some grad student better be working on “Art in the Age of Non-Fungability” right now
shitpost explainer time: marxists.org/reference/subj…

This essay is basically like "wow we have all of these production techniques to make copies of works of art. historically that was never practical. now it is easy. what does that mean for art"
it is a pretty short essay. i've always said programmers in general should read it.

but in some sense, nfts represent an attempt to be anti-this. it is trivial to be a "rightclicker" (lol). but they're trying to go back to this pre-industrial mode of art production
Read 4 tweets
23 Sep
This kind of experience is at the core of the “is a dynamic or statically typed language more productive” debate, imho
Some people have this experience and do exactly as I and @Wraithan do; “dang I wish I had the compiler to help me here, now I gotta do all this work”

Some people experience what Rust does and go “wow this compiler is constantly holding me back”
I suspect a lot of discussions around things like “productivity” are conflated with things like “have existing experience with tests/types” and “prefers runtime/compile time errors” and various other things
Read 6 tweets
13 Sep
i am gonna turn this one into its own thread:

you know how i've had like, seriously declining mental health lately?
it is incredibly difficult, personally, to put a lot of volunteer work, heart, and soul, into doing something for a project, and then to have others malign it
i can handle heat from random people. that's fine. people can disagree with things. that's also fine!

but some of the stuff being said and done has just... it's tremendously painful. i've cried a lot. some actual friendships destroyed at this point
Read 9 tweets
13 Sep
I refuse to let Amazon define Rust infoworld.com/article/363300…
At some point, we all have to have a serious conversation about Amazon's involvement in Rust. It's been far too long without me saying this.
Amazon now has:

* Lang team co-lead
* Compiler team co-lead
* decided to not have a Rust Foundation ED, meaning Chair has outsized power in the Foundation

they've also taken steps to marginalize the core team. and some other dirty shit I won't say rn.
Read 20 tweets
11 Aug
all i can say about 1password is that it gets my highest possible praise for a product, which is that i use it every day, it works perfectly, and i never need to think about it except when nerds get really upset about it online for whatever reason it is this time
the enlightened orange website user, on a tab about facebook: "if you're not paying, YOU'RE the product"

on a tab about 1password: $3/month is too much, use this free oss program with terrible ux instead
"ugh, an online vault that Just Works across every device you own no matter the OS? don't use that! just put this file in your dropbox and make sure to configure all the various apps to use that and if it gets out of date just manually re-sync it"
Read 5 tweets
25 May
PSA: I plan on blogging about this, but haven’t yet, but semver is now a dtolnay crate. There’s basically nobody else I’d have given this too. Very glad to see what he’s doing with it
I have been trying to get a 1.0.0 across the line for like two years. It’s kind of been an albatross for me. He actually did it, and it’s very good.
psa @zkat__ ^
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Thank you for your support!

Follow Us on Twitter!

:(