Download-Link: sourceforge.net/projects/grub4dosahcipatch
First many thanks to AHCI OSDev Wiki which helped me a lot to develop this patch. Keep in mind
that I am a noob when it comes down to coding and I need much assistance by code reuse. So try
not to laugh by looking at my sources. Better try to improve them!
The AHCI support can be enabled by using the additional grub menu command "ahci". We can set the
following parameters with the new command:
ahci --set-controller=CONTR --set-port=PORT [--showall] [--showselected]
Using this command searches PCI configuration space for all present AHCI controllers and
implemented ports. After setting this option every read to drive 0x80 with a block size of 32 MB
is redirected to the selected AHCI controller and port. This can speed up transfer rates if an
image file is mapped to RAM and may be loaded from an SSD. This option transfers a 32 MB block
per read command by using the ATA command READ DMA EXT. CONTR and PORT arguments start at zero,
where 0 corresponds to the 1st present AHCI controller / port found. If the option --showall is
used all AHCI controllers, ports and connected devices are displayed. If the option --showselected
is used the selected AHCI controller, port and connected device is displayed.
The AHCI support can be disabled during compile by using the configure command with the parameter
"--disable-ahci".
I increased the read block size from 8 MB to 32 MB, because this is the maximum data transfer size
we can get from an AHCI harddisk device at issuing one read command. This way we can read 65536
sectors at once. This patch was tested with a SSD connected to a SATA 300 motherboard. The normal
standard BIOS read took around 50 seconds when reading 3.5 GB to RAM with mem map. When using the
AHCI patch the same file from the same SSD was mapped to memory in around 12 seconds. I think SATA
600 should give even better results.
Pay attention that this AHCI addition is only useful if you load the images from SSD to RAM.
Loading a disk image directly or using a normal platter HDD does not increase the read speed much.
Use this patch with care on your own risk, there was no extensive testing!
Another note to the maintainers of the Grub4DOS project namely tinybit and chenall. If you think
the AHCI support is worth being implemented into the productive code, feel free to include it in
any future builds. I am not sure how many users have the need for an AHCI patch at all. Keep up
the good work on the loader!
Many thanks to all the developers and forum members of reboot pro for making it possible to boot
a full-sized Windows from RAM and harddisk image. WinvBlock and Firadisk are working like a charm!
Greets
Kai Schtrom
Edited by schtrom, 13 October 2013 - 07:18 AM.