====== Bootloader Quality Of Life Improvements ====== * Student: Connor Bailey (connorbailey777@gmail.com) * Mentor: Warner Losh (imp@) ===== Project description ===== The main goal of this project is to improve overall bootloader quality of life and user experience. I quantify quality of life/user experience based on the idea that the "ideal" bootloader experience (for a large majority of users) is one where they boot/exit as quickly as possible. For example, if a cat walks over the keyboard at the wrong time, a plain "OK" prompt is more likely to make someone unfamiliar hit the reset button than type "autoboot". Like a solid number of quality of life snags, this has an easy fix, but there's many situations like it which all contribute to the greater problem. ===== Approach to solving the problem ===== Lots of hands-on testing and trying to break things. While the cat example is not very serious, it shows my general thought process. If there's a mistake which is easy to make, it should be easy to fix. ===== Deliverables ===== This list is not concrete, since I am expanding as I find more rough edges, however, the loader prompt changes are the core focus. Loader prompt: * Extending platform-specific key event to terminal escape translation * Building out a system to bind keys/terminal escapes to actions at the loader prompt * Providing a default set of bindings/actions for "vanilla" editing, such as home/end/left/right/delete * Providing an option set of bindings/actions for emacs style editing * Implementing actions for history manipulation * Implementing actions for command/directory manipulation * Better feedback for errors/invalid input * Maybe some form of Lua completion Everything else: * Arrow key navigation on splash screen * Command to re-enter splash screen from prompt (for accidental key-presses) * Hand-holding messages at "easy mistake" points. ===== Milestones ===== The schedule below has been updated to reflect this. * Week 1: Development environment setup, both UEFI and legacy BIOS along with investigation into a better way to work on this without rebooting for every change * Week 2: Detour through [[https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257018|Bug 257018]] * Week 3: Translating UEFI and BIOS key events into terminal escapes passed through the console * Week 4: Wire up conf files to assign keys to actions, parsing key/action pairs, potentially figure out a different syntax for mapping keys * Week 5: Implement left/right arrow, home/end, delete and such * Week 6: Phase 1 deadline * Week 7: Implement history keys and commands (investigate using pager for the actual ''%%history%%'' command) * Week 8-9: File completion * Week 10: Lua completion (only if nothing else needs attention, same for week 11) * Week 11: Flashing cursor * Week 11 ½: Final deadline ===== Test Plan ===== Generally, the only option is smoke-tests. "does the bootloader work" isn't a very complicated question, so my testing boils down to booting on as many VMs/configurations as possible. This testing is manual, but I expect I'll get sick of it and end up automating it at some point. ===== The Code ===== https://github.com/CloakerSmoker/freebsd-src/tree/loader-prompt-editing ===== Progress Reports ===== | Week 1/2 | https://lists.freebsd.org/archives/soc-status/2022-June/000008.html | | Week 3 | https://lists.freebsd.org/archives/soc-status/2022-July/000016.html | ===== Notes ===== Number of times I've forgotten DESTDIR= and accidentally "tested" changes on my host machine: 3. ===== Useful links ===== These are just links I find useful, not background info/related work. https://uefi.org/sites/default/files/resources/UEFI_Spec_2_9_2021_03_18.pdf https://www.amd.com/system/files/TechDocs/24593.pdf https://web.archive.org/web/20131102003141id_/http://download.intel.com/design/archives/wfm/downloads/pxespec.pdf