r/asm • u/JaguarMoe • 3d ago
x86-64/x64 A 14 KB HTTPS server OS in x86-64 assembly: boot sector, virtio-net, TCP, TLS 1.3 and HTTP
I wanted to see how good Claude is at sizecoding, so this code is Claude's, not mine. After 5 days there was a static web server that is its own operating system, in 13,859 bytes of NASM:
- boot sector, long mode, up to 4 processors
- virtio-net driver, ARP, TCP
- TLS 1.3 with X25519, ECDSA P-256 and AES-128-GCM (AES-NI, PCLMULQDQ, BMI2, ADX)
- HTTP GET and HEAD, with the site packed behind the code in the same image
On a 2-vCPU cloud server it does two to three times nginx's new TLS connections and small pages per second. It is clunky on purpose: to renew the certificate you build a new image.
Source: https://github.com/FileSherlock/k15 (start at `src/os.asm`)
It runs at https://15kb.org with a $200 bounty: the server's TLS key is also the private key of the Bitcoin address on the page, until 18 February 2027. No denial of service, please.
Tell me where the assembly is bad.
13
u/415646464e4155434f4c 3d ago
Great. Now debug it.
10
u/AWildTyphlosion 3d ago •
Here
1
u/vogelvogelvogelvogel 2d ago
very intersting project, thanks for sharing!
2
u/kneelian_ 2d ago
Thanks, Claude, very cool
0
u/kndb 2d ago
But why!???