3 ms·
Should be straight-forward. I know, famous last words for people starting on projects. Yet, a web server is straight-forward piece of software if you're not try
by nickpsecurity 10y ago
Should be straight-forward. I know, famous last words for people starting on projects. Yet, a web server is straight-forward piece of software if you're not trying to make a production system with widespread adoption. For a static web server, heres what it does:
1. Parse a HTTP request into simple, internal form.
2. Convert the identifier into location in memory with the page.
3. Convert data at that location into outgoing packets.
4. Run those through I/O.
One clever, embedded system I saw pre-encoded the HTML pages as TCP packets in memory to just send them directly. The HW will obviously need TCP/IP stack. There's plenty examples in academic literature. Whole thing is a pipeline with part manipulating memory, in/out HTTP processing, in/out TCP processing, in/out IP processing, in/out Ethernet, a memory subsystem for accessing RAM, and some cache thrown in there likely.
That's as far as I got when I thought about it. Looks quite doable given everything up to TCP in that stack has been done already. The rest seems straight-forward. Could probably even implement it in a static way amendable to fixed, pre-allocations of memory or on-chip resources.