Image Map Image Map
Results 1 to 6 of 6

Thread: Disk operations, CP/M 2.2 vs CP/M 3

  1. #1
    Join Date
    Aug 2017
    Location
    New Mexico, USA
    Posts
    113

    Default Disk operations, CP/M 2.2 vs CP/M 3

    I recently acquired a batch of DiskOnModule (DOM) and upgraded my homebrew Z80 with DOM instead of compact flash. I'm curios about the performance difference between DOM and CF, so I made up three files each a megabyte in size and PIP them from one drive to another drive. With CP/M 2.2, CF took 103 seconds whereas DOM took 93 seconds. So with 3 megabytes read and 3 megabytes write, CF is 58Kbyte/s while DOM is 65Kbyte/s, about 10% improvement; hardly worth the trouble, really.

    Since I have CP/M3 on the same homebrew, I thought I tried it as well. I was shocked: PIP copy of 3 megabyte files is 21 seconds with DOM and 37 seconds with CF. That's 285KByte/s with DOM and 162KByte/s with CF. So why is CP/M 3 disk operation so much faster than CP/M 2.2?

    I looked into my CP/M2.2 BIOS, I did my own simple block/deblock and read/write files is with INIR and OTIR instruction. I'm inexperience with CP/M and they are simple BIOS routines. In CP/M 3, I didn't have to do blocking/deblocking, read/write files is using the same INIR and OTIR instructions. So the differences are CP/M 3's better file handling and their more efficient block/deblock algorithms. Really? 4.5 times better? That seems incredible.

    Bill

  2. #2
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    33,370
    Blog Entries
    18

    Default

    One huge thing.

    You're using CP/M 3, PIP which uses multi-sector I/O calls--which CP/M 2.2 doesn't have. In CP/M 2.2, you do I/O in 128-byte sectors, one at a time, regardless of the actual physical sector size of the medium.

    Try using CP/M 2.2 PIP on a CP/M 3 system (it should work) and let us know the results.

  3. #3

    Default

    As Chuck pointed out, the multi-sector count is a major improvement in this area. Can't say whether your CP/M 3 BIOS also lets the BDOS do sector blocking, but if it does then you get an additional advantage (with multi-sector count) as the full-sector I/Os will go directly to the user (PIP) buffer and bypass a lot of junk (extra copying) that's not needed on sequential I/O.
    - Doug

  4. #4

    Default

    Bill

    Thanks for the heads up on DOM's. I wasn't aware of them, 5mins later I have one on order, hopefully it will be the quick way for me to back up my aging hard drive

    Pete

  5. #5
    Join Date
    Aug 2017
    Location
    New Mexico, USA
    Posts
    113

    Default

    Quote Originally Posted by Chuck(G) View Post
    One huge thing.

    You're using CP/M 3, PIP which uses multi-sector I/O calls--which CP/M 2.2 doesn't have. In CP/M 2.2, you do I/O in 128-byte sectors, one at a time, regardless of the actual physical sector size of the medium.

    Try using CP/M 2.2 PIP on a CP/M 3 system (it should work) and let us know the results.
    I ran CP/M2.2's PIP in CP/M3 environment just as you've suggested. It takes 37 seconds to copy 3 megabyte files instead of 24 seconds using CPM3 PIP (the copy time seems to varies from 21-24 seconds, possibly due to wear leveling? 24 seconds seem the more consistent number). If you recall it took 93 seconds to PIP in CP/M2.2 environment, so CPM3 environment did speed up disk access significantly. This is a good way to demonstrate that running CP/M2.2 applications in CP/M 3 environment can also speed it up. Thank you, very interesting!

    Doug, In CP/M 3 BIOS I let it do all the blocking & deblocking so perhaps that's why CP/M 3 PIP is faster than CP/M 2.2 PIP running in CP/M 3 environment.

    Bill

  6. #6
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    33,370
    Blog Entries
    18

    Default

    There's also the issue of caching and read-ahead. I recall that Bill Godbout published a CP/M BIOS for one of his systems that read and wrote a track (at 1:1 interleave) at a time; i.e., there was a full track buffer for each drive. It seemed miraculous when it came down to speed.

    With CP/M 3 and multi-sector operation, I also believe that it's possible to DMA directly into the user's buffer.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •