# When trying to boot from ISO, FreeBSD dead-loops trying to detect ATA devices



## Snurg (Jan 18, 2021)

I am trying to install FreeBSD on the old computer I previously used as hardware tester.

However, after the boot menu it soon lands on the mountroot screen, instead of booting and starting the install.

There are constantly messages reporting some "CAM command timeout" failure with ATA_IDENTIFY and ATAPI_IDENTIFY coming from aprobe0:ahcich1 and aprobe1:ahcich2.
Apparently this is a deadloop of unsuccessful retrying all slots.

What I now do not understand:
The computer works flawlessly with all Linux and Windows versions I ran on it.
With these, there is not a single hint that something could be wrong or unusual.

I tried also older versions of FreeBSD down to 10.1, all show the same issue, so it seems a FreeBSD problem.

The board is a Gigabyte GA-MA78G-DS3H (specifications) with Phenom II 9850 X4 and 4GB RAM.
DVD drive is SATA (either TSST, LG or Samsung) and works fine.
HDD is a bugged HLFS WD Velociraptor 300 GB.
BIOS is reset to "failsafe settings".

Any idea what I could do to get FreeBSD boot?
Any special boot options, for example?


----------



## Speedy (Jan 18, 2021)

Are you sure your HDD controller is in AHCI mode?


----------



## Snurg (Jan 18, 2021)

Oops... didn't see "AHCI" option in the BIOS.
Maybe I overlooked them?
So, walking through every BIOS setting, I found the sata ports' "sata mode" set to IDE.
Now that I set them to AHCI, the system behavior gets really strange.

DVD drive is recognized according to the AHCI BIOS message which now appears after I switched from the "failsafe" IDE setting to AHCI.
But when I try to boot, it seems to skip the DVD and directly boot the HDD (with another OS) even though only the CD is enabled as boot device.

There is the option to set two of the higher sata ports to "IDE". I'll try that, but for this I will have to unplug all and get the screwdriver to move the DVD drive to such a port.
I'll report back...


----------



## Snurg (Jan 18, 2021)

So, I re-plugged the SATA cables so I could put the DVD drive on IDE mode.

Mixed success!

The DVD now boots  No mountroot screen 
But...

The message spam continues, and this spoils the blue dialog screens.
When trying to do an automated ZFS install, then a screen appears "No drives found" 

What am I doing wrong?
Or could there be a problem with the southbridge AMD SB700 which controls the SATA ports?

Any idea, any boot hints that could help here?


----------



## Snurg (Jan 18, 2021)

Inspired a bit by the Teutonian handbook I played around a bit with acpidump() and a verbose-boot dmesg() on the alt-F4-console.
It looks like that in dmesg, when the acpi() tables are being read, there are complaints about missing tables *LNKA*, *LNKB*, *LNKC* and *LNKD*.
When looking at the table using `acpidump -d` I see these these declared (?) as "external", "unknown".

I am not sure whether acpidump -t shows all tables; the wording in the man page does not indicate that the LNK? tables are missing just because of not being displayed.

Any idea whether that can be made work or do I have to get another mobo?


----------



## Speedy (Jan 18, 2021)

Can't you get rid of all IDE mode and boot from USB instead, ditch that PATA DVD drive. It sounds like any time something IDE is enabled the install can't cope with it. I may be wrong, not there watching over your shoulder. 

Edit: And another thing, some time CMOS gets corrupted, have you tried BIOS reset?


----------



## Snurg (Jan 19, 2021)

CMOS was cleared and set to "failsafe defaults".
Without setting the (SATA) DVD drive port to IDE mode, the ISO won't boot at all.
(My traditional install medium is CD/DVD, this guarantees that the data is unaltered.)
So I am out of ideas.

I have slept over the thing now.
This bad AML does not indicate quality work.
The BIOS is full of dubious overclocking options, and more details hinting at cheapo consumer crap.

I'll be in the city today.
If I don't find some suitable used PC cheap for testing my postinstaller, and no wizard appears with a magical solution, I'll repurpose my Windows PC which can run FreeBSD well, too...


----------



## Speedy (Jan 19, 2021)

You can write the very same ISO to USB, you may need to prep it like this.


----------

