Frequently Asked Question

What language is the Linux kernel written in? Can I write a driver in Rust?

Almost all of the kernel is C, specifically a constrained dialect closer to C89 with GCC extensions, no floating point in most contexts, no standard library (only the kernel's own helpers). A small fraction is hand-written assembly for CPU-architecture entry points, context switching, and atomics.

Since version 6.1 (December 2022) the kernel also accepts Rust code, with a growing set of safe abstractions over the kernel's C APIs. A handful of drivers have landed in Rust; large rewrites of existing C subsystems are not on the agenda. The two languages will coexist for a long time.

Video

Further reading and video