Debian Codegraph @

grub

raw
1 commit b75bff36f7a910da3cce4ddaecee31f02deae9ed
2 Author: Nicolas Pitre <[email protected]>
3 Date: Mon Mar 9 02:02:59 2026 -0400
4
5 Update GRUB documentation to reflect working braille support.
6
7 README.Grub:
8 - Add sections on key table installation, configuration via
9 environment variables, QEMU testing, and how the module works.
10 - Update troubleshooting with key table and xHCI guidance.
11 - Document the go-grub and grub-test scripts.
12 - Update USB controller guidance (UHCI/OHCI/EHCI, not xHCI).
13
14 GRUB-Module-Design.md:
15 - Update section 5.4 to reflect actual implementation (direct
16 brlttyConstruct from GRUB_MOD_INIT with hardcoded argv).
17 - Rewrite section 8 to reflect working end-to-end status.
18 - Document known limitations (snprintf %.*s, xHCI, EFI handles).
19 - Add future work items (command registration, real hardware).
20 - Update getopt and system_grub.c descriptions.
21
22 Co-Authored-By: Claude Opus 4.6 <[email protected]>
23
24 commit e20e71532a582689a6254c923a3394d23e9a66e4
25 Author: Nicolas Pitre <[email protected]>
26 Date: Mon Mar 9 01:58:51 2026 -0400
27
28 Update test scripts: all tables, auto-detect device, faster hotplug.
29
30 grub-test:
31 - Copy all key tables and text tables to disk image instead of only
32 HumanWare files, matching the full driver list.
33 - Replace hotplug blind sleep with serial log polling — wait for
34 GRUB to print "brltty module loaded" before hotplugging the USB
35 device.
36 - Update hotplug comment explaining why it is necessary (OVMF claims
37 devices present at startup).
38
39 go-grub:
40 - Auto-detect the braille USB device from /sys/bus/usb/drivers/usbfs
41 instead of hardcoding vendor:product ID. BRLTTY claims devices via
42 usbfs, so its bindings in sysfs reveal the device.
43 - Log all output to grub-test.d/go.log for review after the host
44 BRLTTY restarts (braille display is unavailable during the test).
45
46 Co-Authored-By: Claude Opus 4.6 <[email protected]>
47
48 commit adfee8a47c74797fa57ba999c3f6aa15e413935e
49 Author: Nicolas Pitre <[email protected]>
50 Date: Mon Mar 9 01:56:01 2026 -0400
51
52 Improve GRUB USB backend: logging, write delay, and error handling.
53
54 - Add debug logging throughout USB operations (control transfers,
55 bulk reads/writes, device iteration) for diagnosability.
56 - Add formatHex() helper for logging raw USB data.
57 - Add 50ms delay after bulk writes: GRUB's USB stack does synchronous
58 polled transfers with no hardware queuing, so the host can read
59 before the device has processed a command and prepared its reply.
60 - Clear grub_errno before USB operations to prevent stale file I/O
61 errors from being misinterpreted as USB failures.
62 - Initialize bulk read actual length to 0 before the call.
63
64 Co-Authored-By: Claude Opus 4.6 <[email protected]>
65
66 commit dedb53368c8d2fe184ccd575825de14b5860cdbd
67 Author: Nicolas Pitre <[email protected]>
68 Date: Mon Mar 9 01:55:09 2026 -0400
69
70 Configure tables directory and clean up GRUB module entry point.
71
72 - Pass -T /boot/grub/brltty to brlttyConstruct() so key tables are
73 found on the GRUB filesystem. Without this, BRLTTY cannot load
74 key bindings and display keys are unresponsive.
75 - Remove stale debug printf and verbose comment block.
76
77 Co-Authored-By: Claude Opus 4.6 <[email protected]>
78
79 commit 9347967c3c412885ad2c61d5dd536347f2d15064
80 Author: Nicolas Pitre <[email protected]>
81 Date: Mon Mar 9 01:54:27 2026 -0400
82
83 Fix POSIX shims for GRUB: memcmp, qsort, and path normalization.
84
85 - Add memcmp() implementation: GRUB's posix_wrap #defines memcmp to
86 grub_memcmp, but the macro is suppressed when we define the real
87 function, so we need our own byte-comparison loop.
88 - Fix qsort() to allocate the temp buffer once via grub_malloc instead
89 of using a VLA inside the inner loop (redundant allocation per
90 iteration).
91 - Add normalize_path() to resolve "." and ".." components in file
92 paths. GRUB's grub_file_open does not handle ".." — key table
93 files use relative includes like "../chords.kti" which fail without
94 normalization.
95
96 Co-Authored-By: Claude Opus 4.6 <[email protected]>
97
98 commit e43e0dd3839e280eb0696fea9131f7b5149542fe
99 Author: Nicolas Pitre <[email protected]>
100 Date: Mon Mar 9 01:54:05 2026 -0400
101
102 Add GRUB build target and fix cross-compilation attribute detection.
103
104 - Add GRUB_BUILD autoconf substitution so `make all` in Programs/
105 builds brltty.mod instead of the normal host targets when
106 configured for the GRUB (elf*) platform.
107 - Force-enable packed and unused variable attributes in cfg-grub:
108 autoconf's test program compiles but can't link/run in freestanding
109 mode, so detection fails. Without packed, USB protocol structs like
110 USB_CDC_ACM_LineCoding gain padding and break the wire protocol.
111
112 Co-Authored-By: Claude Opus 4.6 <[email protected]>
113
114 commit d9c6678001806b115021d7a0b3364387c3409f21
115 Author: Nicolas Pitre <[email protected]>
116 Date: Mon Mar 9 01:18:23 2026 -0400
117
118 Always send SET_INTERFACE even for a single alternate setting.
119
120 When an interface has only one alternate setting, the code previously
121 skipped the SET_INTERFACE request entirely ("nothing to choose").
122 However, USB 2.0 §9.1.1.5 specifies that SET_INTERFACE resets the
123 data toggle for all endpoints in the interface to DATA0. Without
124 this reset, stale toggle state (from a previous session, a failed
125 transfer, or an incomplete reset) can cause the device and host to
126 disagree on the expected DATA0/DATA1 sequence, silently dropping
127 bulk packets.
128
129 Linux's cdc_acm driver always issues SET_INTERFACE regardless of
130 the alternate setting count, for exactly this reason.
131
132 This was observed with HumanWare Brailliant displays under GRUB's
133 minimal USB stack, which does not always reset toggles during
134 SET_CONFIGURATION. The fix follows the spec and should be harmless
135 on well-behaved devices, since SET_INTERFACE(0, 0) is a valid
136 no-op selection that every compliant device must accept.
137
138 Co-Authored-By: Claude Opus 4.6 <[email protected]>
139
140 commit b0f5ff5b79be3ce76ae58dac1a5fc8661be291e9
141 Author: Nicolas Pitre <[email protected]>
142 Date: Mon Mar 9 01:06:39 2026 -0400
143
144 Fix include path construction for GRUB's limited snprintf.
145
146 GRUB's grub_snprintf does not support the %.*s format specifier
147 (precision via * argument), which misaligns the argument stack and
148 produces garbage output. Replace with direct memcpy operations —
149 the buffer is already correctly sized via VLA.
150
151 Co-Authored-By: Claude Opus 4.6 <[email protected]>
152
153 commit 65511be4d7482eb34aa85d820b275dd829abe530
154 Author: Nicolas Pitre <[email protected]>
155 Date: Sun Mar 8 11:18:55 2026 -0400
156
157 Implement getopt for GRUB and bootstrap the event loop.
158
159 The getopt() stub returned -1 immediately, leaving all argv entries
160 as unparsed positional parameters ("too many parameters" error).
161 Replace with a minimal implementation that handles short options
162 with required arguments, enough for brlttyConstruct()'s -l and -n.
163
164 After brlttyConstruct(), pump brlttyWait(0) several times so the
165 async alarm system fires and transitions the screen and braille
166 driver activities from scheduled to started. The screen driver
167 registers a grub_term_input whose getkey() callback calls
168 brlttyWait(0) on every GRUB input poll, sustaining the event loop.
169
170 Result: screen driver starts ("shadow terminal active 160x42"),
171 braille driver autodetection cycles through all compiled-in drivers
172 probing usb: transport, retrying periodically as designed.
173
174 Co-Authored-By: Claude Opus 4.6 <[email protected]>
175
176 commit 181dd63f90f8ed94a5d25c0328a7d0816eb78300
177 Author: Nicolas Pitre <[email protected]>
178 Date: Sat Mar 7 23:39:47 2026 -0500
179
180 Fix GRUB module loading: license, relocations, and build flags.
181
182 Three bugs prevented brltty.mod from initializing inside GRUB:
183
184 1. License string was "gpl3+" but GRUB's dl.c only accepts the
185 exact strings "GPLv3", "GPLv3+", or "GPLv2+" (case-sensitive).
186
187 2. Missing -mcmodel=large and -fno-PIC caused GCC to emit
188 R_X86_64_REX_GOTPCRELX relocations that GRUB's x86_64 module
189 loader does not implement. Added the full set of GRUB-required
190 flags to cfg-grub (-mcmodel=large, -fno-PIC, -mno-red-zone,
191 -msoft-float, etc.) and suppressed -fPIC in LIBCFLAGS for the
192 elf* host target in configure.ac.
193
194 3. Float division in cmd_touch.c failed with "SSE register return
195 with SSE disabled" under -msoft-float. Replaced with equivalent
196 integer comparison.
197
198 Also: route BRLTTY log output to grub_printf() under GRUB_RUNTIME,
199 update grub-test to embed modules via grub-mkimage (USB host-controller
200 init invalidates EFI disk handles, breaking subsequent insmod), and
201 prefer a locally-built GRUB tree when available.
202
203 Tested: brlttyConstruct() returns PROG_EXIT_SUCCESS in QEMU/OVMF.
204
205 Co-Authored-By: Claude Opus 4.6 <[email protected]>
206
207 commit a39c5652aff7e49e84e890b541446218822e139b
208 Author: Nicolas Pitre <[email protected]>
209 Date: Sat Mar 7 22:23:19 2026 -0500
210
211 Add GRUB module QEMU test script.
212
213 grub-test builds an EFI disk image with GRUB + brltty.mod and boots it
214 in QEMU for testing. Uses mtools (no root needed) to populate a FAT32
215 ESP with the GRUB bootloader, USB stack modules, and brltty.mod. Serial
216 console output is captured to a log file for analysis.
217
218 Commands: build-image, run [--graphic|--usb-host=V:P], log, clean.
219
220 Also add /grub-test.d to .gitignore for test artifacts.
221
222 Co-Authored-By: Claude Opus 4.6 <[email protected]>
223
224 commit 9f766c95580b2357504f45ae35587df612960c5c
225 Author: Nicolas Pitre <[email protected]>
226 Date: Sat Mar 7 19:15:42 2026 -0500
227
228 Add GRUB build artifacts to .gitignore.
229
230 Ignore .mod/.module (GRUB loadable module outputs) and grub-root
231 (symlink to local GRUB source tree used for header includes).
232
233 Co-Authored-By: Claude Opus 4.6 <[email protected]>
234
235 commit a204ff8abb1fd014f0391c4b56a9440c9c783486
236 Author: Nicolas Pitre <[email protected]>
237 Date: Sat Mar 7 19:14:35 2026 -0500
238
239 Fix GRUB .mod build: working objcopy/strip, resolve link errors.
240
241 The brltty.mod target now produces a correct GRUB loadable module with
242 .modname/.moddeps ELF sections and properly stripped symbols.
243
244 Makefile.in: Replace undefined TARGET_OBJCOPY/TARGET_STRIP with explicit
245 GRUB_OBJCOPY/GRUB_STRIP defaults. The old variables were never set by
246 configure, causing objcopy to silently skip and strip to run as a broken
247 command. Also add section removals from GRUB's upstream genmod.sh.
248
249 prologue.h: Fix three compiler warnings in GRUB freestanding mode:
250 - ARRAY_SIZE redefinition: #undef before sys/types.h pulls in grub/misc.h
251 - PRIdPTR redefinition: consolidate into single #ifdef __INTPTR_FMTd__ block
252 - __builtin_popcount: undef HAVE_BUILTIN_POPCOUNT to avoid __popcountdi2
253 libgcc dependency (use manual bit-counting loop instead)
254
255 async_io.c: Add asyncExecuteIoCallback stub for non-ASYNC_CAN_MONITOR_IO
256 platforms (GRUB has no poll/select). Called unconditionally from
257 async_wait.c but only defined inside #ifdef ASYNC_CAN_MONITOR_IO.
258
259 Co-Authored-By: Claude Opus 4.6 <[email protected]>
260
261 commit 8628899ea82e1e7b5c73971bc521dba7f72acdfd
262 Author: Nicolas Pitre <[email protected]>
263 Date: Sat Mar 7 18:49:22 2026 -0500
264
265 Complete GRUB freestanding POSIX compatibility layer.
266
267 All BRLTTY source files now compile with zero errors and zero
268 warnings in the GRUB freestanding environment (-nostdinc -nostdlib
269 -ffreestanding). This required:
270
271 POSIX stub headers (Headers/grub/):
272 - time.h: struct tm, time_t, timespec/timeval; chains to GRUB's
273 real grub/time.h for grub_get_time_ms()/grub_millisleep()
274 - termios.h: struct termios and terminal control constants
275 - signal.h: sig_atomic_t, sigset_t, signal numbers
276 - fcntl.h: O_RDONLY etc., open() stub
277 - sys/stat.h: struct stat with st_dev/st_ino
278 - sys/ioctl.h: TIOCGWINSZ, struct winsize, ioctl() stub
279 - strings.h, search.h: minimal stubs
280
281 prologue.h GRUB_RUNTIME additions:
282 - inttypes.h format macros (PRI[duxX]{8,16,32,64,PTR,MAX})
283 - errno codes (EAGAIN, EIO, ENODEV, EBUSY, EINTR, EROFS, EPIPE)
284 - Missing types (intptr_t, ino_t, dev_t, sig_atomic_t)
285 - ffs() via __builtin_ffs
286 - UINT16_C, INT16_MIN, UINT32_MAX
287 - stdio stubs (fopen/fclose/fread/fwrite/fprintf/feof/ferror/
288 fflush/fgets/fgetc/fputs/fputc/fileno, stdin/stdout/stderr)
289 - fd I/O stubs (close/write/read)
290 - getopt/optarg/optind/opterr/optopt
291 - select()/fd_set/FD_ZERO/FD_SET/FD_ISSET
292 - setvbuf/_IONBF
293 - Locale stubs (setlocale, LC_ALL, LC_CTYPE)
294 - Force HAVE_WCHAR_H and WCHAR_MAX for GRUB so wchar.h is
295 included and wcs* macros don't conflict with GRUB's definitions
296 - Wide-char functions (wcslen, wmemcpy, wmemcmp, wmemchr, wmemset,
297 wcsncmp, wcschr, wcsrchr, wcscpy, wcstok, isw*, tow*)
298 - Variadic ARRAY_SIZE macro supporting both GRUB's 1-arg and
299 BRLTTY's 2-arg calling conventions
300
301 system_grub.c additions:
302 - strpbrk, strncasecmp, atoi
303 - time/localtime/gmtime/strftime stubs
304 - FILE operations via grub_file_open/grub_file_read/grub_file_close
305 - fprintf routes stdout/stderr to grub_printf
306 - getopt stub (returns -1; GRUB uses grub_register_command)
307 - setlocale, vprintf, srand, unlink, rename, pipe, fdopen, freopen
308 - setvbuf, select stubs
309
310 NO_FLOAT guards:
311 - color_types.h: guard HSVColor/HLSColor structs
312 - color.h: guard float-using function declarations
313 - color_internal.h: guard HSVComponentRange and related
314 - color.c: guard all HSV/HLS conversion functions
315 - cmdargs.h/cmdargs.c: guard parseFloat/parseDegrees/parsePercent
316 - scr.c: guard RGB color name path (VGA path still works)
317
318 Other fixes:
319 - cfg-grub: add -Wno-incompatible-pointer-types for GRUB's
320 strtol/strtoul const char** vs char** mismatch
321 - timing.c: fix GRUB_RUNTIME struct tm member names
322 - async_io.c: add MonitorEntry stub for platforms without poll/select
323 - dynld_grub.c: stub findSharedSymbol (no GRUB symbol lookup API)
324 - brltty-ttb.c: guard linux/kd.h with !GRUB_RUNTIME
325 - charset_grub.c: add missing langinfo.h include
326
327 Build reaches the link stage; link failure is expected because GRUB
328 runtime symbols (grub_malloc, grub_free, etc.) are only available
329 when loaded as a GRUB module (.mod), not as a standalone executable.
330
331 Co-Authored-By: Claude Opus 4.6 <[email protected]>
332
333 commit c7bb92058bf4f732e0e5087a40fc3a8858eaf115
334 Author: Nicolas Pitre <[email protected]>
335 Date: Sat Mar 7 17:42:31 2026 -0500
336
337 Add GRUB system package with POSIX compatibility functions.
338
339 Create system_grub.c providing implementations of POSIX functions
340 that GRUB's freestanding environment lacks:
341
342 - getenv() wrapping grub_env_get() for BRLTTY_* configuration
343 - exit() mapping to grub_fatal()
344 - strdup(), strtok(), strerror() string functions
345 - qsort() and bsearch() for configuration file processing
346
347 Register system_package="grub" for the elf* host case in configure.ac.
348
349 Add corresponding function declarations and missing constants
350 (UINT16_MAX, ENOENT, ENOSYS) to the GRUB_RUNTIME block in prologue.h
351 so all BRLTTY source files see them.
352
353 Co-Authored-By: Claude Opus 4.6 <[email protected]>
354
355 commit 3256a56dc87af78d46b2473b88a7f0269da9ff7b
356 Author: Nicolas Pitre <[email protected]>
357 Date: Sat Mar 7 17:20:17 2026 -0500
358
359 Document GRUB environment variable support for BRLTTY configuration.
360
361 BRLTTY has three configuration methods: command line, brltty.conf, and
362 environment variables. All three can work under GRUB: command line via
363 grub_register_command, brltty.conf via grub_file_open, and environment
364 variables by mapping getenv() to grub_env_get(). The same BRLTTY_*
365 variable names are used (e.g. set BRLTTY_BRAILLE_DRIVER=hw in grub.cfg).
366
367 Co-Authored-By: Claude Opus 4.6 <[email protected]>
368
369 commit d5563d15e09e1d7939108690981e91c9e899d99d
370 Author: Nicolas Pitre <[email protected]>
371 Date: Sat Mar 7 17:15:45 2026 -0500
372
373 Add command registration and file access design for GRUB module.
374
375 Document that GRUB's insmod doesn't pass arguments to modules, so
376 BRLTTY registers a grub_register_command("brltty") that receives
377 argc/argv for configuration (e.g. "brltty -b hw -q -n" in grub.cfg).
378
379 Add Section 6 documenting how GRUB's file API (grub_file_open/read/
380 close) can be used to load brltty.conf, key tables, and text tables
381 from disk at boot time.
382
383 Update POSIX compatibility strategy to distinguish dead code paths
384 (compile out), GRUB-replaceable paths (wrap with grub_file_* API),
385 and linker stubs. Update remaining work list accordingly.
386
387 Co-Authored-By: Claude Opus 4.6 <[email protected]>
388
389 commit d8e901b2e18a0a7325e0787eab46dce861cc3277
390 Author: Nicolas Pitre <[email protected]>
391 Date: Fri Mar 6 22:01:42 2026 -0500
392
393 Update documentation and fix build for configured GRUB tree.
394
395 Update README.Grub to document that a configured GRUB source tree is
396 required (bootstrap + configure), add multi-platform build instructions,
397 and add autoconf to prerequisites.
398
399 Rewrite GRUB-Module-Design.md to reflect current implementation status,
400 document the freestanding POSIX compatibility issues found during the
401 first build attempt, and describe the resolution strategy.
402
403 Fix configure.ac include path ordering so -nostdinc comes before -isystem
404 and -I flags, add -I for GRUB root (for config.h), and fix posix_wrap
405 path. Fix cfg-grub to strip --with-grub-platform from configure args
406 and override CPP.
407
408 Co-Authored-By: Claude Opus 4.6 <[email protected]>
409
410 commit ac630eb1236f31588444485be06b3775a3da3a50
411 Author: Nicolas Pitre <[email protected]>
412 Date: Fri Mar 6 21:36:14 2026 -0500
413
414 Create GRUB header symlinks for correct architecture targeting.
415
416 GRUB headers use #include <grub/cpu/types.h> where "cpu" is a symlink
417 to the target architecture directory. This symlink is normally created
418 by GRUB's own configure, but since we only need the headers (not a full
419 GRUB build), cfg-grub now creates it based on the detected platform.
420 Also creates the grub/machine symlink for platform-specific headers,
421 and validates that grub-root exists before proceeding.
422
423 Co-Authored-By: Claude Opus 4.6 <[email protected]>
424
425 commit 062d6e61470273d78ce2cb008f61517f0bb80983
426 Author: Nicolas Pitre <[email protected]>
427 Date: Fri Mar 6 21:29:00 2026 -0500
428
429 Use native GCC toolchain for GRUB module builds.
430
431 GRUB itself uses the native system GCC with -m32 or -m64 rather than
432 a separate cross-compiler. Adapt cfg-grub to do the same:
433
434 - Auto-detect the installed GRUB platform (x86_64-efi, i386-pc, etc.)
435 from /boot/grub/ or allow override via --with-grub-platform=
436 - Use the native gcc with appropriate -m32/-m64 flag
437 - Override CC, LD, STRIP, RANLIB so autoconf doesn't look for
438 i386-elf-* prefixed cross tools
439 - Keep --host=i386-elf to trigger GRUB_RUNTIME detection in configure.ac
440 - Document prerequisites: just gcc and make, no cross-compiler needed
441
442 Co-Authored-By: Claude Opus 4.6 <[email protected]>
443
444 commit 0bda2a6c54a60b9b3db62c62eb4c92273850d605
445 Author: Nicolas Pitre <[email protected]>
446 Date: Fri Mar 6 21:20:52 2026 -0500
447
448 Fix cfg-grub to build drivers as internal (statically linked).
449
450 GRUB has no shared library loader, so all braille drivers must be
451 built-in. The previous configuration used --with-braille-driver=-lt,
452 -tt,-vd which excluded those three but left everything else as
453 external (.so), silently failing at runtime.
454
455 Changes:
456 - Add --enable-standalone-programs to prevent shared object loading
457 - List all USB/serial-capable braille drivers as internal, ending
458 with -all to exclude the rest (27 drivers included)
459 - Add --with-screen-driver=gb,-all to only build the Grub screen
460 driver as internal
461 - Exclude drivers that need unavailable dependencies: ba (BrlAPI),
462 lb (Libbraille), tt (curses), vd (video), xw (X11), lt (LogText)
463
464 Co-Authored-By: Claude Opus 4.6 <[email protected]>
465
466 commit 386cc9f704704ef7de18b54356830288e693e51e
467 Author: Nicolas Pitre <[email protected]>
468 Date: Fri Mar 6 21:16:25 2026 -0500
469
470 Integrate BRLTTY event loop into GRUB input polling.
471
472 Call brlttyWait(0) from the brltty_keys input terminal's getkey()
473 callback. This runs one non-blocking BRLTTY poll cycle each time
474 GRUB polls for keyboard input, which:
475
476 - Fires expired timer alarms (braille display refresh, keepalive)
477 - Processes pending USB I/O (reading braille key events)
478 - Updates the braille display with current screen contents
479
480 Without this, BRLTTY was never actually polled — the key injection
481 buffer existed but nothing drove the event loop to read from the
482 braille device or update the display.
483
484 Co-Authored-By: Claude Opus 4.6 <[email protected]>
485
486 commit e4f9e7806dba56ead08af784d874f8de9bcfccbf
487 Author: Nicolas Pitre <[email protected]>
488 Date: Fri Mar 6 21:09:25 2026 -0500
489
490 Add GRUB loadable module entry point and build rules.
491
492 Add grub_module.c with GRUB_MOD_INIT/GRUB_MOD_FINI hooks that call
493 brlttyConstruct()/brlttyDestruct() when the module is loaded/unloaded
494 via "insmod brltty".
495
496 Add Makefile rules for "brltty.module" (relocatable ELF linked with
497 -Wl,-r) and "brltty.mod" (post-processed with .modname/.moddeps
498 sections and stripped, matching GRUB's genmod.sh process).
499
500 This replaces the previous approach of building a standalone brltty
501 executable that had to be linked into GRUB at build time.
502
503 Co-Authored-By: Claude Opus 4.6 <[email protected]>
504
505 commit 5648e914a7b506c5837e8c30d97287df539a240e
506 Author: Nicolas Pitre <[email protected]>
507 Date: Fri Mar 6 20:57:44 2026 -0500
508
509 Implement GRUB screen driver with shadow terminal.
510
511 The GRUB screen driver intercepts terminal output by registering a
512 shadow grub_term_output that wraps the real terminal. All putchar,
513 gotoxy, cls, and setcolorstate calls are recorded into an in-memory
514 text buffer and forwarded to the original terminal unchanged.
515
516 BRLTTY reads screen contents from this shadow buffer via describe()
517 and readCharacters(). Key injection is supported through a
518 grub_term_input whose getkey() drains a ring buffer filled by
519 insertKey().
520
521 Co-Authored-By: Claude Opus 4.6 <[email protected]>
522
523 commit ca537503c271a5e719b84ee24272ade87a65a1f7
524 Author: Nicolas Pitre <[email protected]>
525 Date: Fri Mar 6 20:47:35 2026 -0500
526
527 Implement USB platform backend for GRUB.
528
529 Replace the stub functions in usb_grub.c with a real implementation
530 using GRUB's USB subsystem API. This enables all USB braille displays
531 that BRLTTY supports to work within the GRUB bootloader environment.
532
533 Key function mappings:
534 - usbFindDevice: grub_usb_iterate() for device enumeration
535 - usbSetConfiguration: grub_usb_set_configuration()
536 - usbControlTransfer: grub_usb_control_msg()
537 - usbReadEndpoint: grub_usb_bulk_read_extended() with timeout
538 - usbWriteEndpoint: grub_usb_bulk_write()
539 - usbClearHalt: grub_usb_clear_halt()
540
541 Functions without GRUB equivalents (usbDisableAutosuspend,
542 usbClaimInterface, usbReleaseInterface) return success as no-ops
543 since there is no power management or competing drivers in the
544 bootloader. Async I/O functions (usbSubmitRequest, usbReapResponse)
545 remain unsupported as BRLTTY uses synchronous polling in GRUB.
546
547 Co-Authored-By: Claude Opus 4.6 <[email protected]>
548
549 commit 52f8ddf6ee7bfd38a23f4b69d112c8db5926a281
550 Author: Nicolas Pitre <[email protected]>
551 Date: Fri Mar 6 20:43:34 2026 -0500
552
553 Add GRUB module documentation.
554
555 Add user-facing documentation (README.Grub) covering how to build,
556 install, and use BRLTTY as a loadable GRUB module for braille display
557 accessibility during the boot menu.
558
559 Add a detailed design document (GRUB-Module-Design.md) describing the
560 architecture: shadow terminal screen capture, USB backend mapping,
561 event loop integration, and phased implementation plan.
562
563 Co-Authored-By: Claude Opus 4.6 <[email protected]>
564