Browse Source

+ obtain the msdos version on startup

git-svn-id: trunk@24574 -
nickysn 12 years ago
parent
commit
7628c87e44
2 changed files with 11 additions and 0 deletions
  1. 7 0
      rtl/msdos/prt0.asm
  2. 4 0
      rtl/msdos/system.pp

+ 7 - 0
rtl/msdos/prt0.asm

@@ -6,6 +6,7 @@
 
         extern PASCALMAIN
         extern dos_psp
+        extern dos_version
 
         extern _edata  ; defined by WLINK, indicates start of BSS
         extern _end    ; defined by WLINK, indicates end of BSS
@@ -42,6 +43,12 @@ no_bss:
         pop ax
         mov word [dos_psp], ax
 
+        ; get DOS version and save it in the pascal variable dos_version
+        mov ax, 3000h
+        int 21h
+        xchg al, ah
+        mov word [dos_version], ax
+
         ; allocate max heap
         ; TODO: also support user specified heap size
         ; try to resize our main DOS memory block until the end of the data segment

+ 4 - 0
rtl/msdos/system.pp

@@ -81,6 +81,9 @@ implementation
 const
   fCarry = 1;
 
+var
+  dos_version:Word;public name 'dos_version';
+
 {$I registers.inc}
 
 procedure Intr(IntNo: Byte; var Regs: Registers); external name 'FPC_INTR';
@@ -287,4 +290,5 @@ begin
 { Reset IO Error }
   InOutRes:=0;
   initvariantmanager;
+  Writeln(dos_version);
 end.