Skip to content

Stage 2: editor split into one file per screen, more tests - #1

Merged
DrogaBox merged 3 commits into
mainfrom
stage2-internals
Nov 24, 2026
Merged

DrogaBox merged 3 commits into
mainfrom
stage2-internals

Conversation

@DrogaBox

Copy link
Copy Markdown
Owner

Stage 2 of the plan: the editor's insides, with nothing you see changed.

  • OpenCoreEditor.c (4775 lines) is now seven files, one per screen, plus OpenCoreEditorPrivate.h. Every line of code is where it was before, checked line by line; the only edits are STATIC dropped from what more than one file uses.
  • Editor tests at 80x25, 100x30, 128x40 and 240x67 consoles, a 700 character comment, the longest config name, and four broken config.plist files against every screen that reads or saves it. 1669 checks, 0 failures, plain and with SANITIZE=1. OpenCanopy tests pass too.
  • The README screenshots come out byte for byte the same as before.
  • DrogaBox/WRITES.md: what each save writes and what a power cut would leave. Saving config.plist has a gap (cut between deleting the old file and finishing the new one = no config at the next start); the fix is proposed there, not done.

The full EDK2 build (X64 RELEASE and DEBUG) compiles with no warnings.

OpenCoreEditor.c had every screen in 4775 lines. It is now:

- OpenCoreEditor.c: shared helpers, reading and writing config.plist, the main menu, the entry point
- OpenCoreEditorBootArgs.c: boot-args and boot flags
- OpenCoreEditorBrowser.c: the config.plist tree
- OpenCoreEditorLists.c: kexts, drivers, ACPI, tools and the other on/off lists
- OpenCoreEditorQuirks.c: quirks
- OpenCoreEditorText.c: log, kernel panic, config check, comparing configs
- OpenCoreEditorConfigs.c: config files and putting the backup back
- OpenCoreEditorPrivate.h: the types and functions they share

No code changed: every line of the old file is in one of the new ones, checked line by line. The only
edits are STATIC dropped from the 30 functions and 6 tables used by more than one file.
- The fake console of TestPickerEditor can be any size up to 240x67 (what BuiltinGraphics makes on a
  1080p screen). Every screen of the main menu is opened at 80x25, 100x30, 128x40 and 240x67; the
  harness fails if anything is written to the last column or row or the console scrolls.
- A 700 character comment in the kexts list and the config tree, at 80x25 and 240x67, and a config
  file with the longest name allowed, in the chooser and chosen.
- Four broken config.plist files (empty, not a plist, cut short, wrong root) against every screen that
  reads or saves the config: none crashes, and nothing is written.
- With PICKER_TEST_SCREENS=<dir> the harness keeps each screen as text; render-screen.swift takes the
  console size.
- A failed ASSERT of the libraries is printed on the host as well.

1669 checks, 0 failures, plain and with SANITIZE=1. DrogaBox/WRITES.md goes through what each save
writes and what a power cut would leave.
@DrogaBox
DrogaBox merged commit 8dc351a into main Nov 24, 2026
22 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.

1 participant