diff options
| author | user <user@clank> | 2026-07-17 12:54:43 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-07-17 12:54:43 +0200 |
| commit | 26a2ccb8368a9968b6ec16068ad68dd0edb40641 (patch) | |
| tree | 1396180dc2a8e635c58e10b994ae15fe7705e542 /Makefile | |
| parent | net: proper socket API in the kernel (SYS_NET) - no more SLIP in userland (diff) | |
| download | gbos-26a2ccb8368a9968b6ec16068ad68dd0edb40641.tar.gz gbos-26a2ccb8368a9968b6ec16068ad68dd0edb40641.tar.xz gbos-26a2ccb8368a9968b6ec16068ad68dd0edb40641.zip | |
net: UDP sockets in the kernel + a DNS resolver (real hostname lookups)
Adds UDP to the kernel socket layer on top of the ICMP core:
- net_sum() (raw folded sum) split out of net_cksum() so a UDP pseudo-header
(src/dst IP + proto + length) can seed the segment checksum.
- udp_send: builds IP+UDP with the pseudo-header checksum; NET_BIND sets the
local/source port; net_connect sets the peer.
- udp_in: demuxes inbound UDP by destination port to the bound socket
(net_find_udp), delivers the payload + source addr.
Also fixes a real recv bug: net_pump clobbers BC/DE/HL, so the old recv timeout
counted in registers and was effectively random. recv now counts in WRAM.
New `nslookup HOST` (PROG_NSLOOKUP=28, bank 30): builds a DNS A query and parses
the answer (with 0xC0 name-compression) entirely in userland over a UDP socket -
the kernel never sees DNS, just UDP. Verified through the bridge NAT:
/# nslookup example.com -> example.com -> 172.66.147.243
This gives us name resolution for the TCP/HTTP demo next.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -20,7 +20,7 @@ $(BUILD)/%.o: src/%.asm | $(BUILD) # C programs: compiled with SDCC into ROM-bank blobs and INCBIN'd by programs.asm CBLOBS := c/chello.bin c/echo.bin c/true.bin c/false.bin c/uname.bin \ c/pid.bin c/cat.bin c/wc.bin c/head.bin c/args.bin \ - c/ls.bin c/save.bin c/rm.bin c/sh.bin c/ps.bin c/kill.bin c/spin.bin c/blk.bin c/mkdir.bin c/count.bin c/ptest.bin c/necho.bin c/wget.bin c/chat.bin c/netd.bin c/ping.bin + c/ls.bin c/save.bin c/rm.bin c/sh.bin c/ps.bin c/kill.bin c/spin.bin c/blk.bin c/mkdir.bin c/count.bin c/ptest.bin c/necho.bin c/wget.bin c/chat.bin c/netd.bin c/ping.bin c/nslookup.bin $(BUILD)/programs.o: $(CBLOBS) # C programs also depend on the shared libc sources |
