@@ -49,11 +49,41 @@ MAKE_ARGS=(BACKEND=uci-m3 "HTTPS_HOST=$DEMO_HOST" "HTTPS_PATH=$DEMO_PATH")
4949
5050# What the firmware side published; quoted in the README, checked nowhere
5151# here (the device is not involved in a build).
52- # The requirement is the interface; the build named is only where it was
53- # validated. The upstream PR numbers are not known yet; the README carries a
54- # marked slot for them (UPSTREAM_PRS overrides it once they exist).
55- FIRMWARE=" M3-SPEC v1 + errata v1.1/v1.2 firmware (validated on esp-tls/m3-master 3a1ff9ff: fw 3.15, FPGA 126, ESP 1.309)"
56- UPSTREAM_PRS=" ${UPSTREAM_PRS:- [TO BE FILLED IN: 1541ultimate upstream PR number(s)]} "
52+ # FIRMWARE is the firmware side's own one-line description (agreed with
53+ # them); the source branch, the prebuilt image and its sha256 follow. The
54+ # image line is printed only when FIRMWARE_IMAGE_SHA is set. These and
55+ # UPSTREAM_PRS are plain constants, not env knobs, so the README is a
56+ # function of the commit: a later commit swaps them.
57+ FIRMWARE=" TLS client sockets for the Ultimate 64 / U64 Elite, from
58+ JC-000/1541ultimate branch pr/3-tls-r1 (f3df8261), prebuilt image in
59+ prerelease tls-preview-f3df8261. Not upstream; proposed on
60+ GideonZ/1541ultimate#952."
61+ FIRMWARE_SOURCE=" https://github.com/JC-000/1541ultimate/tree/pr/3-tls-r1"
62+ FIRMWARE_PRERELEASE=" https://github.com/JC-000/1541ultimate/releases/tag/tls-preview-f3df8261"
63+ FIRMWARE_IMAGE_SHA=" 15e9ff7cd8a11daf1f4698d574480381d475db7754e1d276d9aa95e8013ded3c"
64+ # The build the "Measured" figures were taken on (the image above).
65+ MEASURED_FW=" firmware 3.15 git f3df8261 (the image above, ESP module 1.8)"
66+ # Change it once an upstream PR implements $21-$25.
67+ UPSTREAM_PRS=" not upstream yet. GideonZ/1541ultimate#952 is the proposal issue;
68+ this demo follows its proposed command numbering (\$ 21 OPEN_TLS,
69+ \$ 23 TLS_INFO, \$ 25 TLS_RELEASE). No upstream PR implements these
70+ commands yet (GideonZ/1541ultimate#953 adds GET_RANDOM only)."
71+ # Earlier demo images (this script's history, JC-000/c64-https 82a549a to
72+ # 9eabd50) were validated on these builds; neither is public.
73+ EARLIER_RUNS=" esp-tls/m3 f2e46946 and esp-tls/m3-master 3a1ff9ff"
74+
75+ # The image the "Measured" figures below were taken with, and its commit.
76+ # The README says THIS image only when the PRG just built is that one;
77+ # otherwise it names the measured PRG and says this one was not run, so a
78+ # rebuild after an unrelated change cannot inherit the claim. Update both,
79+ # with the figures, after each demo-rig run.
80+ # MEASURED_COMMIT is a commit on master that reproduces that PRG (the
81+ # adapter diff below runs from it); MEASURED_BUILT is where the measured
82+ # image itself was built.
83+ MEASURED_PRG_SHA=" 916d41628a17b9436bbf58a71f7350c721a06e459cf5c33e5baeb1ad61af9a24"
84+ MEASURED_COMMIT=" daaef3354ec443b0feb09dfa2900795f9fa265ce"
85+ MEASURED_COMMIT_NOTE=" the merge of JC-000/c64-https#299"
86+ MEASURED_BUILT=" daaef33 on 2026-10-14"
5787SPEC=" M3-SPEC v1 (= r7.7), sha256 c265fdfcfdd08dee989a96eee25fae66fb6650ee4be8bb24f8dd791d9ee3db9f, with errata v1.1 (f9a39ff334b34cb0e1a63d5d508675de552ac8eacb23ccd6095a7f4c72788f9a) and v1.2 (a6802f40db3229d53591ef6e0773641d723186e779dd8726abff5915cbe551a4)"
5888
5989die () { echo " [m3-demo] ERROR: $* " >&2 ; exit 1; }
@@ -125,6 +155,53 @@ prg_sha="$(sha "$OUT/$NAME.prg")"
125155d64_sha=" $( sha " $OUT /$NAME .d64" ) "
126156prg_bytes=" $( wc -c < " $OUT /$NAME .prg" | tr -d ' ' ) "
127157
158+ # The M3 adapter's sources: everything under src/net/uci-m3/ (some of it,
159+ # m3_https_get.inc and net_tuning.inc, is included from boot.s/exports.s,
160+ # not from the adapter's objects), every file ca65 read for the objects in
161+ # build/net/uci-m3/ (their .d files: the .s files and every .include, such
162+ # as src/net/uci/uci_regs.inc), and the backend's cfg. Derived from git and
163+ # this build, not listed by hand. The directory itself is also a pathspec,
164+ # so a file deleted from it since the measured commit counts too.
165+ shopt -s nullglob
166+ adapter_deps=(build/net/uci-m3/* .d)
167+ shopt -u nullglob
168+ [ " ${# adapter_deps[@]} " -gt 0 ] || die " no build/net/uci-m3/*.d: cannot list the adapter's sources"
169+ adapter_files=()
170+ while IFS= read -r f; do adapter_files+=(" $f " ); done < <(
171+ { git ls-files -- src/net/uci-m3
172+ sed -n ' s/^build\/[^:]*:[[:space:]]*//p' " ${adapter_deps[@]} " | tr ' \t' ' \n\n'
173+ echo cfg/c64-https-uci-m3.cfg; } | grep -v -e ' ^$' -e ' ^build/' | sort -u)
174+ [ " ${# adapter_files[@]} " -gt 1 ] || die " cannot list the adapter's sources"
175+
176+ if [ " $prg_sha " = " $MEASURED_PRG_SHA " ]; then
177+ measured_with=" Measured with THIS image (PRG sha256 above)"
178+ this_run=" The run recorded for this image is the one under \" Measured\" below."
179+ else
180+ # Whether the adapter's sources moved since the measured commit, from
181+ # git rather than from prose; "unknown" if that commit is not here.
182+ if ! git cat-file -e " $MEASURED_COMMIT ^{commit}" 2> /dev/null; then
183+ adapter=" whether the M3 adapter's sources changed since is unknown here"
184+ else
185+ changed=" $( git diff --name-only " $MEASURED_COMMIT " HEAD -- src/net/uci-m3 " ${adapter_files[@]} " \
186+ | sort -u | sed ' s/^/ /' ) "
187+ if [ -z " $changed " ]; then
188+ adapter=" the M3 adapter's ${# adapter_files[@]} source files (src/net/uci-m3/, what its
189+ objects include, and its cfg) are unchanged since"
190+ else
191+ adapter=" changed since in the M3 adapter's sources:
192+ $changed "
193+ fi
194+ fi
195+ measured_with=" NOT measured with this image. Measured with PRG sha256
196+ $MEASURED_PRG_SHA
197+ reproducible from commit $MEASURED_COMMIT
198+ ($MEASURED_COMMIT_NOTE );
199+ the measured image was built from $MEASURED_BUILT
200+ ($adapter )"
201+ this_run=" This image has no recorded run on any firmware."
202+ echo " [m3-demo] NOTE: this PRG is not the measured one; the README says so"
203+ fi
204+
128205cat > " $OUT /README.txt" << EOF
129206c64-https M3 demo — HTTPS on a C64, with TLS done by the Ultimate's ESP32
130207==========================================================================
@@ -157,16 +234,28 @@ $toolchain
157234
158235What it needs
159236-------------
160- - An Ultimate 64 (Elite) running firmware with the M3 TLS sockets:
161- $FIRMWARE .
162- 1541ultimate upstream PR(s): $UPSTREAM_PRS
237+ - An Ultimate 64 (Elite) running firmware with the M3 TLS sockets.
238+ Firmware: $FIRMWARE
239+ Source:
240+ $FIRMWARE_SOURCE
241+ Prebuilt image:
242+ $FIRMWARE_PRERELEASE
243+ ${FIRMWARE_IMAGE_SHA: + Image sha256:
244+ $FIRMWARE_IMAGE_SHA
245+ } Upstream status:
246+ $UPSTREAM_PRS
247+ $this_run
248+ Earlier demo images were validated on the non-public builds
249+ $EARLIER_RUNS .
163250 - Its WiFi module up (the ESP32 does the TLS), the network connected, and
164251 the clock set by SNTP (certificate dates are checked).
165252 - The Ultimate's Command Interface enabled.
166- - No REU. Turbo is optional. The same client source, in its REU-sink
167- build, fetched en.wikipedia.org /robots.txt (28,275 B) in 16 s from G
168- at 1 MHz (turbo off) and in 6 s at 48 MHz (U64E, 2026-10-13); large
169- pages were not timed at 1 MHz.
253+ - No REU. Turbo is optional. The same M3 adapter, in its REU-sink
254+ build, fetched en.wikipedia.org /robots.txt (28,275 B) on the U64E:
255+ 17.5 s from G to the whole body at 1 MHz (turbo off), handshake done
256+ at 5.8 s (sink build 146647e4, firmware f3df8261, 2026-10-15); and 6 s
257+ from G at 48 MHz (esp-tls/m3-master 3a1ff9ff, 2026-10-13). Large pages
258+ were not timed at 1 MHz.
170259 Interface implemented: $SPEC .
171260
172261How to run it
@@ -183,8 +272,8 @@ How to run it
183272 A body cut short of its own framing prints BODY INCOMPLETE and the
184273 firmware's status line before CONNECTION CLOSED.
185274
186- Three URLs to try
187- -----------------
275+ Four URLs to try
276+ ----------------
188277 1. $DEMO_HOST $DEMO_PATH (the default)
189278 2. github.com /robots.txt
190279 3. 208-80-153-224.nip.io / (a NEGATIVE: a Wikipedia address
@@ -194,16 +283,25 @@ Three URLs to try
194283 and 208.80.153.224 still serving Wikipedia. If either changes, pick
195284 another <ip-with-dashes>.nip.io name for a site whose certificate does
196285 not name it.)
286+ 4. badssl.com / (a NEGATIVE: a server without
287+ TLS 1.3. Expected: TLS HANDSHAKE FAILED / 14,TLS ALERT RECEIVED: 40 /
288+ THE SERVER DOES NOT DO TLS 1.3. It depends on badssl.com staying
289+ TLS 1.2 only.)
197290
198- Measured with THIS image (PRG sha256 above) , validated on an Ultimate 64
199- Elite (U64E), firmware 3.15 git 3a1ff9ff, 48 MHz, REU disabled, the .d64
200- mounted on drive 8 and loaded with LOAD"*",8,1
201- (tools/uci/rig_https_m3_demo.py), 2026-10-13 :
202- 1. HTTP 200, 751,823 B consumed == Content-Length, 18 s from G to
291+ $measured_with , validated on an Ultimate 64
292+ Elite (U64E), $MEASURED_FW ,
293+ 48 MHz, REU disabled, 2026-10-15. URLs 1-3: the .d64 mounted on drive 8
294+ and loaded with LOAD"*",8,1 (tools/uci/rig_https_m3_demo.py):
295+ 1. HTTP 200, 759,171 B consumed == Content-Length, 20 s from G to
203296 CONNECTION CLOSED (the page size changes as the article is edited).
204- 2. HTTP 200, 16,739 B consumed == Content-Length, 4 s.
297+ 2. HTTP 200, 16,739 B consumed == Content-Length, 5 s.
205298 3. Refused: 94,CERTIFICATE NAME MISMATCH: 0x00000004.
206- Other Ultimate models, and other clock speeds, have not been tested.
299+ URL 4: the same PRG written into memory over the Ultimate's REST interface
300+ instead of loaded from the disk (tools/uci/rig_https_m3.py refuse):
301+ 4. Refused: 14,TLS ALERT RECEIVED: 40, then THE SERVER DOES NOT DO
302+ TLS 1.3.
303+ Other Ultimate models, and other clock speeds, have not been tested
304+ with this image.
207305
208306What an unsupported device shows
209307--------------------------------
0 commit comments