kth.sePublications
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
Safe Kernel Programming with Rust
KTH, School of Electrical Engineering and Computer Science (EECS), Computer Science, Software and Computer systems, SCS.
2018 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE creditsStudent thesisAlternative title
Säker programmering i kärnan med Rust (Swedish)
Abstract [en]

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.

Abstract [sv]

Att skriva buggfri kod i ett lågnivåspråk som C är väldigt svårt. C-kompilatorer blir bättre och bättre på att upptäcka buggar men är ännu långt ifrån att kunna garantera buggfri kod. För applikationsprogrammering finns det tillgängligt olika högnivåspråk som abstrakterar bort den manuella minneshanteringen och hjälper med trådsäker programmering. Dock fortfarande så är större delar av operativsystemet och dess kärna är endast skriven i C. Hur kan vi göra programmering i kärnan säkrare? Vad är prestandakonsekvenserna av att använda ett säkrare språk? I denna uppsats ska vi försöka svara på dessa frågor genom att använda språket Rust. Ett programmeringsgränssnitt i Rust är implementerat i kärnan och en nätverksdrivrutin är portad till Rust. Källkoden skriven i Rust är analyserad för att bedömma säkerheten samt prestandan är jämförd mellan C och Rust implementationerna. Det är bevisat att vi kan skriva en drivrutin i enbart säker Rust om vi kan lita på några osäkra funktioner i gränssnittet. Mätningar visar lite bättre prestanda i Rust.

Place, publisher, year, edition, pages
2018. , p. 56
Series
TRITA-EECS-EX ; 2018:503
Keywords [en]
rust, kernel, safe, programming
National Category
Computer Sciences
Identifiers
URN: urn:nbn:se:kth:diva-233255OAI: oai:DiVA.org:kth-233255DiVA, id: diva2:1238890
Subject / course
Computer Technology, Program- and System Development
Educational program
Master of Science in Engineering -Engineering Physics
Presentation
2018-06-29, 21:37 (English)
Supervisors
Examiners
Available from: 2018-08-31 Created: 2018-08-14 Last updated: 2022-06-26Bibliographically approved

Open Access in DiVA

fulltext(747 kB)6501 downloads
File information
File name FULLTEXT01.pdfFile size 747 kBChecksum SHA-512
c0b9a615934afeb871b758fe3ebecde365c829307b7a8d6fed22769d80412bb38742146001f0e2b518a7287318c31da9914500ef107e912acd395a5b8a8c9926
Type fulltextMimetype application/pdf

By organisation
Software and Computer systems, SCS
Computer Sciences

Search outside of DiVA

GoogleGoogle Scholar
Total: 6516 downloads
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: 1714 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