Skip to content

firmware: the GEOS boot image is built per target, ready for GEOS 128 - #75

Merged
SensoriumEmbedded merged 3 commits into
SensoriumEmbedded:mainfrom
kfox:geos-boot-core
Oct 29, 2026
Merged

SensoriumEmbedded merged 3 commits into
SensoriumEmbedded:mainfrom
kfox:geos-boot-core

Conversation

@kfox

@kfox kfox commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Prepares GEOS 64's boot image code for GEOS 128, with no change to what GEOS 64 does. The GEOS 128 launch is #76, stacked on this one.

Each GEOS target now names its own TR disk driver, the start-up run that sets its date and time, and where its boot file keeps the C128 reset key. GeosBuildBootImage reads the boot file, swaps the disk transport, breaks the reset key and sets the clock; GeosBuildBootPrg wraps that image in GEOS 64's BASIC stub as before.

  • GEOS 128 sets its clock and date in one 44-byte run, which the patch takes over.
  • The transport swap no longer requires the routines it replaces to lie inside the run it overwrites. The checks that nothing it leaves alone points into the run stay.
  • CONFIGURE is turned off for any auto-exec file whose name contains CONFIG, which covers GEOS 128's "128 CONFIGURE" and the 2.0r configure files.

Verified

  • The host tests in npm test cover the per-target patching.
  • GEOS 64's boot PRG and patched disk are byte-identical to before on the stock GEOS 64 D81.
  • On hardware, GEOS 64 still reaches its DeskTop.

Reviewed at medium, and the review's fix commit at low.

kfox added 2 commits October 27, 2026 08:27
Each GEOS target now names its own TR disk driver, the start-up runs that set its date and time, and where its boot file keeps the C128 reset key. GeosBuildBootImage reads the boot file, swaps the transport, breaks the reset key and sets the clock. GeosBuildBootPrg wraps that image in GEOS 64's BASIC stub, as before.

GEOS 128 sets the clock and the date in one 44-byte run, behind a store of zero that the patched run takes over to load X. Its 1581 driver keeps NewDisk after ReadBlock. The transport swap no longer requires the routines it replaces to lie inside the run it overwrites, since one left outside is only unused. The checks that nothing it leaves alone points into the run stay.

CONFIGURE is turned off for any auto-exec file whose name contains CONFIG, which catches GEOS 128's "128 CONFIGURE", "128 CONFIG 2.0r" and "64 CONFIG 2.0r".

GEOS 64's boot PRG and patched disk are byte-identical to before on the stock GEOS 64 D81.

@SensoriumEmbedded SensoriumEmbedded left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for splitting the boot image out per target, with GEOS 64's output byte-identical it reads as pure preparation for the 128.

Memory: +192 B of RAM1 code (ITCM) on both boards, with variables, stack and RAM2 unchanged and flash moving by under 1 KB. The two helpers below account for it (182 B; the rest is alignment).

There is one thing I'd like you to look at before merging.

1. Geos64SetDate and Geos64SetTime landed in ITCM (Source/Teensy/GEOS/GeosBoot.h:236 and :243)

Before this PR the GEOS 64 clock patch was inlined into FLASHMEM LaunchGeos, so it lived in flash. Now that the two helpers are reached through the GeosClockRun function pointers they're emitted out of line, and without a FLASHMEM of their own they go to ITCM: 14 B and 168 B, on both the TR and the TR+.

Suggested fix: mark both FLASHMEM static void ... (inline suggestions attached). They run only from the launcher in the main loop, never from an interrupt, and GeosDiskPatch.h already defines FLASHMEM empty for the host harnesses, so the tests build unchanged. Saves 182 B of ITCM per board.

Comment thread Source/Teensy/GEOS/GeosBoot.h Resolved
Comment thread Source/Teensy/GEOS/GeosBoot.h Resolved
@kfox
kfox marked this pull request as draft October 29, 2026 18:02
Travis's review of SensoriumEmbedded#75: the GEOS 64 clock helpers keep FLASHMEM now that they are reached through function pointers.
@kfox
kfox marked this pull request as ready for review October 29, 2026 18:11
@SensoriumEmbedded
SensoriumEmbedded merged commit 9acea84 into SensoriumEmbedded:main Oct 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants