FreeDOS version query

Alain <[email protected]> Tue, 12 Nov 2002 21:35:22 -0200
Newsgroups gmane.os.freedos.devel
Message-ID <[email protected]>
Hi,

I have a suggestion: 
Could FreeCOM display the Kernel version as well as it's own version?

Ralf wrote (long ago):
> As long as i can remember, FreeDOS returns an OEM version of 0FDh with the 
> Query DOS Version call....
and also:
> the kernel returns using int21h:
> AH=30h: 0fdh in BH ("OEM_ID"), CX=0101, bl=1ah (1.1.26), no
> subletters (CH=major, CL=minor).
> AX=33ffh: returns a pointer to the version string "FreeDOS kernel version
> ..." in DX:AX

NOTE that this information is not included in my version of RBIL, could
someone correct that, please?

So I have this little program that writes the Kernel version identification string ;-)
(Of course it would be smaller as a patch to FreeCOM)

Does everyone agree to add this to the kernel, to the VER command?

Alain
PS: How nice it is to have BC31-IDE running on FreeDOS !!! It does make
life nicer :))
PPS:  the string does NOT contain information about fat32 support. Bart,
don't you think this should be added? My suggestio: "(Build 2027rd/32)" as
this is the shortest string to fully identify a kernel.

/*---------------- FDVER.C --------------------*/
#include <stdio.h>
#include <string.h>
#include <dos.h>

void main(void)
{
  int i;
  char far *p;
  union REGS regs;

  regs.x.ax = 0x3000;
  int86(0x21, &regs, &regs);                  /* check oem-id              */
  if (regs.h.bh==0xfd){
    printf("FreeDOS detected: Int21/30 says bh=0fdh");
    printf(", version is %d.%d.%d",regs.h.ch,regs.h.cl,regs.h.bl);
    regs.x.ax = 0x33ff;
    int86(0x21, &regs, &regs);                /* get version string        */
    p = (char far*)MK_FP(regs.x.dx,regs.x.ax);
    if ( *(int far*)p == 0x7246)              /* fast string checking "Fr" */
      printf(", string is:\n %Fs",p);
  }else{
    printf("NOT FreeDOS: Int21/30 says bh=0%02xh",regs.h.bh&0xff);
  }
  printf("\n");
}
/*-------------------------------------------*/