C, Rust, and Linux Systems Programming

Learn C and Rust together while becoming a Linux systems programmer.


This book teaches C and Rust side by side — C first at each concept, then the Rust equivalent — while building you into a capable Linux user-space systems programmer. You'll go from writing your first hello world in both languages to building event-driven servers, manipulating bits in hardware registers, and talking directly to the kernel.

Who This Book Is For

You understand programming concepts — recursion, iteration, functions, data structures — but you haven't written C or Rust. You want to become a Linux systems programmer and you're preparing for protocol implementations and device driver work.

What You'll Learn

  • C and Rust fundamentals — types, control flow, functions, structs, enums
  • Pointers, memory, and ownership — from raw pointers to Rust's borrow checker
  • Bit-level programming — bitwise operations, masks, alignment, endianness, volatile access
  • Advanced patterns — data structures, generics, function pointers, state machines, error handling
  • The build pipeline — compilation stages, Make, CMake, Cargo, libraries, cross-compilation
  • Linux system programming — file descriptors, processes, signals, threads, IPC, networking
  • Performance — optimization, memory pools, zero-copy, atomics
  • The user-kernel boundary — /proc, /sys, ioctl, netlink, preparing for kernel space

How to Read This Book

Each chapter follows the same rhythm:

  1. Brief setup — what and why (not a lecture)
  2. C code — annotated, runnable, minimal
  3. Try it — modify something, see what happens
  4. Rust equivalent — what's the same, what's different
  5. Diagrams where they help
  6. Knowledge check — test your understanding
  7. Pitfalls — short, punchy list
  8. Move on

Every code snippet compiles and runs. Learn by doing.

Relationship to "How Programs Really Run"

That book explains the machine — CPU architecture, memory hierarchy, ELF format, virtual memory. It assumes C/Rust knowledge.

This book teaches C and Rust and focuses on programming the machine — system calls, IPC, signals, networking, bit-level manipulation.

They're complementary: read "How Programs Really Run" to understand what's underneath, read this book to learn to program with it.


Goljyu Innovations