something weird to send identify coomand to SATA Controller

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
nerdboy69
Posts: 17
Joined: Wed Apr 23, 2014 1:41 am

something weird to send identify coomand to SATA Controller

Post by nerdboy69 »

Why when I try to send a identify command to a SATA Controller with this code:

Code: Select all

mov dx,BAR
mov ax,ech
add dx,7
out dx,ax
sub dx,7
mov cx,256
lea di,[buf]
rep insw
this code return the bytes ffh into the buf. Why?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: something weird to send identify coomand to SATA Control

Post by Combuster »

You are not using IDE controller code to program AHCI here? :shock:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
nerdboy69
Posts: 17
Joined: Wed Apr 23, 2014 1:41 am

Re: something weird to send identify coomand to SATA Control

Post by nerdboy69 »

Combuster wrote:You are not using IDE controller code to program AHCI here? :shock:
NO!
The controller is in AHCI mode and the BAR is thet true base address register of SATA Controller.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: something weird to send identify coomand to SATA Control

Post by sortie »

Is the problem that you are sending PATA commands to an AHCI device?
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: something weird to send identify coomand to SATA Control

Post by neon »

NO!
You seem to have a habit of not providing enough code or debugging information from your efforts and then resort to attacking the community for not helping and/or ignoring the help that you get. It would appear that you still have not learned from this.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Post Reply