Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

How to detect FreeDOS kernel from Turbo Pascal program? (Developers)

posted by Rugxulo Homepage, Usono, 19.01.2022, 00:57

> By the way, where is documented the INT21h/AX=33FFh?
> I am looking at the Ralf Brown's interrupt list and don't see it there...
>
> It is even not mentioned nowhere on the FreeDOS site, what is shame...

It's mentioned (at least by Eric) as far back as 2005:

"[Freedos-devel] re: re: VER /R" (2005-07-29)


So see the kernel sources:
VOID ASMCFUNC int21_syscall(iregs FAR * irp)
...
  switch (irp->AH)
...
    case 0x33:
      switch (irp->AL)
...
          /* set FreeDOS returned version for int 21.30 from BX */
        case 0xfc:             /* 0xfc ... 0xff are FreeDOS extensions */
          os_setver_major = irp->BL;
          os_setver_minor = irp->BH;
          break;
...
          /* Get DOS-C release string pointer                     */
        case 0xff:
          irp->DX = FP_SEG(os_release);
          irp->AX = FP_OFF(os_release);
      }
      break;
...


I had my own wimpy code from 2007, so clearly I learned it from somebody:


LANG OCTASM,0.1
org 100h use16 file_out \whatfdos.com
VER=33FFh
#Komenco   ax=VER int 21h jc Fino cmp ax,VER jz Fino
           ds=dx si=ax ax=1225h int 2Fh # lodsb int 29h loop <1
#Fino      ret

 

Complete thread:

Back to the forum
Board view  Mix view
22749 Postings in 2119 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum