ReturnInfinity / BareMetal

A very minimal, resource efficient exo-kernel
http://www.returninfinity.com
MIT License
620 stars 89 forks source link

Public function for drive_id #42

Open IanSeyler opened 6 years ago

ghost commented 6 years ago

How about a function for getting the number of drives in the system?

ghost commented 6 years ago

@IanSeyler what do you mean drive ID? Would that be the device ID in the PCI register? Or an ID in the AHCI spec? What it be used for the b_disk_read and b_disk_write functions (instead of the drive index?)

IanSeyler commented 6 years ago

This would be the AHCI drive number (as in which SATA port the drive is connected to).

ghost commented 6 years ago

What if there are two AHCI controllers? The same port index could refer to two or more ports, depending on how many AHCI controllers there are.

IanSeyler commented 6 years ago

Right now the kernel only supports one AHCI device so currently that isn't an issue. However the driver and API will need to be adjusted for this in the future. Currently the AHCI driver stops looking for devices after the first one is found.

IanSeyler commented 6 years ago

This will be closed once #57 is complete.