Conversation
This menu allows to disable Nextor 3 kernels before they initialize, and also allows to simulate the pressing of various boot keys. Also define a mandatory "NXT3" signature at address 407Bh for all the NExtor 3 kernels.
The KABJ/KDERJ hooks act as intermediaries between the KBDOS error vectors and the KABR/KDERR handlers in bank 0, switching to bank 0 via CHGBNK so they work when bank 4 is paged in. Previously these hooks lived in ROM at matching addresses in banks 0 and 4 (dskab.mac), which forced the free area start from 7BD0h to 7E90h as the boot menu code grew. Moving the hooks to page 3 RAM eliminates the matching address requirement, restoring the full 1K free area at 7BD0h.
📝 WalkthroughWalkthroughAdds a new boot menu subsystem and message printer in bank 4, integrates menu invocation into the boot/init flow, moves disk-abort hooks to RAM templates, extends boot-time RAM layout and jump table entries, updates build rules, and adds design documentation. No behavioral changes outside the new boot-menu integration. Changes
Sequence Diagram(s)sequenceDiagram
participant Boot as Boot Flow
participant Init as Bank0 Init
participant Menu as Bank4 BOOT_MENU
participant Driver as Driver Query (CALDRV/CALSLT)
participant RAM as RAM (BOOTKEYS/A100h)
Boot->>Init: start INIT_SCREEN_AND_VERSION
Init->>Init: copy KABJ_HOOKS_TEMPLATE -> page3 RAM
Init->>RAM: check SCANKEYS_RAM_AVAILABLE?
alt RAM keys / menu enabled
Init->>Menu: C4PBK BOOT_MENU
Menu->>Menu: SCAN_SLOTS (detect kernels, signature)
Menu->>Driver: CALDRV / CALSLT for names/versions
Driver-->>Menu: driver info
Menu->>Menu: DISPLAY_MENU
Menu->>User: MENU_INPUT_LOOP (N/num/ENTER/ESC)
alt ENTER
Menu->>RAM: WRITE_RAM_KEYS (persist)
else ESC
Menu->>Menu: discard changes
end
Menu-->>Init: return (menu result)
else no RAM keys
Init->>Init: continue normal boot
end
Init->>Boot: continue kernel init (CALL_PRINT_KERNEL_MSG used)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.ai/PLAN.md:
- Around line 5-11: Fix the two typos in the design doc: replace the string
"bootin" with "booting" (occurs in the sentence about keys users can press while
booting) and replace "rigth" with "right" (occurs in the sentence introducing
"The Nextor boot menu"); update those exact words in the .ai/PLAN.md content so
the text reads "booting" and "right".
In `@source/kernel/bank0/init.mac`:
- Around line 867-877: When SCANKEYS_RAM_AVAILABLE returns Z (keys sourced from
RAM) the code jumps to AFTER_BOOT_MENU without initializing
ALL_KERNELS_DISABLED, which can leave it set from a prior boot; modify the boot
path so that when SCANKEYS_RAM_AVAILABLE yields Z you explicitly clear
ALL_KERNELS_DISABLED before jumping to AFTER_BOOT_MENU (i.e., insert the same
xor a / ld (ALL_KERNELS_DISABLED##),a sequence in the branch taken after
SCANKEYS_RAM_AVAILABLE) while preserving the existing N-key check (BOOTKEYS##+2
and subsequent SHOW_BOOT_MENU behavior).
In `@source/kernel/Makefile`:
- Around line 187-189: The StandaloneASCII8 make target creates a prefixed file
"_driver.bin" but then incorrectly passes the unprefixed "driver.bin" to
MKNEXROM; update the MKNEXROM invocation in the StandaloneASCII8 target to use
/d:drivers/StandaloneASCII8/_driver.bin (so MKNEXROM gets the 256-byte-prefixed
file) and keep the existing $(call copy_to_bin,$@) invocation unchanged;
reference symbols: MKNEXROM, $(call copy_to_bin,$@), and the StandaloneASCII8
driver filenames.
🧹 Nitpick comments (3)
.ai/SESSION.md (1)
43-50: Add a language specifier to the fenced code block.Static analysis flags this code block as missing a language identifier. Since this is pseudo-code describing an init flow, consider using
```textor similar..ai/PLAN.md (1)
13-35: Add a language specifier to the fenced code block.The code block at line 13 (the menu mockup) lacks a language identifier. Consider using
```text.source/kernel/bank4/bootmenu.mac (1)
1236-1239: Unnecessarypush de/pop dearoundld hl,STR_BOOT_MENU_SUFFIX.
ld hl,...doesn't clobber DE, so the push/pop is redundant.Suggested simplification
- push de ld hl,STR_BOOT_MENU_SUFFIX - pop de call COPY_STRING
This pull request implements a boot menu that's activated by pressing the N key during boot:
This menu shows:
The user can:
NEXBOOT.COMtool.The result of the changes made in the menu is stored as simulated keypresses in memory, exactly in the same way as the one-time boot keys mechanism does.
In order to enumerate all the Nextor kernels without initializing them, a scan is made for all the existing slots: those having the "AB" ROM signature at address 4000h and a new
NXT3signature at address 407Bh are considered Nextor 3 kernels.Additionally:
KABRandKDERJhooks are moved to page 3 RAM for improved ROM space usage.AI usage
The development of this feature has been assisted by an AI agent (Claude). For educational purposes, a transcript of the initial session with the agent is included in this pull request: