Subversion Repositories SvarDOS

Rev

Rev 401 | Rev 431 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 401 Rev 421
-
 
1
/* This file is part of the SvarCOM project and is published under the terms
-
 
2
 * of the MIT license.
-
 
3
 *
-
 
4
 * Copyright (C) 2021 Mateusz Viste
-
 
5
 *
-
 
6
 * Permission is hereby granted, free of charge, to any person obtaining a
-
 
7
 * copy of this software and associated documentation files (the "Software"),
-
 
8
 * to deal in the Software without restriction, including without limitation
-
 
9
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-
 
10
 * and/or sell copies of the Software, and to permit persons to whom the
-
 
11
 * Software is furnished to do so, subject to the following conditions:
-
 
12
 *
-
 
13
 * The above copyright notice and this permission notice shall be included in
-
 
14
 * all copies or substantial portions of the Software.
-
 
15
 *
-
 
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-
 
17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-
 
18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-
 
19
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-
 
20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-
 
21
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-
 
22
 * DEALINGS IN THE SOFTWARE.
-
 
23
 */
-
 
24
 
1
/*
25
/*
2
 * ver
26
 * ver
3
 */
27
 */
4
 
28
 
5
#define PVER "2021.0"
29
#define PVER "2021.0"
6
 
30
 
7
static int cmd_ver(struct cmd_funcparam *p) {
31
static int cmd_ver(struct cmd_funcparam *p) {
8
  char *buff = p->BUFFER;
32
  char *buff = p->BUFFER;
9
  unsigned char maj = 0, min = 0;
33
  unsigned char maj = 0, min = 0;
10
 
34
 
11
  /* help screen */
35
  /* help screen */
12
  if (cmd_ishlp(p)) {
36
  if (cmd_ishlp(p)) {
13
    outputnl("Displays the DOS version.");
37
    outputnl("Displays the DOS version.");
14
    return(-1);
38
    return(-1);
15
  }
39
  }
16
 
40
 
17
  if (p->argc != 0) {
41
  if (p->argc != 0) {
18
    outputnl("Invalid parameter");
42
    outputnl("Invalid parameter");
19
    return(-1);
43
    return(-1);
20
  }
44
  }
21
 
45
 
22
  _asm {
46
  _asm {
23
    push ax
47
    push ax
24
    push bx
48
    push bx
25
    push cx
49
    push cx
26
    mov ah, 0x30   /* Get DOS version number */
50
    mov ah, 0x30   /* Get DOS version number */
27
    int 0x21       /* AL=maj_ver_num  AH=min_ver_num  BX,CX=OEM */
51
    int 0x21       /* AL=maj_ver_num  AH=min_ver_num  BX,CX=OEM */
28
    mov [maj], al
52
    mov [maj], al
29
    mov [min], ah
53
    mov [min], ah
30
    pop cx
54
    pop cx
31
    pop bx
55
    pop bx
32
    pop ax
56
    pop ax
33
  }
57
  }
34
 
58
 
35
  sprintf(buff, "DOS kernel version %u.%u", maj, min);
59
  sprintf(buff, "DOS kernel version %u.%u", maj, min);
36
 
60
 
37
  outputnl(buff);
61
  outputnl(buff);
38
  outputnl("SvarCOM shell ver " PVER);
62
  outputnl("SvarCOM shell ver " PVER);
39
  return(-1);
63
  return(-1);
40
}
64
}
41
 
65