Page 11 of 12

Re: AHCI

Posted: Tue Nov 02, 2021 8:52 pm
by punk_joker
#9231 added support up to 8 controllers.

I just hard coded memory for 8 controllers, like in IDE driver. I will replace it on dynamic allocate later.

Re: AHCI

Posted: Wed Nov 03, 2021 8:31 pm
by Leency
Wow, I remember your first commits in Eolite and now you add a support of 8 controllers in the SATA driver of Kernel. I am amazed! :o

Re: AHCI

Posted: Sun Nov 14, 2021 3:31 pm
by Doczom
После обновления #9231 не могу прочитать что-то из разделов кроме разде 2, в котором находится папка EFI, но и в этом разделе данные неверные(иногда пусто иногда какие-то странные надписи, похожие на данные из участков озу. После перезагрузки данные там меняются, прочесть содержимое этих файлов(директорий) невозможно ошибка 11, другие разделы пишут ошибку 9).

After update #9231, I can't read anything from the partitions except section 2, in which the EFI folder is located, but even in this section the data is incorrect (sometimes empty, sometimes some strange inscriptions similar to data from RAM sections. After a reboot, the data changes there, it is impossible to read the contents of these files (directories) error 11, other sections write error 9).

Re: AHCI

Posted: Sun Nov 14, 2021 3:44 pm
by rgimad
punk_joker wrote:#9219 use name sdX instead of hdX for AHCI SATA drives
Motivatios:
1. easier to understand drive is IDE or SATA.
2. fix issue: http://bugs.kolibrios.org/view.php?id=143
Это выглядит несколько костыльно, для CD/DVD дисков на AHCI контроллере теперь тоже новые имена наподобие scd придумывать?
Я уже примерно понял как это можно решить, сделать чтобы disk_add возвращала 0, если диск с таким именем уже есть.
Таким образом драйвер AHCI сможет понять этот момент и подобрать свободное имя для диска. Если получится, возможно так и сделаю.
P.S. Насчет пункта 1: AHCI драйвер может писать в доску отладки что такой-то порт добавлен как диск такой-то.
Тоже будет понятно, какие диски SATA.

Re: AHCI

Posted: Sun Nov 14, 2021 3:58 pm
by punk_joker
У нас уже есть разносе именованием для разных типов дисков.
hd - ide диски
bd - bios диски
tmp - RAM диски
Так-что sd вполне соответствует этой логике

Re: AHCI

Posted: Sun Nov 14, 2021 4:01 pm
by punk_joker
Doczom wrote: After update #9231, I can't read anything from the partitions except section 2, in which the EFI folder is located, but even in this section the data is incorrect (sometimes empty, sometimes some strange inscriptions similar to data from RAM sections. After a reboot, the data changes there, it is impossible to read the contents of these files (directories) error 11, other sections write error 9).
Send logs from board and pcidev

Re: AHCI

Posted: Sun Nov 14, 2021 4:04 pm
by rgimad
Oops, #9231 is TOTALLY broken. I run latest iso in qemu with two hard disks. (no matter one, two, etc. it doesnt work at all).
And see:
Spoiler:
Screenshot from 2021-11-14 16-02-11.png
Screenshot from 2021-11-14 16-02-11.png (221.75 KiB)
Viewed 5695 times
Before #9231 it worked normally.

Re: AHCI

Posted: Sun Nov 14, 2021 4:18 pm
by punk_joker
rgimad wrote:Oops, #9231 is TOTALLY broken. I run latest iso in qemu with two hard disks. (no matter one, two, etc. it doesnt work at all).
And see:
Spoiler:Screenshot from 2021-11-14 16-02-11.png
Before #9231 it worked normally.
Are you sure? I just tested on my qemu latest image, and it works well. Your disks have GPT or MBR? And send board log from real PC and Qemu. And how to you run Qemu?

Re: AHCI

Posted: Sun Nov 14, 2021 4:33 pm
by rgimad
punk_joker wrote:
rgimad wrote:Oops, #9231 is TOTALLY broken. I run latest iso in qemu with two hard disks. (no matter one, two, etc. it doesnt work at all).
And see:
Spoiler:Screenshot from 2021-11-14 16-02-11.png
Before #9231 it worked normally.
Are you sure? I just tested on my qemu latest image, and it works well. Your disks have GPT or MBR? And send board log from real PC and Qemu. And how to you run Qemu?
yes, builds before 9231 work well on my qemu, but >=9231 does not. I run:
Spoiler:qemu-system-i386 -m 256 -M q35 -cdrom kolibri.iso -boot d -vga vmware -net nic,model=rtl8139 -net user -soundhw ac97 -usb -usbdevice tablet -enable-kvm -drive file=fat:rw:. -drive file=fat:rw:two_hard
where two_hard is directory with some files

Re: AHCI

Posted: Sun Nov 14, 2021 4:38 pm
by rgimad
boardlog #9231 from qemu
Spoiler:
1.png
1.png (64.92 KiB)
Viewed 5682 times
2.png
2.png (67.16 KiB)
Viewed 5682 times
3.png
3.png (65.8 KiB)
Viewed 5682 times
4.png
4.png (55.52 KiB)
Viewed 5682 times

Re: AHCI

Posted: Sun Nov 14, 2021 4:39 pm
by rgimad
punk_joker wrote:У нас уже есть разносе именованием для разных типов дисков.
hd - ide диски
bd - bios диски
tmp - RAM диски
Так-что sd вполне соответствует этой логике
hd расшифровывается как hard disk, иначе было бы ided или что-то такое.
Жесткий диск независимо от режима работы (sata или ide) это жесткий диск. То же и с оптическими дисками.
А вот флешка например это совсем другой тип устройств, тогда логично usbhd, да.

Re: AHCI

Posted: Sun Nov 14, 2021 4:48 pm
by punk_joker
Checked. By default Qemu connect 2 disk to one AHCI controller. I tested in Qemu 1 disk per controller, the same configuration on my real PC. So, I think, I know where is a problem.

Re: AHCI

Posted: Mon Nov 15, 2021 2:37 pm
by rgimad
Your commit is very strange, for example in ahci_find_cmdslot, ahci_read, ahci_write why you use sd1_data (data of 1st ahci controller) ? It's incorrect, this functions are called not only for disks on 1st ahci controller. Also, uninformative naming: SD_DATA - it is not Sata Disk data, its data related to ahci controller.

I will fix and refactor these.

On issue from messages above: yes, driver fails when adding second disk on one controller.

Re: AHCI

Posted: Mon Nov 15, 2021 2:59 pm
by rgimad
#9270 fixed failure when adding > 1 disks on one controller

Re: AHCI

Posted: Mon Nov 15, 2021 5:04 pm
by punk_joker
rgimad wrote:#9270 fixed failure when adding > 1 disks on one controller
Great