From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Henley Subject: Re: Disk size Date: Sun, 10 Oct 2004 10:49:06 -0500 Sender: linux-msdos-owner@vger.kernel.org Message-ID: <416959F2.8010606@kc.rr.com> References: <415F284C.2030807@kc.rr.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: S Iremonger Cc: linux-msdos@vger.kernel.org Hi, Thanks for your reply. I have replied "in-line" below. I appreciate any help, or TSR, you can provide. Thanks! Joe Henley S Iremonger wrote: >>I have a DOS application which says there isn't room to write a file. I >>get an "Insufficient disk space on destination drive" message. In fact >>there is plenty --too much-- room. I suspect it's making a DOS call to >>see what free space is available, probably getting an answer which it >>translates to a negative number; and then won't write out the file. > > Probably this function:- > DOS 2+ - GET FREE DISK SPACE Yes, I think you are right. Interestingly, if I run "dir" at the (xdosemu) command line, I get back 2 Gig (2,147,450,880). So the freedos I'm using is OK. It's when I run my program that the problem occurs. I suspect they are using different calls. > > AH = 36h > DL = drive number (00h = default, 01h = A:, etc) > > Return: > AX = FFFFh if invalid drive else AX = sectors per cluster BX = number of > free clusters CX = bytes per sector DX = total clusters on drive > > Notes: Free space on drive in bytes is AX * BX * CX. Total space on drive > in bytes is AX * CX * DX. "lost clusters" are considered to be in use. > According to Dave Williams' MS-DOS reference, the value in DX is incorrect > for non-default drives after ASSIGN is run. This function does not return > proper results on CD-ROMs; use AX=4402h"CD-ROM" instead. (FAT32 drive) the > reported total and free space are limited to 2G-32K should they exceed > that value > > > The reason for such overflow could be various things. > If you sent me the execcutable with the problem, I might try to fix it for > you if you're lucky ;-). > > I should be able to make you a 'patch' TSR that loads in ram, and simply > limits the maximum number of clusters ever reported available to a > smaller value, I expect ;-). > I think the TSR would be the best approach. I have seen several similar problems/queries on the mailing list; the TSR would probably work best for all of them. > >>I had this issue years ago when I ran this DOS application program in >>OS/2. Now it's here in DOSEmu/Linux. Anyone know how to tell the >>DOSEmu session it has only X amount of space; where X is some number DOS >>can deal with? I still have the TSR program which fixed this in OS/2-DOS; it's named 2gigfix.com. I tried it but it won't run in xdosemu. I think I have the source for it, if it would be of help to you. > > More like a problem with the DOS program. > > You might do well diagnosis-wise, is as follows:- > > - run Dosemu as usual. > - Set the current working drive within freedos to the drive where you > are having the 'too much disk space' problem -- i.e. do "D:" or > similar. > - run "debug" (useful tool included with freedos and m$-dos). > - when Debug is running, '-' prompt will appear. > - type "a" (assemble) command, which should result a prompt > something like '????:0100'. > - type "mov ah,36" > - type "mov dl,00" > - type "int 21" > - type "int 3" > - press enter again (blank line, leave assemble mode, back to '-' prompt) > - type "g" (run code, which should stop at the "int 3" breakpoint) > [and will give a Register dump!!, which should be copied for us]. > - type "q" (quit debug) > > Then, please copy carefully the register dump that is shown. > I can see from that what kind of 'sane' (or 'insane') values are being > returned from that dos function under dosemu. > AX=0020 BX=FFFF CX=0400 DX=FFFF SP=FFFE BP=0000 SI=0000 DI=0000 DS=0795 ES=0795 SS=0795 CS=0795 IP=0107 NV UP DI PL NZ NA PO NC 0795:0107 BF4A59 MOV DI,594A > >>Joe Henley > > -S Iremonger >