Hello kd4d,

> I believe I have found a bug in FreeCOM's implementation of the
> DIR command.  This causes a Divide by zero error and forces a
> reboot.

thanks for reporting and analyzing. code below (between >>> and <<<) works 
better.

tom


  rootname[0] = toupper(*path);
  segread(&sr);
  sr.es = sr.ds;
  r.x.ax = 0x7303;
  r.x.dx = (unsigned)&rootname;
  r.x.di = (unsigned)&FAT32_Free_Space;
  r.x.cx = sizeof(FAT32_Free_Space);
  int86x(0x21, &r, &r,&sr);
  
  if (!r.x.cflag && r.h.al != 0)
        {
        clustersize = FAT32_Free_Space.sectors_per_cluster * 
FAT32_Free_Space.bytes_per_sector;
        
        if (clustersize)
          if (FAT32_Free_Space.free_clusters >= 0x80000000l / clustersize)
                {
>>>
                int shift;
                
                for (shift = 21; --shift;)
                        {
                        if ((clustersize & 1) == 0) clustersize >>= 1;
                        else                        
FAT32_Free_Space.free_clusters >>= 1;
                        }
                
                convert(FAT32_Free_Space.free_clusters * clustersize, buffer);
<<<
                strcat(buffer, " Mega");
                goto output;
                }
        }  

> This renders NTFS4DOS difficult to use on many modern
> computers.

> Mark













> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Freedos-devel mailing list
> Freedos-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freedos-devel


Mit freundlichen Grüßen / Kind regards,
Tom Ehlert
mailto:[EMAIL PROTECTED]
+49-241-79886



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to