Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
User-Space Device Drivers on Embedded Linux: A Comparative Case Study of C and Rust
Blekinge Institute of Technology, Faculty of Computing, Department of Software Engineering.
Blekinge Institute of Technology, Faculty of Computing, Department of Software Engineering.
2026 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesis
Abstract [en]

Background. Device drivers are a critical layer between hardware and software in embedded systems, where defects are a leading cause of crashes and security vulnerabilities. C has historically dominated this space despite well-documented memory-safety weaknesses, while Rust offers compile-time safety guarantees and structured error handling. Prior comparative work has focused on kernel-space drivers and isolated metrics, leaving user-space sensor drivers largely unstudied.

Objectives. To empirically compare functionally equivalent C and Rust user-space device drivers with respect to reliability, memory safety, fault behaviour, architectural complexity, and performance.

Methods. This study applies Design Science Research (DSR) through a controlled empirical experiment. The primary artefacts are two functionally equivalent user-space BME280 drivers implemented in C and Rust, developed together with supporting experimental infrastructure. Both artefacts were constructed and evaluated on a Raspberry Pi 3B using a custom Python measurement harness under identical conditions, with implementation language as the independent variable across dependent variables spanning stability, memory safety, fault behaviour, architectural complexity, and performance. Reliability was assessed through a 48-hour stress test against a reference sensor; memory safety through Valgrind Memcheck and an audit of Rust unsafe blocks; fault behaviour through physical disconnection, LD_PRELOAD-based I/O fault injection, and a 12-hour AFL++ fuzzing campaign; architectural complexity through cyclomatic complexity and lines of code; and performance through latency, CPU utilisation, and memory-footprint microbenchmarks with sequential probability ratio testing.

Results. Both drivers remained fully stable, exhibited no invalid memory accesses or leaks, and produced no crashes during fuzzing. The C driver was approximately 0.178% faster, a difference detectable at 99% confidence but well within a ±1 % equivalence zone. The Rust driver consumed approximately 29% more memory and contained five small unsafe blocks wrapping unavoidable system calls. It exhibited consistent rc=1 exit behaviour across all injected faults via unified Result/DriverError propagation, whereas the C driver exited with call-site-dependent codes. This robustness came at the cost of higher cyclomatic complexity a greater number of lines of code.

Conclusions. Rust’s safety guarantees come at no measurable runtime cost for this class of user-space driver, with trade-offs expressed in implementation complexity and a modest fixed memory overhead. The results support Rust as a credible alternative to C for user-space embedded drivers, bounded by the simplicity of the studied driver.

Place, publisher, year, edition, pages
2026. , p. 36
Keywords [en]
Memory safety, Reliability, User-space driver, Rust, Performance
National Category
Software Engineering
Identifiers
URN: urn:nbn:se:bth-29775OAI: oai:DiVA.org:bth-29775DiVA, id: diva2:2071063
Subject / course
PA1445 Bachelor's Thesis in Software Engineering
Educational program
PAGPT Software Engineering
Supervisors
Examiners
Available from: 2026-06-15 Created: 2026-06-12 Last updated: 2026-06-15Bibliographically approved

Open Access in DiVA

fulltext(1655 kB)20 downloads
File information
File name FULLTEXT01.pdfFile size 1655 kBChecksum SHA-512
6853fc5e1fbcbc6810847c9c941cd27798f20ff851a1804e9aea9fe3aa7cf451931c0907a01ff7b53c1c8d9ab7acdf7b53983e41dffb679aa6047e8bd7743946
Type fulltextMimetype application/pdf

By organisation
Department of Software Engineering
Software Engineering

Search outside of DiVA

GoogleGoogle Scholar
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 83 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf