Image Map Image Map
Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 48

Thread: Patch program for DIR free space calculation

  1. #21
    Join Date
    May 2009
    Location
    Connecticut
    Posts
    4,272
    Blog Entries
    1

    Default

    Quote Originally Posted by offensive_Jerk View Post
    What does dos 3.3 do differently that the speed is increased?
    DOS 3.3 and earlier DIR command does not calculate the total free space on disk.

  2. #22
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    5,859
    Blog Entries
    1

    Default

    That's not the only answer, though. DOS 3.3 and earlier only support FAT12, which is small enough that DOS caches it in memory. (FAT12 only supports 32MB partitions.) When FAT16 support was added in Compaq DOS 3.31 and MS-DOS/PC-DOS 4.0 to support up to 2G partitions, DOS couldn't cache it all in memory. It scans the FAT when it needs the value of free space, which is the part that takes time. Once DOS has that value, it updates it in memory with every file operation that occurs. Certain DOS calls (see above) can flush this value and DOS will need to scan the FAT to regenerate it.

    In other words, the pause is not limited to DIR. It's just that the first DIR is 99% of the scenarios where people notice the pause.
    Offering a bounty for:
    - The software "Overhead Express" (doesn't have to be original, can be a copy)
    - A working Sanyo MBC-775, Olivetti M24, or Logabax 1600
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

  3. #23
    Join Date
    May 2009
    Location
    Connecticut
    Posts
    4,272
    Blog Entries
    1

    Default

    FAT16 was added in DOS 3 to provide a 32MB partition with 512 byte sectors. DOS 3.31 up to DOS 6 just allowed multi-sector clusters. Multiplying a value by a constant won't increase duration.

    But with no calls for the free space value, total delays will be minimal. The change in DIR made calls for free space frequent. In earlier DOSes, the free space was part of what was returned in CHKDSK which everyone expected to be slow.

  4. #24
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    5,859
    Blog Entries
    1

    Default

    I stand corrected.

    In any case, my point to several posts up is that DIR is not the problem -- DOS is.

    I remember from tracing through the operation noting how small the code was; it was iterating through calls, obviously optimized for size over speed. It should be somewhat easy to rewrite that section for speed, assuming someone has a buildable source tree of DOS and don't mind a small size increase.
    Offering a bounty for:
    - The software "Overhead Express" (doesn't have to be original, can be a copy)
    - A working Sanyo MBC-775, Olivetti M24, or Logabax 1600
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

  5. #25

    Default

    Quote Originally Posted by Chuck(G) View Post
    Do you have a similar solution for FAT32 volumes in DOS? The FAT16 delay never really bothered me, but a 20GB partition in DOS 7 can really take some time.
    The simplest solution is to reduce the size of the FAT by increasing the cluster size. The downside is that it might lead to more disk space wasted as slack space.

    See this.
    Looking for a cache card for the "ICL ErgoPRO C4/66d V"

  6. #26
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    31,483
    Blog Entries
    20

    Default

    Quote Originally Posted by Krille View Post
    The simplest solution is to reduce the size of the FAT by increasing the cluster size. The downside is that it might lead to more disk space wasted as slack space.

    See this.
    But the whole point of FAT32 is to reduce the cluster size by increasing the number of clusters!

    I wonder if there's an NTFS driver for Win9x/DOS or if there's a DPMI32 version of DIR that can be used. I already use HXDOS for a lot of things.

  7. #27

    Default

    Quote Originally Posted by Chuck(G) View Post
    But the whole point of FAT32 is to reduce the cluster size by increasing the number of clusters!
    No it's not actually. It's for using larger drives, partitions and files. The default cluster size is just a compromise between speed and disk usage. You can reduce the cluster size to be just a single sector if you want. I did that once back in the day with a 6 GB Quantum Bigfoot drive. Those drives aren't exactly speedy to begin with so you can probably imagine the horror of using it that way.
    Looking for a cache card for the "ICL ErgoPRO C4/66d V"

  8. #28
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    31,483
    Blog Entries
    20

    Default

    Before FAT32, there were two principal ways to accommodate large partitions on DOS.

    The first was to use a network redirector to access a different filesystem. Low-level management of storage details was left to another system.

    In DOS 3.3 or so, you could patch things up such that a physical sector was some larger power of 2 and then use your own blocker/deblocker code to translate 512 byte sectors to larger ones. In any case, you're still limited to 65K or so allocation units, where a single cluster file could occupy many KB, even if it contained only a few bytes of information.

    FAT32 shrunk the cluster size back to something reasonable and put a limit of about 2**28 clusters on them, not 2**16. That Windows chooses one or the other doesn't mean that you can't have a 32MB FAT32 partition--you just don't gain anything because the FATs get much larger and wipe out some of the gains and the OS takes a hit on performance.

    There are better filesystems than FAT32, which is my point.

  9. #29

    Default

    Quote Originally Posted by Chuck(G) View Post
    There are better filesystems than FAT32, which is my point.
    Not for DOS 7, which is what you asked about.
    Looking for a cache card for the "ICL ErgoPRO C4/66d V"

  10. #30

    Default

    Quote Originally Posted by Trixter View Post
    In other words, the pause is not limited to DIR. It's just that the first DIR is 99% of the scenarios where people notice the pause.
    Yeah, and one such program that flushes the free-disk-space value is the Transcopy program for the Central Point Deluxe Option Board.
    Current systems owned by me:
    Vintage:IBM PC/XT submodel 087 ( 1983 ), [Kon]tiki-100 rev. C (1983), Compaq Portable I ( 1984 ), IBM PC/XT submodel 078 ( 1985 ), IBM PC/XT286 ( ~1986 ), 3x Nintendo Entertainement Systems ( 1987 ).
    Obsolete:Commodore A500 ( ~1990 ), IBM PS/2 model 70/386 type 8570-161 ( 1991 ), Atari Lynx II ( ~1992 ), Generic Intel 486SX PC ( ~1993 ), AT/T Globalyst Pentium w/FDIV bug MB ( 1994 ), Compaq 486DX4 laptop ( ~1995 ).

Tags for this Thread

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
  •