Jump to content

Porting a NF4 SATA Driver


37 posts in this topic

Recommended Posts

Well,I guess its high time we got SATA goin on NF4.Inspired by planetbeing,who ported the forcedeth driver,I have decided to try to port the SATA driver. I found sata_nv.c and it is quite a small script actually.. :):) .Nothin compared to forcedeth.But I am an absolute newbie at this and wud like some help from u guys.

 

I will upload the sata_nv for now.Have a look and continue this thread...

 

 

Edit:I have also uploaded the BSD driver (viaide.c).The name says ide but it supports both SATA and ide.

 

 

Cheers

Subramanyam

sata_nv.c.zip

viaide.c.zip

Link to comment
Share on other sites

  • 2 weeks later...

I sent you a PM on this so you don't need to reply to both if you see that. I just wanted it on the forum to see if anyone else can help as well

 

This is my computer:

 

AMD Opteron 146

EVGA nForce4 SLI Motherboard

EVGA 7800 GT VidCard

SATA Raptor 74 GB

SATA Raptor 150 GB (Windows on this)

SATA Seagate 300 GB (Data Drive)

 

I want to install Mac OSX on my 74 GB Raptor. It is completely empty and I formatted Fat32 so Mac OSX could see it. I boot up on the JaS 10.4.7 DVD from Demonoid, osx sees the drive, I format the drive and sometimes it will format for mac file system and then it can't mount - so it freezes. I restart and the drive will usually be mounted. I say usually because different things happen. I try to install and select the VIA SATA drivers but the install freezes usually 1/4 of the way through.

 

I saw the thread http://forum.insanelymac.com/index.php?showtopic=25879

 

Can I use that to somehow install OSX on my SATA? I have no IDE HD on this computer, only SATA. I am a complete n00b at doing this but I think if your driver works and I can get it loaded that I can get OSX installed on my computer. If you will please help me with this it would be much appreciated. Thanks.

Link to comment
Share on other sites

Jape. What about the Silicon Image controllers I'm hearing about? Someone said go get a 3112, but upon looking I can't find anyone who has done this really. Some say they have but nobody has told me how. I am willing to buy a PCI or PCI-e SATA card if it will work. Let me know please :)

Link to comment
Share on other sites

Jape. What about the Silicon Image controllers I'm hearing about? Someone said go get a 3112, but upon looking I can't find anyone who has done this really. Some say they have but nobody has told me how. I am willing to buy a PCI or PCI-e SATA card if it will work. Let me know please :)
I don't know anything about that card, sorry. (I don't plan to buy one either). There are some threads around here about that card already.

 

subramanyam: Which BSD you got that file from? I think there are some differences between different BSDs... FreeBSD, OpenBSD, PC-BSD...

Link to comment
Share on other sites

hey jape,

is there any way to directly port the netbsd driver to darwin, as darwin is also a BSD fork. If i try to build a kext in xcode using the viaide.c file as the source, it gives an error.. i tried meddling around with few functions and all, but no luck..

Link to comment
Share on other sites

Hey folks,

This is great news IMHO. i downloaded the AppleVIAATADriver.cpp and the AppleVIAATARoot.cpp files which are the sources of the VIA ATA/SATA Drivers in Darwin. I have mailed them 2 subramanyam, who will be uploading it soon. To get Nforce 4 SATA working, all we need is to add the additional Nforce 4 Timings to both (which I cant figure out from the viaide.c file, but I am sure someone like Jape will be able to), add the device ID’s and compile in Xcode. I know that the timings are present in distinct functions in both cpp files, but I am unable to figure out the timings themselves. This is the method which was suggested by many programmers who are a part of the Darwin Device Drivers mailing list. I found these cpp files at the opendarwin website. Hope we get working SATA soon, now that we know that we do not have to code a driver from scratch after all.

Link to comment
Share on other sites

Thanks a lot for comments! But I have bad news...

 

As you may check from the thread on my sig, I already modded the nForceATA kext to detect the nForce SATA. The nForceATA kext has got the nForce timings (1) on it, and it didn't work. These may be wrong, of course. As I told subramanyam, I dind't found the timings on the viaide.c, they must be somewhere else. (In the VIAATA kext, "timings" are multiple tables of integers (2), each table is a different ata mode, each row is a different pio/udma mode)

 

Even though I've read some docs about the IDE spec, I still don't really know what the timings are there for.

I've read in some places that timings are not really needed for SATA. In fact, the VIA ATA kext specifically disables (3) timings if the device is identified as a SATA controller. Also, the BSD's viaide.c function via_sata_chip_map which seems to handle sata controllers is way simpler than its via_chip_map PATA counterpart.

 

BTW, there's no real device id matching in VIAATA kext source. It is all done on the .plist file, unlike the nForceATA kext.

 

May I ask you where the Darwin Device Drivers mailing list archives are?

 

-----------------------------------------------------------------------

 

1: See file AppleOnboardPCATA/AppleNVIDIAnForceATA/AppleNVIDIAnForceATATiming.h

2: See file AppleVIAATA/AppleVIAATATiming.h

3: In file AppleVIAATA/AppleVIAATADriver.cpp

	786 void AppleVIAATADriver::programTimingRegisters( void )
787 {
788	 if (fProvider->getHardwareType() != VIA_HW_SATA)
789	 {
[Here timings are applied only if not SATA]
842	 }
843 
844	 dumpVIARegisters();
845 }

Link to comment
Share on other sites

I've seen the Karthik messages and their replies on that list, but no one says the reason is "timings are missing". Instead, they say what I know: that the problem we have shouldn't happen. (I was hoping there was another mailing list... non Apple hosted...)

 

Every friend (some of them are systems engineers) I've asked about this has answered that BSY forever is usually a controller's bug (some say it's a hard disk bug until I tell them it's a SATA disk. It seems SATA handles BSY differently than PATA, but driver implementations don't differ). Then I tell them it works under Windows, Linux & DOS. Then they tell me "that's weird". Then I'm alone again.

 

The Darwin source, although easy to read for a newbie because it's very structured, it's pretty difficult to understand what it really does because of high abstraction -- no one I know can catch the glimpse at first glance and no one I know is willing to study it ;)

Link to comment
Share on other sites

Jape. What about the Silicon Image controllers I'm hearing about? Someone said go get a 3112, but upon looking I can't find anyone who has done this really. Some say they have but nobody has told me how. I am willing to buy a PCI or PCI-e SATA card if it will work. Let me know please :angel:

 

Yes, the controller card with a 3112 chipset works using the VIAATA.kext! You have flash a new firmware to the card though. Instead of the RAID BIOS, you have to use the SATALink BIOS. You can download it at the Silicon Image website. Works well and is cheap!

Link to comment
Share on other sites

No driver needs to be ported until we find out the differeces between the already existing Darwin driver and every other driver in the world.

 

Starting typing right now would probably lead to another AppleVIAATA-like driver.

Link to comment
Share on other sites

Wait, how far can you people go with the installation with nForce 4 SATA? I installed it so far, but I'm getting an IOATA Controller device blocking bus error, and I'm trying to figure that out.

 

Can you guys get that far or do your SATA drives not work even before that?

Link to comment
Share on other sites

 Share

×
×
  • Create New...