Enable DMA by default in kernel for (S)ATA controllers. This is needed since some (S)ATA controllers doesn't work properly when DMA is not activated. When this happens, it prevents to start fossil, then DMA cannot be enabled from startup scripts. Also, it makes the first startup much faster when fossil do its initial dump to venti. An option "*nodma=" was added to plan9.ini to disable DMA if needed. This option is set in the installation plan9.ini, since the user is asked to enable or disable DMA at the beginning of the installation process. I considered it is preferable to enable DMA by default since most disk controllers are SATA these days and DMA is part of the specification. Also, most modern ATA controllers have been known to support DMA properly. Optionally, the bootsetup installation script could automatically add option "*nodma=" in installed plan9.ini when the user choose to disable DMA. Reference: /n/sources/patch/maybe/sdata-dma Date: Thu Apr 14 15:11:05 CES 2011 Signed-off-by: djc@9grid.fr --- /sys/src/9/pc/sdata.c Thu Apr 14 15:08:49 2011 +++ /sys/src/9/pc/sdata.c Thu Apr 14 15:08:43 2011 @@ -571,6 +571,9 @@ drive->dma |= 'U'<<16; } + if(getconf("*nodma") == nil) + drive->dmactl = drive->dma; + return dma; } --- /sys/man/8/plan9.ini Thu Apr 14 15:08:55 2011 +++ /sys/man/8/plan9.ini Thu Apr 14 15:08:51 2011 @@ -455,6 +455,8 @@ and .I slot to use as a root device for bootstrapping. +.SS \fL*nodma=\fP +Disable DMA on (S)ATA controllers. .SS AUDIO .SS \fLaudioX=value\fP This defines a sound interface. --- /sys/lib/dist/pc/plan9.ini Thu Apr 14 15:09:01 2011 +++ /sys/lib/dist/pc/plan9.ini Thu Apr 14 15:08:58 2011 @@ -10,6 +10,7 @@ # will defeat booting from usb devices. *nomp=1 *nobiosload=1 +*nodma=1 debugboot=1 # *noahciload=1 # *debugload=1 --- /sys/lib/dist/pc/plan9.ini.cd Thu Apr 14 15:09:05 2011 +++ /sys/lib/dist/pc/plan9.ini.cd Thu Apr 14 15:09:02 2011 @@ -10,6 +10,7 @@ # will defeat booting from usb devices. *nomp=1 *nobiosload=1 +*nodma=1 debugboot=1 # *noahciload=1 # *debugload=1 --- /sys/lib/dist/pc/plan9.ini.vmware Thu Apr 14 15:09:09 2011 +++ /sys/lib/dist/pc/plan9.ini.vmware Thu Apr 14 15:09:06 2011 @@ -4,6 +4,7 @@ # will defeat booting from usb devices. *nomp=1 *nobiosload=1 +*nodma=1 debugboot=1 # *noahciload=1 # *debugload=1 --- /sys/lib/dist/pc/inst/bootsetup Thu Apr 14 15:09:14 2011 +++ /sys/lib/dist/pc/inst/bootsetup Thu Apr 14 15:09:11 2011 @@ -42,6 +42,8 @@ echo 'mouseport='^$mouseport echo 'monitor='^$monitor echo 'vgasize='^$vgasize + if(! ~ $dmamode yes) + echo '*nodma=' } >/tmp/plan9.ini } if(! test -f /tmp/plan9ini.bak)