Skip to content

[kernel] Add XMS support to ATA driver, fix ATA drive recognition #2352

Merged
ghaerr merged 12 commits intomasterfrom
atacf3
Jul 15, 2025
Merged

[kernel] Add XMS support to ATA driver, fix ATA drive recognition #2352
ghaerr merged 12 commits intomasterfrom
atacf3

Conversation

@ghaerr
Copy link
Copy Markdown
Owner

@ghaerr ghaerr commented Jul 12, 2025

The ATA-CF driver now supports compilation with CONFIG_FS_XMS enabled, in which case an extra copy is required from the ATA I/O port to a main memory buffer if the system buffer is in XMS. When XMS is disabled, no extra copy is performed.

XMS code only tested on QEMU; updated driver not tested on Solo/86.

Also fixes a CF card recognition problem seen in QEMU previously showing both CF cards present when not actually present. While rewriting the ATA driver function error return code to kernel standard, this problem went away. I think the issue was that the functions previously mixed returning a negative kernel error code, zero and ATA status register bits. The function return value numbers are now all kernel standard, returning negative numbers on errors, zero on success, and not returning status register bits.

It should be noted that block device drivers don't actually ever return any I/O error code to kernel upper layers or to the user, so the only usefulness in tracking I/O error numbers is for driver understanding and debugging.

Various repeated code throughout the driver was combined to reduce kernel code size (e.g. wait while busy, getting ATA status, etc).

@toncho11
Copy link
Copy Markdown
Contributor

Nice catch for the control port!

@ghaerr ghaerr merged commit 246c848 into master Jul 15, 2025
1 check passed
@ghaerr ghaerr deleted the atacf3 branch July 15, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants