Skip to content

Commit 9de4e7f

Browse files
Merge pull request #71 from adybag14-cyber/fs55-ethernet-integration
feat(fs5.5): add e1000 tcp transport proof
2 parents f8f7e00 + ba963ba commit 9de4e7f

File tree

11 files changed

+780
-25
lines changed

11 files changed

+780
-25
lines changed

.github/workflows/release-preview.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ jobs:
211211
shell: pwsh
212212
run: ./scripts/baremetal-qemu-e1000-udp-probe-check.ps1
213213

214+
- name: Bare-metal QEMU E1000 TCP probe (optional)
215+
shell: pwsh
216+
run: ./scripts/baremetal-qemu-e1000-tcp-probe-check.ps1
217+
214218
- name: Bare-metal QEMU RTL8139 ARP probe (optional)
215219
shell: pwsh
216220
run: ./scripts/baremetal-qemu-rtl8139-arp-probe-check.ps1

.github/workflows/zig-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ jobs:
185185
shell: pwsh
186186
run: ./scripts/baremetal-qemu-e1000-udp-probe-check.ps1
187187

188+
- name: Bare-metal QEMU E1000 TCP probe (optional)
189+
shell: pwsh
190+
run: ./scripts/baremetal-qemu-e1000-tcp-probe-check.ps1
191+
188192
- name: Bare-metal QEMU RTL8139 ARP probe (optional)
189193
shell: pwsh
190194
run: ./scripts/baremetal-qemu-rtl8139-arp-probe-check.ps1

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ ZAR-Zig-Agent-Runtime is the Zig runtime port of OpenClaw, with parity-first del
6666
- host regressions in `src/baremetal/e1000.zig`, `src/baremetal/pci.zig`, and `src/baremetal_main.zig` now prove init, MAC readout, TX, RX, and export-surface stability on the clean-room `E1000` path
6767
- `scripts/baremetal-qemu-e1000-probe-check.ps1` plus `scripts/qemu-e1000-dgram-echo.ps1` now prove live QEMU `E1000` PCI bind, MAC readout, TX, RX, payload validation, and counter advance over the freestanding PVH artifact
6868
- `src/pal/net.zig` now routes the same raw-frame PAL seam through selectable `RTL8139` and `E1000` backends without regressing the existing RTL8139 path
69-
- host regressions in `src/baremetal/e1000.zig`, `src/baremetal/pci.zig`, and `src/baremetal_main.zig` now also prove `ARP`, `IPv4`, and `UDP` reuse on the clean-room `E1000` path
70-
- `scripts/baremetal-qemu-e1000-arp-probe-check.ps1`, `scripts/baremetal-qemu-e1000-ipv4-probe-check.ps1`, and `scripts/baremetal-qemu-e1000-udp-probe-check.ps1` now prove live QEMU `E1000` ARP request transmission, IPv4 frame encode/decode, UDP datagram encode/decode, and TX/RX counter advance over the freestanding PVH artifact
71-
- `TCP` / `HTTP` / `HTTPS` reuse over `E1000` remains future depth
69+
- host regressions in `src/baremetal/e1000.zig`, `src/baremetal/pci.zig`, `src/pal/net.zig`, and `src/baremetal_main.zig` now also prove `ARP`, `IPv4`, `UDP`, and bounded `TCP` reuse on the clean-room `E1000` path
70+
- `scripts/baremetal-qemu-e1000-arp-probe-check.ps1`, `scripts/baremetal-qemu-e1000-ipv4-probe-check.ps1`, `scripts/baremetal-qemu-e1000-udp-probe-check.ps1`, and `scripts/baremetal-qemu-e1000-tcp-probe-check.ps1` now prove live QEMU `E1000` ARP request transmission, IPv4 frame encode/decode, UDP datagram encode/decode, bounded TCP handshake/payload/teardown, and TX/RX counter advance over the freestanding PVH artifact
71+
- `HTTP` / `HTTPS` reuse over `E1000` remains future depth
7272
- keyboard/mouse is now strict-closed in [`docs/zig-port/FS5_5_HARDWARE_DRIVERS_SYSTEMS.md`](docs/zig-port/FS5_5_HARDWARE_DRIVERS_SYSTEMS.md)
7373
- `src/baremetal/ps2_input.zig` now contains a real x86 port-I/O backed PS/2 controller path
7474
- `scripts/baremetal-qemu-ps2-input-probe-check.ps1` proves IRQ-driven keyboard/mouse state updates against the freestanding PVH artifact

build.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub fn build(b: *std.Build) void {
1414
const baremetal_e1000_arp_probe = b.option(bool, "baremetal-e1000-arp-probe", "Enable the E1000 ARP validation path in the freestanding image") orelse false;
1515
const baremetal_e1000_ipv4_probe = b.option(bool, "baremetal-e1000-ipv4-probe", "Enable the E1000 IPv4 validation path in the freestanding image") orelse false;
1616
const baremetal_e1000_udp_probe = b.option(bool, "baremetal-e1000-udp-probe", "Enable the E1000 UDP validation path in the freestanding image") orelse false;
17+
const baremetal_e1000_tcp_probe = b.option(bool, "baremetal-e1000-tcp-probe", "Enable the E1000 TCP validation path in the freestanding image") orelse false;
1718
const baremetal_rtl8139_probe = b.option(bool, "baremetal-rtl8139-probe", "Enable the RTL8139 Ethernet validation path in the freestanding image") orelse false;
1819
const baremetal_rtl8139_arp_probe = b.option(bool, "baremetal-rtl8139-arp-probe", "Enable the RTL8139 ARP validation path in the freestanding image") orelse false;
1920
const baremetal_rtl8139_ipv4_probe = b.option(bool, "baremetal-rtl8139-ipv4-probe", "Enable the RTL8139 IPv4 validation path in the freestanding image") orelse false;
@@ -110,6 +111,7 @@ pub fn build(b: *std.Build) void {
110111
baremetal_options.addOption(bool, "e1000_arp_probe", baremetal_e1000_arp_probe);
111112
baremetal_options.addOption(bool, "e1000_ipv4_probe", baremetal_e1000_ipv4_probe);
112113
baremetal_options.addOption(bool, "e1000_udp_probe", baremetal_e1000_udp_probe);
114+
baremetal_options.addOption(bool, "e1000_tcp_probe", baremetal_e1000_tcp_probe);
113115
baremetal_options.addOption(bool, "rtl8139_probe", baremetal_rtl8139_probe);
114116
baremetal_options.addOption(bool, "rtl8139_arp_probe", baremetal_rtl8139_arp_probe);
115117
baremetal_options.addOption(bool, "rtl8139_ipv4_probe", baremetal_rtl8139_ipv4_probe);

docs/zig-port/FS5_5_HARDWARE_DRIVERS_SYSTEMS.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ Tracked docs:
4040
Delivered first adoption slice:
4141

4242
- clean-room `E1000` NIC support
43-
- first strict delivery now includes raw-frame/L2 plus `ARP`, `IPv4`, and `UDP`
43+
- first strict delivery now includes raw-frame/L2 plus `ARP`, `IPv4`, `UDP`, and bounded `TCP`
4444
- `src/baremetal/e1000.zig` now provides a ZAR-owned `82540EM`-class driver with PCI bind, MMIO + legacy I/O reset, EEPROM MAC readout, bounded TX/RX rings, and raw-frame send/receive telemetry
4545
- `src/baremetal/pci.zig` now discovers the `E1000` MMIO + I/O BAR pair and enables I/O, memory, and bus-master decode on the selected function
46-
- host regressions now prove init, MAC readout, TX, RX, export-surface stability, and `ARP` / `IPv4` / `UDP` protocol reuse on the clean-room `E1000` path
46+
- host regressions now prove init, MAC readout, TX, RX, export-surface stability, and `ARP` / `IPv4` / `UDP` / bounded `TCP` protocol reuse on the clean-room `E1000` path
4747
- `scripts/baremetal-qemu-e1000-probe-check.ps1` plus `scripts/qemu-e1000-dgram-echo.ps1` now prove live QEMU `E1000` PCI bind, MAC readout, TX, RX, payload validation, and counter advance over the freestanding PVH artifact
4848
- `src/pal/net.zig` now routes the same raw-frame PAL seam through selectable `RTL8139` and `E1000` backends without regressing the existing RTL8139 path
49-
- `scripts/baremetal-qemu-e1000-arp-probe-check.ps1`, `scripts/baremetal-qemu-e1000-ipv4-probe-check.ps1`, and `scripts/baremetal-qemu-e1000-udp-probe-check.ps1` now prove live QEMU `E1000` ARP request transmission, IPv4 frame encode/decode, UDP datagram encode/decode, and TX/RX counter advance over the freestanding PVH artifact
50-
- `TCP` / `HTTP` / `HTTPS` reuse over `E1000` remains the next depth step
49+
- `scripts/baremetal-qemu-e1000-arp-probe-check.ps1`, `scripts/baremetal-qemu-e1000-ipv4-probe-check.ps1`, `scripts/baremetal-qemu-e1000-udp-probe-check.ps1`, and `scripts/baremetal-qemu-e1000-tcp-probe-check.ps1` now prove live QEMU `E1000` ARP request transmission, IPv4 frame encode/decode, UDP datagram encode/decode, bounded TCP handshake/payload/teardown, and TX/RX counter advance over the freestanding PVH artifact
50+
- `HTTP` / `HTTPS` reuse over `E1000` remains the next depth step
5151
- do not widen scope to VFS/ELF/syscalls/userspace in this slice
5252

5353
`FS5.5` is not complete until each subsystem has:
@@ -372,12 +372,12 @@ Current local source-of-truth evidence:
372372
- `oc_ethernet_rx_len`
373373
- `src/pal/net.zig` now exposes the bare-metal raw-frame PAL seam through the same RTL8139 driver path instead of a fake transport
374374
- host regressions now prove mock-device initialization, raw-frame send, receive, ABI export, and PAL bridging
375-
- a second clean-room NIC family now exists for future depth:
375+
- a second clean-room NIC family now exists for broader FS5.5 depth:
376376
- `src/baremetal/e1000.zig` now provides a ZAR-owned `82540EM`-class `E1000` path with PCI bind, MMIO + legacy I/O reset, EEPROM MAC readout, bounded TX/RX rings, and raw-frame send/receive telemetry
377377
- `src/baremetal/pci.zig` now also discovers the `E1000` MMIO + I/O BAR pair and enables I/O, memory, and bus-master decode on the selected PCI function
378-
- dedicated host regressions prove init, MAC readout, TX, RX, and export-surface stability on the clean-room `E1000` path
379-
- `scripts/baremetal-qemu-e1000-probe-check.ps1` plus `scripts/qemu-e1000-dgram-echo.ps1` now prove live QEMU `E1000` PCI bind, MAC readout, TX, RX, payload validation, and counter advance over the freestanding PVH artifact
380-
- the current strict delivery on `E1000` is raw-frame `L2` only; protocol/service reuse over `E1000` remains future depth
378+
- dedicated host regressions prove init, MAC readout, TX, RX, export-surface stability, and bounded `TCP` reuse on the clean-room `E1000` path
379+
- `scripts/baremetal-qemu-e1000-probe-check.ps1`, `scripts/baremetal-qemu-e1000-arp-probe-check.ps1`, `scripts/baremetal-qemu-e1000-ipv4-probe-check.ps1`, `scripts/baremetal-qemu-e1000-udp-probe-check.ps1`, and `scripts/baremetal-qemu-e1000-tcp-probe-check.ps1` now prove live QEMU `E1000` raw-frame, `ARP`, `IPv4`, `UDP`, and bounded `TCP` transport behavior over the freestanding PVH artifact
380+
- `HTTP` / `HTTPS` and higher service reuse over `E1000` remain future depth
381381
- the live freestanding/QEMU proof is now green:
382382
- `scripts/baremetal-qemu-rtl8139-probe-check.ps1`
383383
- MAC readout succeeds

docs/zig-port/PHASE_CHECKLIST.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Registry status:
1212
- ZigOS reference-only integration planning is now tracked in:
1313
- `docs/zig-port/ZAR_VS_ZIGOS_INTEGRATION_PLAN.md`
1414
- `docs/zig-port/ZAR_VS_ZIGOS_E1000_SLICE_PLAN.md`
15-
- first delivered adoption slice is clean-room `E1000` protocol reuse through `ARP` / `IPv4` / `UDP`, not direct VFS/userspace import.
16-
- the clean-room `E1000` slice now ships `src/baremetal/e1000.zig`, `src/baremetal/pci.zig` discovery + decode enablement, `src/pal/net.zig` backend selection across `RTL8139` + `E1000`, host regressions for init/MAC/TX/RX/export state plus `ARP` / `IPv4` / `UDP`, and the live QEMU proofs `scripts/baremetal-qemu-e1000-probe-check.ps1`, `scripts/baremetal-qemu-e1000-arp-probe-check.ps1`, `scripts/baremetal-qemu-e1000-ipv4-probe-check.ps1`, and `scripts/baremetal-qemu-e1000-udp-probe-check.ps1` on top of `scripts/qemu-e1000-dgram-echo.ps1`.
17-
- `TCP` / `HTTP` / `HTTPS` reuse over `E1000` remains future depth.
15+
- first delivered adoption slice is clean-room `E1000` protocol reuse through `ARP` / `IPv4` / `UDP` / bounded `TCP`, not direct VFS/userspace import.
16+
- the clean-room `E1000` slice now ships `src/baremetal/e1000.zig`, `src/baremetal/pci.zig` discovery + decode enablement, `src/pal/net.zig` backend selection across `RTL8139` + `E1000`, host regressions for init/MAC/TX/RX/export state plus `ARP` / `IPv4` / `UDP` / bounded `TCP`, and the live QEMU proofs `scripts/baremetal-qemu-e1000-probe-check.ps1`, `scripts/baremetal-qemu-e1000-arp-probe-check.ps1`, `scripts/baremetal-qemu-e1000-ipv4-probe-check.ps1`, `scripts/baremetal-qemu-e1000-udp-probe-check.ps1`, and `scripts/baremetal-qemu-e1000-tcp-probe-check.ps1` on top of `scripts/qemu-e1000-dgram-echo.ps1`.
17+
- `HTTP` / `HTTPS` reuse over `E1000` remains future depth.
1818
- `FS5.5` framebuffer/console strict closure is now reached locally: `src/baremetal/framebuffer_console.zig` programs a real Bochs/QEMU BGA linear-framebuffer path with bounded mode support for `640x400`, `800x600`, `1024x768`, `1280x720`, and `1280x1024`, `src/baremetal/pci.zig` discovers the selected PCI display adapter as structured metadata, exposes the framebuffer BAR, and enables decode on that function, `src/baremetal/edid.zig`, `src/baremetal/display_output.zig`, and `src/baremetal/virtio_gpu.zig` now add the first real EDID-backed controller path over `virtio-gpu-pci` including exported capability flags for digital input, preferred timing, CEA, DisplayID, HDMI-vendor-data, and basic-audio metadata when present plus EDID-derived connector inference, bounded per-output entry export, and bounded resource-create/attach/set-scanout/flush behavior, `src/pal/framebuffer.zig` exposes the surface plus supported-mode enumeration and display-output state through the PAL, host regressions in `src/baremetal/framebuffer_console.zig`, `src/baremetal/virtio_gpu.zig`, `src/baremetal_main.zig`, and `src/baremetal/display_output.zig` prove framebuffer state, display-output state, adapter metadata, supported-mode enumeration, glyph pixel updates, bounded mode switching, present counters, non-zero scanout pixels, connector inference from EDID capability flags, and the output-entry table, and the live QEMU+GDB proofs `scripts/baremetal-qemu-framebuffer-console-probe-check.ps1` and `scripts/baremetal-qemu-virtio-gpu-display-probe-check.ps1` now read back real MMIO banner pixels plus BGA adapter metadata and real `virtio-gpu-pci` EDID/controller capability state with non-zero scanout pixels and validated output-entry metadata over the freestanding PVH artifact; real HDMI/DisplayPort connector-specific scanout paths remain future depth and are not claimed here.
1919
- Latest FS5.5 display connector activation slice: `src/baremetal/display_output.zig` now retargets the exported active output from bounded per-output entries, `src/baremetal/tool_exec.zig` now exposes `display-activate <connector>` and uses connector-targeted activation in launch profiles, `src/baremetal/tool_service.zig` now exposes typed `DISPLAYACTIVATE`, host/module validation proves successful activation of the connected connector plus explicit mismatched-connector rejection, and `scripts/baremetal-qemu-virtio-gpu-display-probe-check.ps1` now proves the same success/rejection behavior on the live `virtio-gpu-pci` controller path.
2020
- Latest FS5.5 display output mode slice: `src/baremetal/display_output.zig` and `src/baremetal/virtio_gpu.zig` now support explicit per-output mode retargeting on the real `virtio-gpu-pci` path, `src/pal/framebuffer.zig` and `src/baremetal_main.zig` expose that same bounded control through the PAL and `oc_display_output_set`, `src/baremetal/tool_exec.zig` now exposes `display-output-set <index> <width> <height>`, `src/baremetal/tool_service.zig` now exposes typed `DISPLAYOUTPUTSET`, host/module validation proves the connected output can be driven to `1024x768` while oversized requests are rejected without corrupting the exported state, and `scripts/baremetal-qemu-virtio-gpu-display-probe-check.ps1` now proves the same explicit output-index mode change on the live controller path.

docs/zig-port/PORT_PLAN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ Full-stack replacement execution reference:
1414
- `docs/zig-port/ZAR_VS_ZIGOS_INTEGRATION_PLAN.md`
1515
- `docs/zig-port/ZAR_VS_ZIGOS_E1000_SLICE_PLAN.md`
1616
- current hard boundary: no ZigOS source import until upstream licensing is explicit
17-
- first delivered adoption slice is clean-room `E1000` protocol reuse through `ARP` / `IPv4` / `UDP`, because it expands hardware breadth without forcing a VFS/ELF/syscall redesign
17+
- first delivered adoption slice is clean-room `E1000` protocol reuse through `ARP` / `IPv4` / `UDP` / bounded `TCP`, because it expands hardware breadth without forcing a VFS/ELF/syscall redesign
1818
- `src/baremetal/e1000.zig` now provides the first ZAR-owned `82540EM`-class `E1000` path with PCI bind, MMIO + legacy I/O reset, EEPROM MAC readout, bounded TX/RX rings, and raw-frame send/receive telemetry
1919
- `src/baremetal/pci.zig` now discovers the `E1000` MMIO + I/O BAR pair and enables I/O, memory, and bus-master decode on the selected PCI function
20-
- host regressions now prove init, MAC readout, TX, RX, export-surface stability, and `ARP` / `IPv4` / `UDP` protocol reuse on the clean-room `E1000` path
20+
- host regressions now prove init, MAC readout, TX, RX, export-surface stability, and `ARP` / `IPv4` / `UDP` / bounded `TCP` protocol reuse on the clean-room `E1000` path
2121
- `scripts/baremetal-qemu-e1000-probe-check.ps1` plus `scripts/qemu-e1000-dgram-echo.ps1` now prove live QEMU `E1000` PCI bind, MAC readout, TX, RX, payload validation, and counter advance over the freestanding PVH artifact
2222
- `src/pal/net.zig` now routes the same raw-frame PAL seam through selectable `RTL8139` and `E1000` backends without regressing the existing RTL8139 path
23-
- `scripts/baremetal-qemu-e1000-arp-probe-check.ps1`, `scripts/baremetal-qemu-e1000-ipv4-probe-check.ps1`, and `scripts/baremetal-qemu-e1000-udp-probe-check.ps1` now prove live QEMU `E1000` ARP request transmission, IPv4 frame encode/decode, UDP datagram encode/decode, and TX/RX counter advance over the freestanding PVH artifact
24-
- `TCP` / `HTTP` / `HTTPS` reuse over `E1000` remains the next depth step
23+
- `scripts/baremetal-qemu-e1000-arp-probe-check.ps1`, `scripts/baremetal-qemu-e1000-ipv4-probe-check.ps1`, `scripts/baremetal-qemu-e1000-udp-probe-check.ps1`, and `scripts/baremetal-qemu-e1000-tcp-probe-check.ps1` now prove live QEMU `E1000` ARP request transmission, IPv4 frame encode/decode, UDP datagram encode/decode, bounded TCP handshake/payload/teardown, and TX/RX counter advance over the freestanding PVH artifact
24+
- `HTTP` / `HTTPS` reuse over `E1000` remains the next depth step
2525
- `FS5.5` hardware-driver pivot update:
2626
- framebuffer/console strict closure is now reached locally.
2727
- real linear-framebuffer path shipped in `src/baremetal/framebuffer_console.zig`:

0 commit comments

Comments
 (0)