Page 1 of 2
Hard Drive Driver
Posted: Sat Jul 26, 2008 2:31 am
by Omega
Hi. I just finished my LBA/PIO driven Hard Drive Driver part II (was DMA) and lo and behold the dang thing still errors on real hardware. It works brilliantly in VPC, even returns the bootsig (0x55 0xAA), but on real hardware it blows with error 51. So, I have been thinking and I think that the reason is due to my setup; I set my hdd up in the SATA fashion, not IDE. So my question is, do I need to do something special with my driver considering what I have just told you? thanks
Re: Hard Drive Driver
Posted: Sat Jul 26, 2008 2:38 am
by JamesM
I set my hdd up in the SATA fashion, not IDE
Come on man, give us the right information!
is your HDD SATA or IDE?!
Re: Hard Drive Driver
Posted: Sat Jul 26, 2008 2:45 am
by Omega
What are you talking about? I just told you it is SATA. lol
Re: Hard Drive Driver
Posted: Sat Jul 26, 2008 2:52 am
by JamesM
Hi. I just finished my LBA/PIO driven Hard Drive Driver part II (was DMA) and lo and behold the dang thing still errors on real hardware. It works brilliantly in VPC, even returns the bootsig (0x55 0xAA), but on real hardware it blows with error 51. So, I have been thinking and I think that the reason is due to my setup; I set my hdd up in the SATA fashion, not IDE. So my question is, do I need to do something special with my driver considering what I have just told you? thanks
I see SATA mentioned once and once only.
I set my hdd up in the SATA fashion, not IDE.
That means your set your hard disk up in the SATA fashion - i.e. you sent commands to it assuming it's SATA, not IDE.
Assuming that you meant what you didn't say, and that your HDD is indeed SATA, then you of course cannot communicate with it via the IDE controller. Your SATA controller will not only have a different command set but is not resident on the ISA bus, so you'll have to probe the PCI bus to obtain access to it.
Re: Hard Drive Driver
Posted: Sat Jul 26, 2008 2:53 am
by Omega
Got it. Much obliged sir.
EDIT: Oh, I see your confusion, you thought I meant HDD as in HARD DRIVE DRIVER when I meant HARD DISK DRIVE. My fault.
Re: Hard Drive Driver
Posted: Sat Jul 26, 2008 3:02 am
by Omega
One last question about this: Is there a standard way to ask the machine if the hard disk is SATA or IDE? I guess I could try to read the MBR and if it returns zero then it wouldn't be IDE I suppose, but I assume there is possibly a more standard way than that. Thanks.
Re: Hard Drive Driver
Posted: Sat Jul 26, 2008 3:09 am
by JamesM
Omega wrote:One last question about this: Is there a standard way to ask the machine if the hard disk is SATA or IDE? I guess I could try to read the MBR and if it returns zero then it wouldn't be IDE I suppose, but I assume there is possibly a more standard way than that. Thanks.
Yes - you won't be able to get a SATA drive to IDENTIFY. If you're using standard PIO you have access to four possible (IDE) disks - primary master, primary slave, secondary master, secondary slave. Those four are accessed by two ranges of ports corresponding to the two IDE controllers - primary and secondary.
You should be sending the ATA IDENTIFY command to each of these disks and seeing if they respond. Only IDE disks will be able to be enumerated like this. Your SATA disk is on a different bus under a different controller and won't respond.
Re: Hard Drive Driver
Posted: Sat Jul 26, 2008 3:14 am
by Omega
OK, I'll start doing some research, thank you.
Re: Hard Drive Driver
Posted: Sun Jul 27, 2008 1:21 am
by Omega
Hi JamesM. I have searched around and found the pci example geezer has on his site (which is back up temporarily right now) and I started playing with it and I successfully incorporated it into my kernel. I started testing it in my kernel and it works, but I am not sure what to do next. You said that I needed to probe the PCI controller to gain access to the SATA controller and in his example he does enumerate the available controllers. How from this can one gain access to the SATA controller? Thanks.
Re: Hard Drive Driver
Posted: Sun Jul 27, 2008 2:58 am
by JamesM
You should read
PCI. Once you have found the PCI config space entry for the SATA controller you will need to set up its BARs (if the BIOS hasn't done it for you), then read the SATA specification as to what to do next!
Re: Hard Drive Driver
Posted: Sun Jul 27, 2008 3:01 am
by Omega
JamesM: This may be considered pirating or whatever but do you happen to have a copy of the SATA specs as they aren't free and I couldn't find them posted anywhere. Thanks
Re: Hard Drive Driver
Posted: Sun Jul 27, 2008 3:35 am
by JamesM
I'm afraid I don't. I haven't implemented SATA as yet (my main test PC has both an IDE and a SATA drive, so I just use the IDE one).
I personally would never call distributing pay-per-view specifications piracy. (Obviously software is different).
Re: Hard Drive Driver
Posted: Sun Jul 27, 2008 4:12 am
by Omega
Just a suggestion. Maybe we could all (those interested) could pitch in to buy it and post it in the WIKI. I'd toss in a few bucks to help out. Otherwise, I'll keep looking, I bet it is lurking on the internet somewhere. If I find it I'll post a link. Thanks.
Re: Hard Drive Driver
Posted: Sun Jul 27, 2008 4:33 am
by Omega
Found it:
http://stuff.mit.edu/afs/sipb/user/fustflum/etcetera/
Look for:
serialata10a.ZIP
and
serialata10a.pdf
It is the old one spec 1.0. I haven't even looked at it yet but it was published in 2001 and II was published in 2002, so I hope it still has relevance.
Re: Hard Drive Driver
Posted: Sun Jul 27, 2008 12:34 pm
by bewing
If you had read
SATA, then you would know that even now there is not a relevant standard for SATA. There are three conflicting standards -- and you would have learned that info in less than one minute.
(And you can't post copyrighted material to the wiki.)