> to quote a 2018 FAT16 speed test example by Jack, copying a
> mix of files and directories of different sizes disk to disk:
very scientific precise wording;)
even COPY or XCOPY may make a huge difference

> Plain FreeDOS 65s
> With LBACACHE 61s adds a small cache
> With UIDE 51s adds UDMA and larger cache
> With UHDD 47s all the above plus read-ahead
> With XHDD 43s all the above plus I/O transfer overlap

> Plain MS DOS 6.22 39s
> With UIDE 30s adds UDMA and large cache
> With UHDD 27.5s all the above plus read-ahead
> With XHDD 26.5s all the above plus overlap

anyway, what bugs me most is that freedos is significant worse the
msdos. this motivated me to run some INTRSPY experiments. INTRSPY from
"Undocumented DOS 2nd edition" is a
utility to intercept interrupts, and report later how often this
interrupt was called with what parameters.

here is the report for

 COPY C:\kernel.sys C:\BLA

note: kernel.sys is a 46000 byte file. the copy was done on a
comletely empty (with exception of kernel.sys itself) disk



for a default kernel, using CHS addressing,


------------------------ Start of Report ----------------------

1302: Read 01 sctrs: drv 80, head 07, sctr 1A, trk 00 to 04A5:0000
2160: Canon c:kernel.sys ==>> C:\KERNEL.SYS
2160: Canon c:bla ==>> C:\BLA
2160: Canon c:bla ==>> C:\BLA
2160: Canon c:kernel.sys ==>> C:\KERNEL.SYS
1302: Read 01 sctrs: drv 80, head 01, sctr 02, trk 00 to 0483:000C
1303: Write 01 sctrs: drv 80, head 01, sctr 02, trk 00from 0483:000C
1303: Write 01 sctrs: drv 80, head 04, sctr 0E, trk 00from 0483:000C
1302: Read 06 sctrs: drv 80, head 07, sctr 3A, trk 00 to 2E46:0000
1302: Read 07 sctrs: drv 80, head 08, sctr 01, trk 00 to 2F06:0000
1302: Read 01 sctrs: drv 80, head 08, sctr 08, trk 00 to 00D9:0AB0
1302: Read 37 sctrs: drv 80, head 08, sctr 09, trk 00 to 3006:0000
1302: Read 15 sctrs: drv 80, head 09, sctr 01, trk 00 to 36E6:0000
1302: Read 01 sctrs: drv 80, head 09, sctr 16, trk 00 to 06B9:0000
1303: Write 0D sctrs: drv 80, head 09, sctr 24, trk 00from 2E46:0000
1303: Write 01 sctrs: drv 80, head 09, sctr 31, trk 00from 00D9:0AB0
1303: Write 0E sctrs: drv 80, head 09, sctr 32, trk 00from 3006:0000
1303: Write 3E sctrs: drv 80, head 0A, sctr 01, trk 00from 31C6:0000
1302: Read 01 sctrs: drv 80, head 0A, sctr 3F, trk 00 to 06B9:0000
1303: Write 01 sctrs: drv 80, head 01, sctr 02, trk 00from 0483:000C
1303: Write 01 sctrs: drv 80, head 04, sctr 0E, trk 00from 0483:000C
1303: Write 01 sctrs: drv 80, head 0A, sctr 3F, trk 00from 06B9:0000
1303: Write 01 sctrs: drv 80, head 07, sctr 1A, trk 00from 04A5:0000

------------------------- End of Report -----------------------

and a kernel with SYS CONFIG KERNEL.SYS FORCELBA=1


------------------------ Start of Report ----------------------

1342: read 1 sectors at 466 to 0676:0008
1342: read 1 sectors at 467 to 056C:0008
1342: read 1 sectors at 468 to 0441:0004
1342: read 1 sectors at 469 to 058D:000C
2160: Canon c:kernel.sys ==>> C:\KERNEL.SYS
2160: Canon c:bla ==>> C:\BLA
2160: Canon c:bla ==>> C:\BLA
2160: Canon c:kernel.sys ==>> C:\KERNEL.SYS
1342: read 1 sectors at 65 to 0697:000C         ; FAT
1343: write 1 sectors at 65 to 0697:000C
1343: write 1 sectors at 266 to 0697:000C       ;2nd FAT

1342: read 13 sectors at 1670 to 2E46:0000      ; read up to DMA boundary
1342: read 1 sectors at 1683 to 00D9:0AB0       ; read 1 sector to low memory
1342: read 76 sectors at 1684 to 3006:0000      ; read rest of read request
1342: read 1 sectors at 1760 to 05D0:0004       ; rest of file

1343: write 13 sectors at 2138 to 2E46:0000
1343: write 1 sectors at 2151 to 00D9:0AB0
1343: write 42 sectors at 2152 to 3006:0000     ; the kernel should try to
1343: write 4 sectors at 2286 to 3546:0000      ; find more consequtive
1343: write 8 sectors at 2374 to 35C6:0000      ; free sectors
1343: write 22 sectors at 2386 to 36C6:0000     ; even new files are
                                                ; fragmented.
1342: read 1 sectors at 2408 to 05D0:0004
1343: write 1 sectors at 65 to 0697:000C
1343: write 1 sectors at 266 to 0697:000C
1343: write 1 sectors at 2408 to 05D0:0004
1343: write 1 sectors at 469 to 058D:000C

------------------------- End of Report -----------------------

a) the kernel splits each READ/WRITE multiple on a DMA boundary which
is not necessary for (most) modern disks, and definitively not for
UDMA and friends.

b) in addition, the not-LBA kernel splits the transfer at track
boundaries, which is definitively not necessary

c) in addition, COPY/XCOPY could align their buffers not to cross dma
boundaries in the first place. but this leaves 4DOS, ZIP, RAR etc.
unfixed. this really should be done in the kernel.

the relevant extension to DISK.SCR is below

Tom


;   DISK.SCR
;   This script relates DOS disk calls to the hard disk
;   BIOS calls involved.
;
...

structure dap fields ;;disk address packet:    
    size (byte,dec)
    reserved (byte,dec)
    sectors (word,dec)
    buffer (dword,ptr)
    LBA    (dword,dec)

intercept 13h
    function 0 on_entry output "1300: Recalibrate drive " dl
    function 1 on_exit output "1301: Disk system status " al
    function 2
        on_entry
            if (dl == 80h) output "1302: Read " al " sctrs: drv " dl ", head " 
dh
                ", sctr " cl ", trk " ch
        on_exit if (cflag==1)
            sameline " - FAILED (" ah ")"
    function 3
        on_entry
            if (dh == 80h) output "1303: Write " al " sctrs: drv " dl ", head " 
dh
                ", sctr " cl ", trk " ch
        on_exit if (cflag==1)
            sameline " - FAILED (" ah ")"
    function 42h
        on_entry
            output "1342: read " (ds:si->dap.sectors) " sectors at " 
(ds:si->dap.LBA) " to "  (ds:si->dap.buffer)
        on_exit if (cflag==1)
            sameline " - FAILED (" ah ")"
    function 43h
        on_entry
            output "1343: write " (ds:si->dap.sectors) " sectors at " 
(ds:si->dap.LBA) " from "  (ds:si->dap.buffer)
        on_exit if (cflag==1)
            sameline " - FAILED (" ah ")"

;;run "%1 %2 %3 %4"
;;report













_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to