40C3 · HARDWARE
About eight months to find a way to make a voice call with osmocom-bb layer1 and a homemade C54x DSP emulation on a virtual 2G network.
I just wanted to make a cfile with fake_trx… and ended up emulating a DSP.
Speaker note — Say the subtitle as written. The talk is about the lab and the DSP: how the call got made, and how it was verified. How the code was written gets one slide, later, and no more.
From a cfile to the DSP
THE PLAN
cfile → Wall 1 → Wall 2 →
Wall 3 → C54x → Call
WALL #1
fake_trx speaks bursts. Nohl’s demo needs IQ samples. The layer I needed was exactly the one being skipped.
phone ⇄ fake_trx (TRXD bursts over UDP) ⇄ BTS
No modulation, no signal, nothing to record.
WALL #2
THE FIX
…and it needed the help of other machines.
TWO MACHINES
Calypso in QEMU, running OsmocomBB layer 1
A 1990s C54x, emulated from scratch
The ARM is the real OsmocomBB firmware. The DSP runs the real TI ROM. Wrong emulation → no sync, no call.
How it works
VIRT_CALYPSO
osmocon → Layer 1 → DSP →
BTS
WALL #3
Shunt the DSP with gr-gsm
Emulate the real C54x
THE SHORTCUT
It worked. So… why not the real DSP? Half the work was already done.
THE MODES · ARM LAYER 1 IN QEMU, ALWAYS
OBTAINED
SOUGHT
Same layer 1. Different brain underneath. Now the brains check each other.
THE HARD WAY
C54x (real TI ROM) ⇄ ARM layer 1 (API RAM)
⇄ Bridge ⇄ osmo-bts-trx
No more faking on the downlink. Uplink coding: the ROM is checked in shadow mode before it drives the BTS.
How it was verified, and the proof
WHERE IT SITS
| Layer | On the radio link | Who |
|---|---|---|
| 7 Application | Call, SMS, USSD | mobile + Osmocom core |
| 4 to 6 | none on the radio link | core only: SIGTRAN, IP |
| 3 Network | RR, MM, CC | mobile ↔︎ BSC, MSC |
| 2 Data link | LAPDm | mobile ↔︎ osmo-bts-trx |
| 1 Physical | TDMA, GMSK, A5, Viterbi | ARM layer 1 + C54x, real TI ROM (downlink) |
| 1 bis | GSM IQ over Ethernet | next step |
Everything above layer 1 already existed. The phone-side layer 1 is the new part.
THE METHOD
Green oracles can prove me wrong without my help. Grey ones share my assumptions: they catch implementation bugs, not misunderstandings. Internal coherence is not correctness.
Full disclosure: most of the emulator code was written with an AI assistant. The oracles above are what makes that acceptable: none of them were.
Speaker note — Say the disclosure line once, plainly, and move on. The ROM, Osmocom, the shadow mode and the bench did not come from the assistant, and they are what decides whether the DSP is right.
23/23
automated end-to-end bench, DSP mode, 0 failures
Real-time margin: 4.3–4.6 ms of DSP work per 4.62 ms frame —
github.com/bbaranoff/tests
WHAT DOESN’T WORK (YET)
| 32 | 1 | 2 | 2 |
|---|---|---|---|
| handled | degraded | not handled | not observed |
Full run report: rpubs.com/bbaranoff
DEMO
phone (QEMU + C54x) ⇄ bridge ⇄ osmo-bts-trx ⇄ Osmocom core
Nothing on the air.
The only one I know of, and I looked. If you know another, I want to see it.
Speaker note — The biggest claim of the talk: say it exactly as written, as a question to the room. Play the clean recording first; live is the bonus.
LIVE · UNDER THE HOOD
DSP · Harvard shell (NDB, API RAM)
P:9002 D> d@ d_task_d 20
[0800]=000d d_task_d task 13 = TCHT
[0802]=000d d_task_u task 13 = TCHT
[0808]=3d23 d_fn fn_report=35 fn_sid=61
[0809]=0011 d_ctrl_tch TCH_FS, TCH_F
[080c]=0409 a_a5fn[0] T2=9 T3=32 (A5)
[080f]=fd44 d_afc -700
ARM · gdb on layer 1 in QEMU
$ telnet 0 44444
Reading symbols from layer1.highram.elf...
Remote debugging using 127.0.0.1:1234
l1a_l23_handler () at layer1/l23_api.c:650
650 msg = msgb_dequeue(&l23_rx_queue);
(gdb) _
Mobile · OsmocomBB VTY
OsmocomBB(mobile)# call 1 600
% Call is proceeding
% Call is answered
Same instant, three views: the DSP’s task registers mid-TCH, the ARM firmware under gdb, the phone in a call. Nothing here is a mock-up.
Research, teaching, networks
WHAT IT’S FOR · RESEARCH
WHAT IT’S FOR · TEACHING AND TESTING
WHAT IT’S FOR · NETWORKS AND PRESERVATION
Next steps and how to try it
WHAT’S NEXT
MS (ARM + C54x) → IQ →
Ethernet · Coax · Fiber
The phone doesn’t exist. Its signal does.
TRY IT
Thanks: Osmocom, fixeria, FreeCalypso, TI, Claude, and everyone who reverse-engineered the Calypso before me.