Safe Kernel Programming with Rust

University essay from KTH/Programvaruteknik och datorsystem, SCS

Author: Johannes Lundberg; [2018]

Keywords: rust; kernel; safe; programming;

Abstract: Writing bug free computer code is a challenging task in a low-level language like C. While C compilers are getting better and better at detecting possible bugs, they still have a long way to go. For application programming we have higher level languages that abstract away details in memory handling and concurrent programming. However, a lot of an operating system's source code is still written in C and the kernel is exclusively written in C. How can we make writing kernel code safer? What are the performance penalties we have to pay for writing safe code? In this thesis, we will answer these questions using the Rust programming language. A Rust Kernel Programming Interface is designed and implemented, and a network device driver is then ported to Rust. The Rust code is analyzed to determine the safeness and the two implementations are benchmarked for performance and compared to each other. It is shown that a kernel device driver can be written entirely in safe Rust code, but the interface layer require some unsafe code. Measurements show unexpected minor improvements to performance with Rust.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)