anchor.diff:  
   ;; Commands.
   (defconstant +ata-command-read-sectors+ #x20)
  +(defconstant +ata-command-read-sectors-ext+ #x24)
   (defconstant +ata-command-read-dma+ #xC8)
   (defconstant +ata-command-read-dma-ext+ #x25)
   (defconstant +ata-command-write-sectors+ #x30)
  +(defconstant +ata-command-write-sectors-ext+ #x3A)
   (defconstant +ata-command-write-dma+ #xCA)
   (defconstant +ata-command-write-dma-ext+ #x35)
   (defconstant +ata-command-identify+ #xEC)
  
positive.code:            (funcall pio-fn controller device lba count mem-addr))))
    t)
  
  (defun ata-read-pio (controller device lba count mem-addr)
    (when (not (ata-issue-lba28-command device lba count +ata-command-read-sectors+))
      (return-from ata-read-pio (values nil :device-error)))
    (when (not (ata-pio-data-in device count mem-addr))
      (return-from ata-read-pio (values nil :device-error))))
  
  (defun ata-read-dma (controller device lba count phys-addr)
    (ata-configure-prdt controller phys-addr (* count 512) :read)
    (when (not (ata-issue-lba28-command device lba count +ata-command-read-dma+))
      (return-from ata-read-dma (values nil :device-error)))
    ;; Start DMA.
    ;; FIXME: Bochs has absurd timing requirements here. Needs to be *immediately* (tens of instructions)
  
negative.code:     (dotimes (i 256)
        (setf (svref buf i) (sys.int::io-port/16 (+ (ata-controller-command controller)
                                                    +ata-register-data+))))
      (let* ((supported-command-sets (svref buf 83))
             (lba48-capable (logbitp 10 supported-command-sets))
             (sector-size (if (and (logbitp 14 (svref buf 106))
                                   (not (logbitp 13 (svref buf 106))))
                              ;; Data in logical sector size field valid.
                              (logior (svref buf 117)
                                      (ash (svref buf 118) 16))
                              ;; Not valid, use 512. (TODO: PACKET devices? when was this field introduced?)
                              512))
             (sector-count (if lba48-capable
                               (logior (svref buf 100)
                                       (ash (svref buf 101) 16)
                                       (ash (svref buf 102) 32)
                                       (ash (svref buf 103) 48))
                               (logior (svref buf 60)
                                       (ash (svref buf 61) 16))))
             (device (make-ata-device :controller controller
                                      :channel channel
                                      :block-size sector-size
                                      :sector-count sector-count
                                      :lba48-capable lba48-capable)))
        (debug-print-line "Features (83): " supported-command-sets)
        (debug-print-line "Sector size: " sector-size)
        (debug-print-line "Sector count: " sector-count)
        (push-wired device *ata-devices*)
        (register-disk device (ata-device-sector-count device) (ata-device-block-size device) 256 'ata-read 'ata-write))))
  
  (defun ata-issue-lba28-command (device lba count command)
  