From: Rugxulo <ru...@gm...> - 2024-08-21 08:22:45
|
Hi, On Mon, Aug 19, 2024 at 3:00 PM tom ehlert via Freedos-user <fre...@li...> wrote: > > > In particular, if you say it takes 30 secs., I would blindly hope a > > partition half that size would take only half as long to calculate. > Unlikely as the size of the FAT remains exactly the same. A FAT16 partition of 500 MB would still be limited to maximum 65536 files, right? > > I have some very small and simple ASM code that calculates free space > > (8086, int 21h 36h) and another (386, FAT32 with LFNs, int 21h 7303h). > > Feel free to ask for it (public domain). > > Wow. ASM code !! By Ruxulo!! > How do you think FreeCOM gets the free space on disk? Instead of relying on (or rebuilding) an entire shell, the simple code for this could be isolated and run (or modified) independently. > > But you're saying it's not the slow DIV instruction (to get decimal > > output) holding things up. If that were the holdup, you could just > > output hexadecimal (no slow DIV needed). > > ... should be able to deduce that it's not the time for the DIV instruction as this time > remains the exact same when it's done later a second time. But DIV is slow enough (or irrelevant?) that many RISC cpus don't include a hardware DIV instruction. So it is an actual slowdown that is, in many cases, not strictly needed. Right? * https://stanislavs.org/helppc/div.html " Clocks: 808x / 286 =============== reg8 80-90 / 14 reg16 144-162 / 22 mem8 (86-96)+EA / 17 mem16 (150-168)+EA / 25 " Lest anyone say that modern cpus don't care, the OP did in fact specifically mention 8086 hardware. DIV may be considered an acceptable slowdown, but it is a slowdown nonetheless. > > Doesn't FAT32 already keep the amount of free space stored somewhere? > No, And for a good reason. > DOS crashes regularily, with no opportunity to write back this number to the disk before shutting down. Maybe I'm thinking of backup boot sector (or some such). * https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#FS_Information_Sector "The 'FS Information Sector' was introduced in FAT32 for speeding up access times of certain operations (in particular, getting the amount of free space). It is located at a logical sector number specified in the FAT32 EBPB boot record at position 0x030 (usually logical sector 1, immediately after the boot record itself)." (N.B. The OP could not get FAT32 to work successfully.) |