I am creating this topic for users who are interested in this project and want to share their progress.
My progress:
I’ve looked at the FreeBSD source and found:
-
sys/dev/ata/*: Contains the ATA driver to interact with ATA or SATA controllers.
-
sys/dev/ata/chipsets/*: Contains drivers for SATA and PATA chipsets.
When I run FreeBSD with QEMU and specify a SATA disk with these flags:
-device ich9-ahci,id=ahci \
-drive file=img.qcow2,if=none,id=disk1,format=qcow2 \
-device ide-hd,bus=ahci.0,drive=disk1
It shows as an Intel ICH9 SATA AHCI controller. Therefore, it would be reasonable to first port the chipset that QEMU emulates, i.e., chipsets/ata-intel.c.
-
sys/cam/ata/*: Contains logic for auto-detecting and redirecting I/O requests for PATA and SATA.
-
sys/dev/ahci/*: Driver for the AHCI controller (required by SATA).
The above drivers require other components of FreeBSD, like PCI and FDT drivers (which, thankfully, RTEMS already has ported).
I do have to look more into how I am supposed to import the code into RTEMS and handle licensing-related matters.
I have a few questions for the mentors:
-
What exactly do you mean by “rules for modifications” in the description of the issue?
-
What should the minimum deliverables be at the end of the project? I am thinking of porting the code and writing some sample programs for RTEMS. I would like to know if there is anything else you expect.
Project Issue Link: Add SATA support in libbsd (#48) · Issues · RTEMS / Programs / Google Summer of Code · GitLab