18–20 Sept 2024
Europe/Vienna timezone

Generating BPF infrared decoders using finite automations

19 Sept 2024, 18:00
30m
"Hall N1" (Austria Center)

"Hall N1"

Austria Center

180
eBPF Track eBPF Track

Speaker

Sean Young

Description

An quick intro to infrared on Linux, and introduce new tool called cir

Intro needed for context of what we're trying to do with finite automations.

https://github.com/seanyoung/cir

Show how to use finite automations to generate efficient BPF code

Compiles IRP mini language to BPF (in a single binary/process, written in pure rust).

  • Parse IRP language, convert to NFA state machine
  • Convert NFA state machine to DFA state machine
  • Show that sometimes we end up with better code than the hand-written infrared decoders in the linux kernel
  • Generate LLVM IR from DFA
  • Generate BPF object file in-memory from LLVM IR
  • Load BPF object file into kernel (using Aya)

I think it is interesting because:

  • The DFA/NFA state machines are more complex than text book versions, as the edges can have code attached
  • The techniques might be a good example of generating efficient BPF code
  • Shows how BPF is replacing kernel space and user space infrared decoding

Primary author

Presentation materials

There are no materials yet.