Subversion Repositories SvarDOS

Rev

Rev 1071 | Rev 1080 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1071 Rev 1079
Line 29... Line 29...
29
#define PVER "2022.3"
29
#define PVER "2022.3"
30
#define COPYRDATE "2021-2022"
30
#define COPYRDATE "2021-2022"
31
 
31
 
32
static enum cmd_result cmd_ver(struct cmd_funcparam *p) {
32
static enum cmd_result cmd_ver(struct cmd_funcparam *p) {
33
  char *buff = p->BUFFER;
33
  char *buff = p->BUFFER;
34
  unsigned char rc = 0, maj = 0, min = 0, rev = 0, verflags = 0;
34
  unsigned char rc = 0, maj = 0, min = 0, truemaj = 0, truemin = 0, rev = 0, verflags = 0;
35
 
35
 
36
  /* help screen */
36
  /* help screen */
37
  if (cmd_ishlp(p)) {
37
  if (cmd_ishlp(p)) {
38
    nls_outputnl(20,0); /* "Displays the DOS version." */
38
    nls_outputnl(20,0); /* "Displays the DOS version." */
39
    outputnl("");
39
    outputnl("");
Line 103... Line 103...
103
 
103
 
104
  _asm {
104
  _asm {
105
    push ax
105
    push ax
106
    push bx
106
    push bx
107
    push cx
107
    push cx
-
 
108
    push dx
-
 
109
 
-
 
110
    /* get the "normal" (spoofable) DOS version */
108
    mov ah, 0x30  /* Get DOS version number (DOS 2+) */
111
    mov ah, 0x30  /* Get DOS version number (DOS 2+) */
109
    int 0x21      /* AL=maj_ver_num  AH=min_ver_num  BX,CX=OEM */
112
    int 0x21      /* AL=maj_ver_num  AH=min_ver_num  BX,CX=OEM */
110
    mov [maj], al
113
    mov [maj], al
111
    mov [min], ah
114
    mov [min], ah
112
    pop cx
-
 
113
    pop bx
-
 
114
    pop ax
-
 
115
  }
-
 
116
 
-
 
117
  sprintf(buff, svarlang_str(20,1), maj, min); /* "DOS kernel version %u.%u" */
-
 
118
  outputnl(buff);
-
 
119
 
-
 
120
  _asm {
-
 
121
    push ax
-
 
122
    push bx
-
 
123
    push dx
-
 
124
 
115
 
-
 
116
    /* get the "true" DOS version, along with a couple of extra data */
125
    mov ax, 0x3306 /* Get true DOS version number (DOS 5+) */
117
    mov ax, 0x3306 /* Get true DOS version number (DOS 5+) */
126
    int 0x21       /* AL=return_code  BL=maj_ver_num  BH=min_ver_num */
118
    int 0x21       /* AL=return_code  BL=maj_ver_num  BH=min_ver_num */
127
    mov [rc], al   /*   DL=revision  DH=kernel_memory_area */
119
    mov [rc], al   /* DL=revision  DH=kernel_memory_area */
128
    mov [maj], bl
120
    mov [truemaj], bl
129
    mov [min], bh
121
    mov [truemin], bh
130
    mov [rev], dl
122
    mov [rev], dl
131
    mov [verflags], dh
123
    mov [verflags], dh
132
 
124
 
133
    pop dx
125
    pop dx
-
 
126
    pop cx
134
    pop bx
127
    pop bx
135
    pop ax
128
    pop ax
136
  }
129
  }
137
 
130
 
138
  /* MS-DOS 2-4 return 0xff, DR DOS 5&6 return 0x01 */
131
  sprintf(buff, svarlang_str(20,1), maj, min); /* "DOS kernel version %u.%u" */
-
 
132
  output(buff);
139
  if ((rc != 255) && (rc != 1)) {
133
  if ((maj != truemaj) || (min != truemin)) {
-
 
134
    output(" (");
140
    sprintf(buff, svarlang_str(20,10), maj, min); /* "True version %u.%u" */
135
    sprintf(buff, svarlang_str(20,10), maj, min); /* "true ver xx.xx" */
141
    outputnl(buff);
136
    output(")");
-
 
137
  }
-
 
138
  outputnl("");
142
 
139
 
143
    sprintf(buff, svarlang_str(20,5), 'A' + rev); /* "Revision %c" */
140
  sprintf(buff, svarlang_str(20,5), 'A' + rev); /* "Revision %c" */
144
    outputnl(buff);
141
  outputnl(buff);
145
 
142
 
146
    {
143
  {
147
      const char *loc = svarlang_str(20,7);        /* "low memory" */
144
    const char *loc = svarlang_str(20,7);        /* "low memory" */
148
      if (verflags & 16) loc = svarlang_str(20,8); /* "HMA" */
145
    if (verflags & 16) loc = svarlang_str(20,8); /* "HMA" */
149
      if (verflags & 8) loc = svarlang_str(20,9);  /* "ROM" */
146
    if (verflags & 8) loc = svarlang_str(20,9);  /* "ROM" */
150
      sprintf(buff, svarlang_str(20,6), loc);      /* "DOS is in %s" */
147
    sprintf(buff, svarlang_str(20,6), loc);      /* "DOS is in %s" */
151
      outputnl(buff);
148
    outputnl(buff);
152
    }
-
 
153
  }
149
  }
154
 
150
 
155
  outputnl("");
151
  outputnl("");
156
  nls_output(20,2); /* "SvarCOM shell ver" */
152
  nls_output(20,2); /* "SvarCOM shell ver" */
157
  outputnl(" " PVER);
153
  outputnl(" " PVER);