Understanding OS-Backed Event Queues, System Calls, and Cross-Platform Abstractions 54 If you run this on Linux, you should now see the following message in your console: Hello world from raw syscall! Raw syscall on mac OS Now, since we use instructions that are specific to the CPU architecture, we'll need different functions depending on if you run an older Mac with an intel CPU or if you run a newer Mac with an Arm 64-based CPU. We only present the one working for the new M series of chips using an ARM 64 architecture, but don't worry, if you've cloned the Github repository, you'll find code that works on both versions of Mac there. Since there are only minor changes, I'll present the whole example here and just go through the differences. Remember, you need to run this code on a machine with mac OS and an M-series chip. Y ou can't try this in the Rust playground. ch03/a-raw-syscall use std::arch::asm; fn main() { let message = "Hello world from raw syscall!\n" let message = String::from(message); syscall(message); } #[inline(never)] fn syscall(message: String) { let ptr = message. as_ptr(); let len = message. len(); unsafe { asm!( "mov x16, 4", "mov x0, 1", "svc 0", in("x1") ptr, in("x2") len, out("x16") _, out("x0") _, lateout("x1") _, lateout("x2") _ ); } }