Skip to content

Remove the GET_NUM_BOOT_DRIVES and GET_DRIVE_BOOT_CONFIG driver queries#190

Merged
Konamiman merged 3 commits intov3.0from
remove-drive-related-driver-queries
Jan 30, 2026
Merged

Remove the GET_NUM_BOOT_DRIVES and GET_DRIVE_BOOT_CONFIG driver queries#190
Konamiman merged 3 commits intov3.0from
remove-drive-related-driver-queries

Conversation

@Konamiman
Copy link
Owner

@Konamiman Konamiman commented Jan 30, 2026

The driver queries GET_NUM_BOOT_DRIVES and GET_DRIVE_BOOT_CONFIG were added as a workaround for the fact that in Nextor 2 it's not possible to tell apart a device that doesn't exist or one that exists but is removable and is currently offline (e.g. an empty SD card slot). In Nextor 3 this is no longer the case and thus these queries can now be removed. The driver shouldn't be concerned about how the OS maps its drives.

Remove support for these queries from the Nextor kernel and from
the Standalone ASCII 8, SunriseIDE and MFRSD drivers. From now on,
only the kernel can decide the drives configuration at boot time.
@Konamiman Konamiman added this to the v3.0.0 alpha 1 milestone Jan 30, 2026
@github-project-automation github-project-automation bot moved this to Backlog in Nextor 3 Jan 30, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

This PR removes the boot-time driver query interface for boot-drive configuration and count. It eliminates DRVQ_GET_NUM_BOOT_DRIVES and DRVQ_GET_DRIVE_BOOT_CONFIG constants from the driver protocol; simplifies boot-device discovery by removing driver-provided configuration flows; and updates constant values, driver handlers, and test utilities accordingly.

Changes

Cohort / File(s) Summary
Core Query Protocol
source/kernel/data.mac, source/tools/C/dos.h
Removed DRVQ_GET_NUM_BOOT_DRIVES and DRVQ_GET_DRIVE_BOOT_CONFIG constants; reassigned DRVQ_GET_MAX_DEVICE from 7 to 5.
Driver Query Implementations
source/kernel/drivers/MegaFlashRomSD/mfrsd.asm, source/kernel/drivers/SunriseIDE/driver.mac, source/kernel/drivers/StandaloneASCII8/driver.mac
Removed driver query dispatch branches for boot-drives and boot-config queries; eliminated NEXTOR2_DRV_CONFIG and related configuration routines; updated DRVQ_GET_MAX_DEVICE constant values across all driver implementations.
Boot-Time Partition Discovery
source/kernel/bank4/partit.mac
Removed complex boot-time driver-config interaction flows (ASK_DRIVE_CONFIG paths); simplified auto-driver assignment and boot-device enumeration; replaced driver-provided config queries with deterministic AUTO_ASSIGN approach.
Documentation
source/kernel/kvar.mac
Updated UD_RELATIVE_UNIT_NUMBER field comment to clarify scope is non-Nextor drivers only; removed reference to DRVQ_GET_DRIVE_BOOT_CONFIG.
Test Utilities
source/tools/C/drvtest.c
Removed DoGetDriveBootConfigQuery and DoGetNumberOfBootDrivesQuery function declarations; removed all test callsites and related invocations for boot-drives queries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • Remove driver queries for drive mapping #165: This PR directly implements removal of boot-time driver queries DRVQ_GET_NUM_BOOT_DRIVES and DRVQ_GET_DRIVE_BOOT_CONFIG and their associated driver-side handlers, addressing the core objective described in the issue.

Poem

Complexity melts like morning dew, 🐰
Two queries gone, the paths stayed true,
Boot devices now self-assign with grace,
Simpler code, a cleaner space. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the primary change: removal of two specific driver queries (GET_NUM_BOOT_DRIVES and GET_DRIVE_BOOT_CONFIG).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-drive-related-driver-queries

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@source/kernel/bank4/partit.mac`:
- Around line 389-393: Update the GDRIVER comment block in partit.mac: change
"The later may happen if" to "The latter may happen if" and correct any
misspelling of "partitions" in that same comment so it reads "partitions"
(ensure the two numbered bullets remain unchanged); target the GDRIVER comment
text near the existing numbered list to make the edits.

@Konamiman Konamiman merged commit ab542db into v3.0 Jan 30, 2026
1 of 2 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Nextor 3 Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant