MollenOS wrote:Please do tell me you are kidding? Would you also take an Advanced Mathematics course and then yell about nobody learned you how to do mathematics? You are not supposed to program an AHCI driver, or mess with the pci-bus, or even try do any hardware interaction if you don't show up with the neccessary background/knowledge or atleast show the willingness to learn it.
Even with that said, the PCI article tells you how to do it, it relies only on very very basic functions that you should have in your OS before even attempting to program an AHCI driver.
The PCI article might rely only on in/out functions derived from in/out processor instructions, but the AHCI article uses non-present constants and functions without blinking an eye. And it doesn't mention where they came from.
If I had a problem which would require enormous Math skills to solve I wouldn't go trying to solve a different easier problem, because that's not what I want. I don't really care about how anything revolving around AHCI works. I don't want to write drivers. They just got in my way and as though I'm trying to get rid of the problem the easier way possible.
zaval wrote:heh, I have 5000 pages manuals without even a hint on examples or guidelines how to use something. just a heap of inconsistent info. and oppositely sometimes a 300 pages document is as a fresh air breath. For example eMMC documentation, good for you, guys who wrote it!
I agree that trying to learn something by messing around such things like linux code is almost a torture, but this is the only thing you could do.
If you are affraid of assembly code, well, there is no pretty howto's on how to program AHCI, so you choose. It's very hard, poorly documented, but if you want to learn it, you go through it.
Arguing won't make the miracle of the excellent copy-paste ready thing uprise happen.
The main difference is that you probably need/want to understand such devices, but I don't really care about them. As I mentioned above they just got in my way. That was obviously expected since the very beginning, but I also assumed there would be some already written libraries for this these days.
iansjack wrote:With your current level of competence I wouldn't advise trying to run on real hardware. What's the point of doing so?
Stick with emulated hardware that you understand. In time you will come to understand how to program PCI devices, but you would be better off starting with a simpler, well documented device - for example, an e1000 NIC. I'm guessing that many people here learnt how to interact with PCI devices with just the information available on the Wiki plus the relevant manual.
Don't try to run before you can walk. If you have to ask for example code rather than general principles then you are still at the crawling stage.
What you've said makes no sense. First of all, it's meaningless to write an OS that runs solely in emulated environment, because it defeats the purpose of writing an OS in general.
Secondly, emulated hardware is the same as real hardware, it just so happened that the emulators use IDE for HDD which was convenient for me, but at that point in time I thought it would work on real hardware as well. It's not like I understand either one and I don't really plan to.
I have no idea what e1000 NIC is, but I most likely don't want/need to use it and therefore it would be a complete waste of time to try to do anything about it.
I'm not asking for example code, I'm asking for a library that solves this problem without me having to do anything.
SpyderTL wrote:PCI
wiki.osdev.org wrote:Configuration Space Access Mechanism #1
Two 32-bit I/O locations are used, the first location (0xCF8) is named CONFIG_ADDRESS, and the second (0xCFC) is called CONFIG_DATA. CONFIG_ADDRESS specifies the configuration address that is required to be accesses, while accesses to CONFIG_DATA will actually generate the configuration access and will transfer the data to or from the CONFIG_DATA register.
That is how you communicate with the PCI bus. Set 0xCF8 to the index you want to read, and then read the value from 0xCFC. The exact value to write to 0xCF8 will depend on which "slot" that your AHCI controller is connected to.
Yes, but what is "the configuration address that is required to be accesses"? Is that just a number indicating the index of the bus/device or is it some port or what?