Support for SATA controllers in IDE mode#90
Draft
SamuelYvon wants to merge 49 commits into
Draft
Conversation
PCI detection of IDE controllers
… tagging that removes the important bits
SamuelYvon
marked this pull request as draft
August 21, 2020 18:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduction
Up until now, Mimosa only supported PATA drives (parallel ATA). This was mostly due to the fact that the driver would only use controllers located at the standardized addresses.
IDE controllers are available on the PCI bus: they can be detected and their configuration can be read from there. This allows us to support IDE controllers that are not located at the standard ports, but also support SATA controllers performing in IDE mode because they are not (in my experience) located at the standard addresses. Of course, the standards addresses are also supported.
SATA controllers worked in IDE compatibility mode before the introduction of AHCI, which we do not support. Most BIOSes will present the option of having the controllers operate in IDE mode, as it is a standard feature of these devices.
The C kernel will be able to detect and use these controllers to correctly load the Gambit image in memory. The Scheme kernel will also be able to interface those drives.
Quick list of changes (maybe incomplete?):
Remaining work to be done:
outl/inlbindings in Scheme are not correctly implemented (seelow-level.scm). Theoutlinstruction is acceptable, since it uses three parameters (high word of value, low word of value and port) and a single call. It would however be simpler to have a function in the ffi to support the 32 bits integers (tagging leaves 30 bits available). Theinlinstruction is implemented naively, by doing two(x86-inl)in different calls, to extract the high and low word. This is bad, since(x86-inl)is not very fast. This works to provide support for these functions, but this is something that needs to be fixed before merging. I ping @feeley for this feature, since I tried to get it working in the ffi, but I am unsure how to embed assembly inc-lambdas.