Index
Source Code Study¶
Version History
Date | Description |
---|---|
Oct 16, 2021 | Move compilers section to a separate file |
Dec 7, 2020 | add sanitizers section |
Sep 13, 2020 | some notes for python; add tcpstat |
Jul 26, 2020 | Add OpenJDK! Hinted by Hacker News :) |
Jun 2, 2020 | Add librcu |
Apr 26, 2020 | Add wayland, X, gnome, gtk etc |
Apr 10, 2020 | add graphics section |
Apr 6, 2020 | add verbs perftes |
Mar 3, 2020 | add FreeBSD, some fpga stuff |
Feb 4, 2020 | add io_uring, firecracker |
Jan 31, 2020 | Add some good stuff |
Jan 18, 2020 | Initial |
Beautiful code is art. This page documents all the interesting & practical software/hardware/firmware I came across during my work.
- Nutrition
- Operating Systems
- Network
- Virtualization
- Compilers
- Bootloader and Firmware
- Web Servers
- KVS
- Databases
- RDMA and More
- Graphics
- FPGA
- Sanitizers
Nutrition¶
Projects supporting our day-to-day work.
- GNU glibc: libc, elf, and dynamic linker
- It is the default C library used by almost everyone
- It includes
ld.so
, the dynamic linker - I wrote some notes about GOT/PLT and explains what has happend before main() is called.
- GNU binutils: gas, static linker, and more
- This repo has a lot commands like
as
,ld
,objdump
,nm
and so on ld
is static linker and I like the magic of its linker script- I guess another useful repo is
elfutils
- This repo has a lot commands like
- C Library
- [C++ Library]
- strace
- System call tracer at userspace
- I’ve designed one for LegoOS in kernel space
- Unix Commands
- Of course almost all other listed repos in this section have some sort of commands. But they are not essential. The following repos have the essential UNIX commands like ls, cat. It’s not possible to go through all of them. But rather, I think they serve as references when we want to know how certain things are implemented (e.g., how dmesg get kernel log).
- BusyBox
- GNU Coreutils
- util-linux
- FreeBSD and its friends
- Tools
- Editors
- C for life
- Some small and useful C projects
- cJSON: A lightweight JSON parser in C.
- userspace-rcu: A userspace RCU implementation library.
- Outliers
- CRIU: Checkpoint and Restore in Userspace
- The reason I love this repo is because it has so many interesting pieces on how to interact with kernel, save states, and restore them. In addition, it shows how to properly use many less well known syscalls.
- GRUB2: bootloader
- Learn how modern bootloader works.
- Detailed analysis of Linux booting sequence (how it transit from real-mode to protected mode, and finally to 64-bit mode, how to navigate Linux source code etc.)
- FFmpeg
- FFmpeg project is famous for its clean and neat C code.
- Besides, this project is used by a lot online video service companies
- io uring
- CRIU: Checkpoint and Restore in Userspace
Operating Systems¶
See here.
Network¶
- iperf3 is a TCP, UDP, and SCTP network bandwidth measurement tool
- tcpdump
- iputils (arping, ping, etc)
- scapy: Python-based interactive packet manipulation program & library. Very neat
- tcpstat: C-based simple tool that could dump network traffic. Seems using pcap interface, the one used by tcpdump?
- Also checkout FreeBSD as it has tools like
ifconfig
,if
. - OpenSSH is our ssh!
- OpenSSL
Virtualization¶
Also see: http://lastweek.io/notes/source_code/virt/.
Compilers¶
See here.
Bootloader and Firmware¶
See here.
The open-source firmware landscape:
FPGA¶
- My own Collection
- My own Paper Readings
- Partial Reconfiguration
- Network
- Corundum: an FPGA-based NIC
- This is THE BEST network stack out there.
- This is not simply a network stack, it is a NIC.
- So what makes a NIC? First, PHY and MAC are basic. Second, PCIe connection between host and board. Third, DMA using PCIe, for TX and RX packets between host and board. Fourth, a host NIC driver; Fifth, some opt modules at NIC.
- This project has it all. Most amazingly, it works on so many boards.
- They have an FCCM‘20 paper (finally!) describing the small modules inside.
- Verilog-Ethernet
- Self-made PHY, MAC IPs, ARP, IP, UDP stack
- This is also used by the Corundum project.
- Limago, HLS-based 100 GbE TCP/IP
- FPGA Network Stack
- This one came from ETH as well.
- This one is used by many papers, as far as i know, StRoM, EuroSys‘20.
- It’s mostly HLS-based. And has ETH/IP/UDP/TCP, RoCE v2 stack.
- Corundum: an FPGA-based NIC
- Simulation, Synthesis, and P&R
- Icarus iverilog. iverilog is a compiler that translates Verilog source code into executable programs for simulation, or other netlist formats for further processing man page.
- VMware Cascade. Just-in-time compilation for Verilog, what a brilliant idea.
- Verilog-to-routing.
- Synthesis (
ODIN II
) - Logic Optimization & Technology Mapping (
ABC
) - Placement and Route (
VPR
)
- Synthesis (
Web Servers¶
Key Value Stores¶
Point of interests: 1) in-memory, and can it extend to use disk/ssd? 2) persistence support 3) network support
- RocksDB: A persistent KVS for Flash and RAM Storage. C++
- LevelDB. C++
- Memcached. C
- Redis. C
- etcd: Distributed reliable KVS. Go
Databases¶
RDMA and More¶
See here
Graphics¶
More here
- X Server and Wayland
- X is being replaced by Wayland now..
- Wayland code seems clean
- xvnc
- xvnc and its friends, are sitting on top of display manager (i.e., X/Wayland). They are clients of X/Wayland, but they act as X/Wayland servers for upper layer application such as GTK/Qt.
- It’s a middleman, bringing network between X and GTK.
- TigerVNC, TurboVNC and so on.
- GNOME Shell and GTK
- GTK’s default backend is X.
- GNOME shell is a layer on top of GTK+. Similar for KDE/Qt.
- xRDP, an RDP server. In C
- FreeRDP, client and server. In C
- Took a brief read of the code, it’s super neat. Should take a serious look sometime.
- Vulkan/OpenCL
- Proton
The landscape:
Sanitizers¶
There are many tools in both user and kernel space helping programmers identify various issues early on. Those issues including memory safty issue, threading issue, and others.
Personally I have not used these tools a lot. But I am very interested in them. I think they could greatly improve productivity.