Skip to content

Instantly share code, notes, and snippets.

View mark-i-m's full-sized avatar
💥
Segfault in progress

mark mark-i-m

💥
Segfault in progress
View GitHub Profile
@mark-i-m
mark-i-m / rust.md
Last active September 25, 2020 05:46
Rust 2021 post

Rust 2021

I first got into Rust because a professor suggested writing an OS kernel in it as an interesting exercise. As a systems programmer, I came to really appreciate Rust because of it's safety guarantees, having spent a lot of time with C and C++. I still primarily think of Rust as a "systems language", even though that not what I primarily use it for.

Over time, I found myself primarily using Rust for:

  • hobby OS kernels
  • hobby distributed systems
  • CLI tools for use at work (this one kind of surprised me, but Rust is really good at it).
@mark-i-m
mark-i-m / machine.rs
Created July 18, 2017 01:47
Excerpt from x86_64 OS kernel interrupt/trap handling
#[naked]
pub unsafe extern "C" fn irq0() {
asm!{
"push %rax
movq $$0, %rax "
: /* No outputs */
: /* No inputs */
: "rax", "rsp"
: "volatile"