Understanding OS-Backed Event Queues, System Calls, and Cross-Platform Abstractions 52 Raw syscall on Linux On Linux and mac OS, the syscall we want to invoke is called write. Both systems operate based on the concept of file descriptors, and stdout is already present when you start a process. If you don't run Linux on your machine, you have some options to run this example. Y ou can copy and paste the code into the Rust Playground or you can run it using WSL in Windows. As mentioned in the introduction, I'll list what example you need to go to at the start of each example and you can run the example there by writing cargo run. The source code itself is always located in the example folder at src/main. rs. The first thing we do is to pull in the standard library module that gives us access to the asm! macro. Repository reference: ch03/a-raw-syscall use std::arch::asm; The next step is to write our syscall function: #[inline(never)] fn syscall(message: String) { let msg_ptr = message. as_ptr(); let len = message. len(); unsafe { asm!( "mov rax, 1", "mov rdi, 1", "syscall", in("rsi") msg_ptr, in("rdx") len, out("rax") _, out("rdi") _, lateout("rsi") _, lateout("rdx") _ ); } } We'll go through this first one line by line. The next ones will be pretty similar, so we only need to cover this in great detail once.