ATA/ATAPI driver for GRUB 2

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.

One Response to “ATA/ATAPI driver for GRUB 2”

  1. rmh Says:

    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.

    I’m not sure if it’s really worthy to bother about that. I mean, propietary/legacy OSes want legacy, so let them live with their legacy cruft. Direct drivers in GRUB isn’t gonna help them anyway (e.g. if BIOS is buggy and cannot properly access the disk, Windows isn’t going to boot with it no matter what you do).

Leave a Reply

You must be logged in to post a comment.