Re: [Freedos-devel] bug in freedos kernel int 21.1c invalid drive handling?

2009-01-24 Thread Christian Masloch
> As people might call this to find out whether a
> drive exists, FreeDOS should return the sectors/
> cluster as 255 as expected for invalid drives...

People might do, but it isn't reliable: redirected drives might return  
al=FFh as well.

> The bugfix would make sure AL=255 is returned
> for int 21.1c calls for an invalid drive, but
> for CX and DX and DS:BX I am not sure whether
> it is better to change or not to change them?
> What do the other DOSes or DOSish OSes return?

NTVDM 5.10 MS-DOS returns al=FFh and all other unchanged for invalid  
drives (as expected). Setting ds:bx unconditionally is a DOS-C bug (in  
inthndlr.c) that should be fixed. FatGetDrvData() returns a NULL pointer  
for invalid drives.

>> 4) Other diferencies are in CD/DVD roms and flashdisks.
>
> Yeah, what happens for CD/DVD is kind of random I guess...

I guess it depends on *CDEX, because DOS calls Int2F.110C for redirected  
drives.

Christian

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] bug in freedos kernel int 21.1c invalid drive handling?

2009-01-23 Thread Eric Auer

Hi Laaca, thanks for checking!

> ... FreeDOS, MSDOS 7.1, Windows98 and WindowsXP ...
> existing 3,5 floppy disks all give the same (correct) results only
> MSDOS gives wrong Total number of Sectors and Sectors per Cluster

As this is MS Win9x DOS 7, the wrong number is expected...

> 2) For existing hard disks all three give different value for
> Total Nr. of Sectors FD: 65525, MS: 65534, 98: 65526, XP: 15747

I assume you mean total number of clusters?

And I assume you measured on a FAT32 drive
which actually has more than 65536 clusters
which cannot be expressed as 16 bit number?

How many clusters does that drive have, for
example according to dosfsck -v X: or so?

> 3) Non existing drives: difference is in Sectors per Cluster:
> in FreeDOS: all output seems to be "undefined", in other OSes
> is all "undefined" except Sectors per Custer which seems to be
> always 255 (FFh)

As people might call this to find out whether a
drive exists, FreeDOS should return the sectors/
cluster as 255 as expected for invalid drives...

Trying with the FreeDOS 1.0 kernel 2036, I get:
AX, CX, DX, BP, SI, DI, ES, SS, SP unchanged
DS:BX 0:0, so I would not say "undefined". The
experiment was to fill values like 1234 in all
the registers to see what you get back later.

The bugfix would make sure AL=255 is returned
for int 21.1c calls for an invalid drive, but
for CX and DX and DS:BX I am not sure whether
it is better to change or not to change them?
What do the other DOSes or DOSish OSes return?

> 4) Other diferencies are in CD/DVD roms and flashdisks.

Yeah, what happens for CD/DVD is kind of random I guess...

Eric




--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] bug in freedos kernel int 21.1c invalid drive handling?

2009-01-23 Thread Christian Masloch
> 1) For existing 3,5 floppy disks all give the same (correct) results only
> MSDOS gives wrong Total number of Sectors and Sectors per Cluster

This bug of MS-DOS 7.10 is also documented in RBIL 61.


BTW, I think the other registers should not be changed when al is set to  
FFh regardless of what MS-DOS does.

Christian

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] bug in freedos kernel int 21.1c invalid drive handling?

2009-01-23 Thread Ladislav Lacina
Well, I did some testing in FreeDOS, MSDOS 7.1, Windows98 and WindowsXP

This function works in all these environment different. F
1) For existing 3,5 floppy disks all give the same (correct) results only
MSDOS gives wrong Total number of Sectors and Sectors per Cluster
2) For existing hard disks all three give different value for Total Number
of Sectors (FD: 65525, MS: 65534, 98: 65526, XP: 15747 (bullshit))
3) Non existing drives: difference is in Sectors per Cluster: in FreeDOS:
all output seems to be "undefined", in other OSes is all "undefined" except
Sectors per Custer which seems to be always 255 (FFh)
4) Other diferencies are in CD/DVD roms and flashdisks.

>From the above is shown that MS-DOS and WinXP give undoubtebly wrong
results. The output for non existing drives seems to be random except AL,
which was in all tested OSes except FreeDOS FFh. RBIL mentions it so maybe
it could be fixed, however I think that programmers just shouldn't call this
function for non existing disks and I even think this function shouldn't be
called at all.


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


[Freedos-devel] bug in freedos kernel int 21.1c invalid drive handling?

2009-01-23 Thread Eric Auer

Hi, I noticed that int 21 with ah=1c might return wrong
values for "invalid drive", can somebody check this? For
example: Is this a bug? When did we introduce it? What
do other DOSes do here...?

For invalid drives, I get: ds:bx=0:0 al=0 cx=400 dx=unchanged

I expect: al=ff, other values are not explained in RBIL

AL is sectors per cluster, CX is sector size, DX drive size
in clusters or -1 if above 64k, DS:BX points to media ID byte

Thanks for checking :-)

Eric


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel