2010-10-17 23:50:55 +04:00
|
|
|
|
|
|
|
|
|
int cmd_ver(char param[])
|
|
|
|
|
{
|
2013-02-17 19:22:51 +04:00
|
|
|
|
|
2010-10-21 08:37:59 +04:00
|
|
|
|
if (!strcmp(param, "kernel"))
|
|
|
|
|
{
|
|
|
|
|
char *kvbuf;
|
|
|
|
|
char *vA, *vB, *vC, *vD;
|
|
|
|
|
unsigned *Rev;
|
|
|
|
|
|
|
|
|
|
kvbuf = malloc(16);
|
|
|
|
|
kol_get_kernel_ver(kvbuf);
|
|
|
|
|
vA = kvbuf+0;
|
|
|
|
|
vB = kvbuf+1;
|
|
|
|
|
vC = kvbuf+2;
|
|
|
|
|
vD = kvbuf+3;
|
2017-01-02 01:28:50 +03:00
|
|
|
|
Rev = (unsigned*)(kvbuf + 5);
|
2010-10-21 08:37:59 +04:00
|
|
|
|
|
|
|
|
|
#if LANG_ENG
|
2013-02-16 15:25:37 +04:00
|
|
|
|
printf (" KolibriOS v%d.%d.%d.%d. Kernel SVN-rev.: %d\n\r", *vA, *vB, *vC, *vD, *Rev);
|
2010-10-21 08:37:59 +04:00
|
|
|
|
#elif LANG_RUS
|
2013-02-16 15:25:37 +04:00
|
|
|
|
printf (" KolibriOS v%d.%d.%d.%d. SVN-ॢ. <20><><EFBFBD><EFBFBD>: %d\n\r", *vA, *vB, *vC, *vD, *Rev);
|
2010-10-21 08:37:59 +04:00
|
|
|
|
#endif
|
2013-02-16 15:25:37 +04:00
|
|
|
|
|
2010-10-21 08:37:59 +04:00
|
|
|
|
free(kvbuf);
|
2013-02-16 15:25:37 +04:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
2010-10-21 08:37:59 +04:00
|
|
|
|
}
|
2013-02-16 15:25:37 +04:00
|
|
|
|
|
|
|
|
|
if (!strcmp(param, "cpu"))
|
|
|
|
|
{
|
|
|
|
|
unsigned a, b, c, d;
|
|
|
|
|
char str[13];
|
|
|
|
|
|
|
|
|
|
str[12] = '\0';
|
|
|
|
|
|
|
|
|
|
asm ("cpuid" :
|
|
|
|
|
"=a" (a),
|
|
|
|
|
"=b" (b),
|
|
|
|
|
"=c" (c),
|
|
|
|
|
"=d" (d):
|
|
|
|
|
"a"(0));
|
|
|
|
|
|
|
|
|
|
str[0] = (b&0x000000ff) >> 0;
|
|
|
|
|
str[1] = (b&0x0000ff00) >> 8;
|
|
|
|
|
str[2] = (b&0x00ff0000) >> 16;
|
|
|
|
|
str[3] = (b&0xff000000) >> 24;
|
|
|
|
|
|
|
|
|
|
str[4] = (d&0x000000ff) >> 0;
|
|
|
|
|
str[5] = (d&0x0000ff00) >> 8;
|
|
|
|
|
str[6] = (d&0x00ff0000) >> 16;
|
|
|
|
|
str[7] = (d&0xff000000) >> 24;
|
|
|
|
|
|
|
|
|
|
str[8] = (c&0x000000ff) >> 0;
|
|
|
|
|
str[9] = (c&0x0000ff00) >> 8;
|
|
|
|
|
str[10] = (c&0x00ff0000) >> 16;
|
|
|
|
|
str[11] = (c&0xff000000) >> 24;
|
|
|
|
|
|
|
|
|
|
printf("%s\n\r", str);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf (" Shell v%s\n\r", SHELL_VERSION);
|
2012-04-16 14:40:07 +04:00
|
|
|
|
return TRUE;
|
2010-10-17 23:50:55 +04:00
|
|
|
|
}
|
2013-02-17 19:22:51 +04:00
|
|
|
|
|