Linux MS DOS discussions
 help / color / mirror / Atom feed
From: Joe Henley <joehenley@kc.rr.com>
To: S Iremonger <exxsi@bath.ac.uk>
Cc: linux-msdos@vger.kernel.org
Subject: Re: Disk size
Date: Sun, 10 Oct 2004 10:49:06 -0500	[thread overview]
Message-ID: <416959F2.8010606@kc.rr.com> (raw)
In-Reply-To: <Pine.GSO.4.53.0410030014210.4799@amos.bath.ac.uk>

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 <exxsi@bath.ac.uk>
> 

  reply	other threads:[~2004-10-10 15:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-02 22:14 Disk size Joe Henley
2004-10-02 23:32 ` S Iremonger
2004-10-10 15:49   ` Joe Henley [this message]
2004-10-11 13:23     ` S Iremonger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=416959F2.8010606@kc.rr.com \
    --to=joehenley@kc.rr.com \
    --cc=exxsi@bath.ac.uk \
    --cc=linux-msdos@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox