vers command

This commit is contained in:
Julian Barathieu 2019-05-18 23:19:49 +02:00
parent 10eb77656b
commit 8ba2a74937
3 changed files with 51 additions and 0 deletions

37
include/vers.h Normal file
View File

@ -0,0 +1,37 @@
//----------------------------------------------------------------------------//
// GNU GPL OS/K //
// //
// Desc: Kaleid version //
// //
// //
// Copyright © 2018-2019 The OS/K Team //
// //
// This file is part of OS/K. //
// //
// OS/K is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// any later version. //
// //
// OS/K is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY//without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with OS/K. If not, see <https://www.gnu.org/licenses/>. //
//----------------------------------------------------------------------------//
#ifndef _VERS_H
#define _VERS_H
//----------------------------------------------------------------------------//
#define _KALEID_VERSION "0.1-alpha"
#define _KALVERS_MAJOR 0
#define _KALVERS_MINOR 1
//----------------------------------------------------------------------------//
#endif

View File

@ -205,6 +205,18 @@ error_t CmdStackOverflow(int argc, char **argv, char *cmdline)
error_t CmdMemUsage(int argc, char **argv, char *cmdline); error_t CmdMemUsage(int argc, char **argv, char *cmdline);
error_t CmdVersion(int argc, char **argv, char *cmdline)
{
KernLog("OS/K, version %s (x86-64)\n", _KALEID_VERSION);
KernLog("Copyright (C) 2019 The OS/K Team.\n");
KernLog("License GPLv3+: GNU GPL version 3 "
"or later <http://gnu.org/licenses/gpl.html>\n");
KernLog("This is free software; you are "
"free to change and redistribute it.\n");
KernLog("There is NO WARRANTY, to the extent permitted by law.\n");
return EOK;
}
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
Command_t cmdtable[] = Command_t cmdtable[] =
@ -227,6 +239,7 @@ Command_t cmdtable[] =
{ "shell", CmdShell, "Start a new shell (nested)", }, { "shell", CmdShell, "Start a new shell (nested)", },
{ "stkov", CmdStackOverflow, "Provoke a stack overflow" }, { "stkov", CmdStackOverflow, "Provoke a stack overflow" },
{ "time", CmdTime, "Print time" }, { "time", CmdTime, "Print time" },
{ "vers", CmdVersion, "Version and legal infos" },
{ NULL, NULL, NULL } { NULL, NULL, NULL }
}; };

View File

@ -23,6 +23,7 @@
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
#include <asm.h> #include <asm.h>
#include <vers.h>
#include <lib/buf.h> #include <lib/buf.h>
#include <ex/argv.h> #include <ex/argv.h>
#include <init/boot.h> #include <init/boot.h>