Skip to content

ide: include WRITE_DMA_FUA_EXT in enlightened 48-bit LBA setup#3062

Open
juantian8seattle wants to merge 1 commit intomicrosoft:mainfrom
juantian8seattle:user/juantian/ide-fua-ext-48bit
Open

ide: include WRITE_DMA_FUA_EXT in enlightened 48-bit LBA setup#3062
juantian8seattle wants to merge 1 commit intomicrosoft:mainfrom
juantian8seattle:user/juantian/ide-fua-ext-48bit

Conversation

@juantian8seattle
Copy link
Contributor

The enlightened HDD path in enlightened_hdd_command() programs high LBA/sector-count registers only for READ_DMA_EXT and WRITE_DMA_EXT. WRITE_DMA_FUA_EXT (0x3D) is also a 48-bit command but was missing from the check, so its high LBA bytes would not be written to the drive registers -- the drive would use stale values.

Add WRITE_DMA_FUA_EXT to the 48-bit LBA branch condition.

Fixes #3061

The enlightened HDD path programs high LBA/sector-count registers
only for READ_DMA_EXT and WRITE_DMA_EXT. WRITE_DMA_FUA_EXT (0x3D) is
also a 48-bit command but was missing from the check, so its high LBA
bytes would not be written to the drive registers.

Add WRITE_DMA_FUA_EXT to the 48-bit LBA branch condition.
@juantian8seattle juantian8seattle added bug Something isn't working storage labels Mar 19, 2026
Copilot AI review requested due to automatic review settings March 19, 2026 04:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a correctness issue in the IDE enlightened INT13 HDD path by ensuring 48-bit LBA register programming also occurs for WRITE_DMA_FUA_EXT, preventing stale high-LBA / sector-count register values from being used during that command.

Changes:

  • Extend the 48-bit LBA command check in enlightened_hdd_command() to include WRITE_DMA_FUA_EXT.

You can also share your feedback on Copilot code review. Take the survey.

@juantian8seattle juantian8seattle marked this pull request as ready for review March 19, 2026 18:46
@juantian8seattle juantian8seattle requested review from a team as code owners March 19, 2026 18:46
@jstarks
Copy link
Member

jstarks commented Mar 19, 2026

Our BIOS never sends this command, does it?

Copy link
Member

@jstarks jstarks left a comment

Choose a reason for hiding this comment

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

see comment

@juantian8seattle
Copy link
Contributor Author

handle_command in hard_drive.rs already accepts FUA_EXT as a 48-bit DMA command (use_48bit_lba: true), and the enlightened path dispatches through it after setting up registers. So if FUA_EXT comes in via the enlightened port, handle_command reads the 48-bit register FIFOs -- but the enlightened path never wrote the high bytes into them. The drive gets stale register values.

This just makes the enlightened register setup consistent with what handle_command already expects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ide: enlightened INT13 path skips 48-bit LBA setup for WRITE_DMA_FUA_EXT

4 participants