# IDE HDD not detected in FreeBSD



## tcn (Nov 5, 2010)

Hi guys,

  I am rebuilding my low power home server using a Via motherboard.  The OS (FreeBSD duh?) sits on two USB microdrives.  I have another microdrive I'd like to add to the system, it is Compact Flash that is recognized as an IDE hard drive.

  The two USB drives are working A1; no problem at all.  The other one is just not detected.  The Bios detects it; FreeDOS can use it; FreeBSD bootloader sees it - anything that uses the BIOS sees it.  The kernel just won't see it.

  I am thinking that maybe this drive takes a bit more time to register itself to the controller.  Is there an adjustable timeout setting I can play with for ATA drives detection (like SCSI bus has)?  My two ATA controllers are there but empty.  The BIOS reports CF microdrive detected as a master on the second ATA controller, the first controller being SATA.


Thanks,

tcn


----------



## mav@ (Nov 5, 2010)

It would be nice if you reported your FreeBSD version and submitted full verbose dmesg showing the problem.


----------



## tcn (Nov 6, 2010)

Oh, sorry about that; I should have thought about this.

  Here is a verbose dmesg (sorry, had to zip it); it does show some timeout on ata1 (which is the interface where the unrecognized drive is connected to).


Thanks,

tcn


----------



## mav@ (Nov 6, 2010)

If you have fresh 8-STABLE, could you please try to comment in file ata-via.c line:

```
pci_write_config(parent, reg - 0x08,timings[ata_mode2idx(piomode)], 1);
```
and rebuild the kernel?


----------



## tcn (Nov 6, 2010)

Mav@,

  If by "comment in" you ment what I'm used to say "comment out", I did what you asked and commented the whole 
	
	



```
if ... pci_write_config
```
.  I am attaching the resulting dmesg.

  The HDD is still not recognized...


Thanks,

tcn


----------



## aragon (Nov 6, 2010)

Tip: Zipping text files makes life harder for the developer to read them.  Use a plain text file, and/or use Pastebin.


----------



## tcn (Nov 6, 2010)

A verbose dmesg is too large to be attached in any other format than zipped.

And pastebin; never heard, just read about it; nice thing, I'll use it next time!


----------



## tcn (Nov 8, 2010)

mav@,

  I have integrated your last patch on my 8-STABLE tree.  As I can see, you are the right guy to talk to for this problem.

  Maybe I can help you fix this issue (or at least understand what is happening).  As you already know, it's a VX800 chipset.  The FlashCard is connected to ata1 which is set to ATA66; ata0 will be used soon enough with SATA drives.

  I am ready to work myself on this issue; the problem is that I don't know much about IDE/ATA hdd and even less about FreeBSD driver programming.  If I can probe the ata1 bus manually in some way or just print out some more information in the logs to see what is happening.  You know more about what I can do to help.

  I'm not illiterate in regard to C code; I'm just not at a FreeBSD developper's level.  I write HDL code, not C code.....

  Anyway, let me know it I can be of any assistance.


thanks,

tcn


----------



## mav@ (Nov 8, 2010)

I have no access to VX800 board. I've recently tested some older VIA chipsets and they were working fine. I have no idea what can be wrong here. But there is chance that having remote access to the system may help.


----------

