>>> - int 21.1c should report invalid drives via AL (keep other regs?)
>>>   News here: DR-DOS modifies BX/CX/DX but not DS for inv drives.

      /* Get Drive Data                                               */
    case 0x1c:
      {
        BYTE FAR *p;

        if (p = FatGetDrvData(lr.DL, &lr.AL, &lr.CX, &lr.DX) != NULL)
           {
           lr.DS = FP_SEG(p);
           lr.BX = FP_OFF(p);
           }
        else
           lr.AL = 0xff;
      }
      break;


should get the job done

> Unfortunately I do not know to what value DR DOS sets BX/CX/DX,
> only got the information that they looked kind of random...

MS-DOS is the king, and it lets all registers unchanged. more a DR-DOS
bug then anything else

> In any case AL has to be set to -1 to flag invalid drives :-)
right.



>>> - CHS calculations are off by 1 and overflowing (thanks Rayer)
>>>   If your BIOS has no LBA, this was probably a real pain for you.
>> 
>> any details about this ? like the original email ('thanks Rayer' is
>> not enough of a description)

> The discussion is spread over mail and chat,

but this is certainly in the kernel mailing list, isn't it ?



>>> - the BSS_INIT macro is bogus (thanks Rayer)
>> any details about this ? like the original email ('thanks Rayer' is
>> not enough of a description)

> Here is the relevant part of RayeR's kernel:

> diff -bur freedos/kernel/init-mod.h rayer/kernel/init-mod.h
> --- freedos/kernel/init-mod.h   2007-09-07 14:32:05.000000000 +0200
> +++ rayer/kernel/init-mod.h     2008-11-30 20:55:58.000000000 +0100
> @@ -32,8 +32,9 @@

>     These guys are marked BSS_INIT to mark that they really should be BSS
>     but can't be because of MS
> +   Seems to be needed also for Watcom C 11.x
>  */
> -#ifdef _MSC_VER
> +#if ((defined _MSC_VER) || (defined __WATCOMC__))
>  #define BSS_INIT(x) = x
>  #else
>  #define BSS_INIT(x)

> I personally would suggest to always have BSS_INIT(x) = x and
> not only for certain compilers. After all, the kernel is not
> a "normal program" so compiler-specific BSS clearing code is
> usually not triggered...

> Thanks for commenting :-)

some comment is necessary; introduction into the crazy memory model ;)

it shouldn't matter if

   int SomeVariable;
or
   int SomeVariable = 0;

is declared. in the former case it is put into the BSS segment, and
initialized by the runtime libray. As we don't have the normal runtime
library, we do it in main.c
     /* clear the Init BSS area (what normally the RTL does */
     memset(_ib_start, 0, _ib_end - _ib_start);

(I verified that this at least seems to do something reasonable)

in the latter case it is put into the DATA segment, and initialized
with static data.

in both cases the variable ends up as 0

if this makes any difference, either
  the memset() memset above doesn't work
or
  the error relates to the actual placement of the variable in the
  DATA segment. usually an overwriting problem or similar.

good luck hunting if it's the latter


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to