Repository navigation
freedos_micro_python 0.1.4
lwIP packed-struct fix — full TCP/IP stack now boots cleanly.
The FreeDOS MicroPython port's lwIP integration was tripping a boot-time assertion:
LWIP_ASSERT("Struct packing not implemented correctly. Check your lwIP port.",
sizeof(packed_struct_test) == 5);
Root cause was upstream of this repo: the uc_core C frontend was stripping __attribute__((packed)) before parsing, so uc386 codegen — which already honors the flag — never saw it. The packed test struct (u8 + u32) laid out at 8 bytes instead of the expected 5, the assertion fired, and lwIP refused to boot.
Fix landed in uc_core 0.3.6 → uc386 0.1.3 → freedos_micro_python 0.1.4 (pinned dep chain).
Verified end-to-end from a clean PyPI install
$ pip install freedos_micro_python==0.1.4
Successfully installed freedos_micro_python-0.1.4 uc386-0.1.3 uc_core-0.3.6 uplox-3.0.0
$ freedos-micropython fetch
$ freedos-micropython port
micropython: built build/micropython.bin (456157 bytes)
$ FREEDOS_MP_BIN=build/micropython.bin pytest tests/test_smoke.py -q
98 passed, 1 failed in 1:51
Smoke suite
- Before: 91 passed, 8 failed (7 lwip + 1 dosbox-x env timeout).
- After: 98 passed, 1 failed — all 7 lwip tests now green; the remaining failure (
test_dosbox_x_rig_loads_ne2000) is an environmental dosbox-x subprocess SIGKILL at the 60 s timeout, not a port regression. - Built binary is bit-identical (456,157 bytes) to the editable-install build, so the PyPI wheel reproduces the development tree exactly.
What this unblocks
import lwipboots into a working IPv4 stack with the loopback poll registered.- TCP/IP socket round-trips work over loopback (
test_micropython_lwip_loopback_tcpexercises send/recv ofb'hello lwip'). - The TLS path (axtls over lwIP) now has a working transport underneath it; the remaining tls-rig blocker is the PMODE/W packet-driver routing, not the TLS or lwIP stack itself.
Changes
pyproject.toml:uc386>=0.1.2→uc386>=0.1.3, version bump to 0.1.4.