Last week I committed a patch to add support for ATA and ATAPI to GRUB 2. The ATA driver supports the CHS, ATA and ATA48 sector addressing methods. It should be capable of reading from and writing to every ATA harddisk. The ATAPI support is only capable of reading sectors from CDROM. I still have to add features like reading the sector count.
This driver will be especially useful for the LinuxBIOS port that has been recently committed. It can also be used to load something from CDROM when the BIOS doesn’t have CDROM support. Although I should further look into this, the only thing I have tested is loading files from CDROM.
There are several shortcomings in this driver. My driver and the one in the BIOS do not like each other. After my driver initializes, disk access from the BIOS might result in a crash. Therefore it disables biosdisk support. It also means that windows, for example, cannot be loaded using this driver because it later on accesses the disk via the BIOS interface. Perhaps this problem can be avoided by not resetting disks or storing the state somehow. I would appreciate it if someone can explain how I should do this properly so it will work on all systems.
Another shortcoming is its speed. For the moment it waits one tick, which is the shortest time GRUB can currently wait. One tick is 1/18th of a second, while it isn’t required to wait this long. Because of this, when the driver waits, it is wasting way too much time.