anchor.diff:    (ata-read-write device lba count mem-addr
                     :write #'ata-write-dma #'ata-write-pio))
   
  -(defun ata-issue-packet-command (device cdb result-buffer result-len)
  -  (ensure (eql (sys.int::simple-vector-length cdb)
  -               (atapi-device-cdb-size device)))
  -  (ensure (eql (rem result-len 4) 0))
  +(defun ata-submit-packet-command (device cdb result-len dma dmadir)
     (let* ((controller (atapi-device-controller device))
            (command-base (ata-controller-command controller)))
       ;; Select the device.
       (when (not (ata-select-device controller (atapi-device-channel device)))
         (debug-print-line "Could not select ata device.")
  -      (return-from ata-issue-packet-command nil))
  +      (return-from ata-submit-packet-command nil))
       (latch-reset (ata-controller-irq-latch controller))
       ;; HI3: Write_parameters
       (flet ((wr (reg val)
                (setf (sys.int::io-port/8 (+ command-base reg)) val)))
         (declare (dynamic-extent #'wr))
  +      (wr +ata-register-features+ (if dma
  +                                      (logior #b0001
  +                                              (ecase dmadir
  +                                                (:device-to-host #b0100)
  +                                                (:host-to-device #b0000)))
  +                                      #b0000))
         ;; Set maximum transfer size.
         (cond ((eql result-len 0)
                ;; Some devices use 0 to mean some other value, use a tiny result instead.
  
positive.code: 
  (defun ata-read-write (device lba count mem-addr what dma-fn pio-fn)
    (let ((controller (ata-device-controller device)))
      (assert (>= lba 0))
      (assert (>= count 0))
      (assert (<= (+ lba count) (ata-device-sector-count device)))
      (cond
        ((ata-device-lba48-capable device)
         (when (> count 65536)
  
negative.code:         (return-from ata-detect-packet-device))
        (let ((device (make-atapi-device :controller controller
                                         :channel channel
                                         :cdb-size cdb-size
                                         :initialized-p nil)))
          (push-wired device *atapi-devices*)
          (cdrom-initialize-device device cdb-size 'ata-issue-packet-command)
          (setf (atapi-device-initialized-p device) t)))))
  
  (defun ata-detect-drive (controller channel)
    (let ((buf (sys.int::make-simple-vector 256 :wired)))
  