Mail Archives: djgpp/1997/03/19/19:26:43
> > bsize=32768
> > bfree=31249
> > bavail=31249
> > files=31249
> > ffree=31249
>
> Seems like a bug in NT DOS box (32768 * 31249 is NOT 2GB). In case
> you have motivation and time to investigate further, I attach below
> the source of `statfs' from the library; please see if the values
> returned in the registers by the call to Int 21h/AH=36h are indeed
> erroneous in the case of the hard drive (it might be that the values
> are OK, but the arithmetics makes them overflow).
I put in a printf statement in statfs.c and it reported
(when checking c:) that regs.x.cx = 512 and regs.x.ax = 64
> Btw, what does "CHKDSK C:" report on that DOS box? It should print the
> values of BSIZE, FILES and BFREE as above (it does for me on MSDOS machine
> with a 1GB disk). And df works for me on Windows 3.11 for a 1.9GB
> NFS-mounted disk.
chkdsk c: results in
Type of file system is NTFS
Warning! F parameter not specified
2096450 kilobytes total disk space
692377 kilobytes in 14321 user files
4330 kilobytes in 1516 indexes
26410 kilobytes in use by the system
4096 kilobytes occupied by the logfile
1373332 kilobytes available on disk
512 bytes in each allocation unit
4192901 total allocation units on disk
2746665 allocation units available on disk
> techniques fail on NT. If you could step into `getmntent' (I can send
> you the source if you don't have djlsr201.zip) and see what exactly
> goes wrong, I probably could figure out the solution. Sorry, I don't
I did not see getmnent in djlsr201.zip -- I must have my eyes checked.
Please send me the source and suggest an appropriate calling sequence.
int i,j;
> /* Fill in the structure */
> buf->f_bavail = regs.x.bx;
> buf->f_bfree = regs.x.bx;
> buf->f_blocks = regs.x.dx;
i = regs.x.cx; j = regs.x.ax;
printf("regs.x.cx = %d, regs.x.ax = %d\n",i,j);
> buf->f_bsize = regs.x.cx * regs.x.ax;
> buf->f_ffree = regs.x.bx;
> buf->f_files = regs.x.dx;
> buf->f_type = 0;
> buf->f_fsid[0] = drive_number;
> buf->f_fsid[1] = MOUNT_UFS;
> buf->f_magic = FS_MAGIC;
>
> return 0;
> }
- Raw text -