{"by":"pandax381","descendants":12,"id":45022931,"kids":[45024013,45024257,45025677,45023790,45023216,45031490],"score":147,"text":"Hi HN,<p>To truly understand how operating systems and network protocols work, I decided to combine two classic learning tools: the xv6 teaching OS and a from-scratch TCP&#x2F;IP stack.<p>I&#x27;m excited to share the result: my own from-scratch TCP&#x2F;IP networking stack running directly inside the xv6-riscv (<a href=\"https:&#x2F;&#x2F;github.com&#x2F;pandax381&#x2F;xv6-riscv-net\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;pandax381&#x2F;xv6-riscv-net</a>) kernel.<p>The project uses a modern virtio-net driver, allowing it to run seamlessly in QEMU and communicate with the host machine.<p>Key features:<p>- From-Scratch Stack: The core is powered by microps (<a href=\"https:&#x2F;&#x2F;github.com&#x2F;pandax381&#x2F;microps\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;pandax381&#x2F;microps</a>), a TCP&#x2F;IP stack I originally wrote to run in user-space as a personal project to learn the low-level details of networking.<p>- Kernel Integration: This project ports microps from user-space into the xv6-riscv kernel.<p>- Socket API: Implements standard system calls (socket, bind, accept, etc.) to enable network application development.<p>- User-level Tools: Comes with a simple ifconfig command, plus tcpecho and udpecho servers to demonstrate its capabilities.<p>This has been a fantastic learning experience. My goal was to demystify the magic behind network-aware operating systems by building the components myself.<p>I&#x27;d love to hear your feedback and answer any questions!","time":1756189470,"title":"Show HN: I integrated my from-scratch TCP/IP stack into the xv6-riscv OS","type":"story","url":"https://github.com/pandax381/xv6-riscv-net"}