What is BAR set to? Try replacing it with the actual port number to make sure the rest of the code is working properly.
Have you tried debugging this code with something like Bochs?
You are also supposed to check the status register and wait for the controller to tell you that the data is ready.
You need to step through this code, and you need to check your status registers to make sure the controller is ready to receive data.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
SpyderTL wrote:What is BAR set to? Try replacing it with the actual port number to make sure the rest of the code is working properly.
Have you tried debugging this code with something like Bochs?
You are also supposed to check the status register and wait for the controller to tell you that the data is ready.
You need to step through this code, and you need to check your status registers to make sure the controller is ready to receive data.
The BAR is the Base Address Reguister from PCI.
I've debugged my code but cannot find any error.
When I check the status register and the BSY clear and DRQ is set then I can and receive data.
The weird thing is that the same code above works only to read sectors(20h) or identify(ECh) Why my code only read sectors but don't write sectors?