[version] Kernel version and codename, shell uname cmd
This commit is contained in:
parent
26b3079578
commit
b2606ff706
19
kernel/include/version.h
Normal file
19
kernel/include/version.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
char * __kernel_name;
|
||||
char * __kernel_version_format;
|
||||
|
||||
int __kernel_version_major;
|
||||
int __kernel_version_minor;
|
||||
int __kernel_version_lower;
|
||||
|
||||
char * __kernel_version_suffix;
|
||||
char * __kernel_version_codename;
|
||||
|
||||
char * __kernel_arch;
|
||||
|
||||
char * __kernel_build_date;
|
||||
char * __kernel_build_time;
|
||||
|
||||
#endif
|
@ -25,6 +25,7 @@
|
||||
#include <tree.h>
|
||||
#include <process.h>
|
||||
#include <logging.h>
|
||||
#include <version.h>
|
||||
|
||||
struct {
|
||||
char path[1024];
|
||||
@ -462,6 +463,24 @@ uint32_t shell_cmd_mem(int argc, char * argv[]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t shell_cmd_uname(int argc, char *argv[]) {
|
||||
kprintf("Notice: This is as hell builtin. uname() is not implemented.\n");
|
||||
char version_number[1024];
|
||||
sprintf(version_number, __kernel_version_format,
|
||||
__kernel_version_major,
|
||||
__kernel_version_minor,
|
||||
__kernel_version_lower,
|
||||
__kernel_version_suffix);
|
||||
kprintf("%s %s %s %s %s %s\n",
|
||||
__kernel_name,
|
||||
version_number,
|
||||
__kernel_version_codename,
|
||||
__kernel_build_date,
|
||||
__kernel_build_time,
|
||||
__kernel_arch);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void install_commands() {
|
||||
shell_install_command("cd", shell_cmd_cd);
|
||||
shell_install_command("ls", shell_cmd_ls);
|
||||
@ -481,6 +500,7 @@ void install_commands() {
|
||||
shell_install_command("dmesg", shell_cmd_dmesg);
|
||||
shell_install_command("kill", shell_cmd_kill);
|
||||
shell_install_command("mem", shell_cmd_mem);
|
||||
shell_install_command("uname", shell_cmd_uname);
|
||||
}
|
||||
|
||||
void add_path_contents() {
|
||||
|
43
kernel/sys/version.c
Normal file
43
kernel/sys/version.c
Normal file
@ -0,0 +1,43 @@
|
||||
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
||||
*/
|
||||
|
||||
#include <version.h>
|
||||
|
||||
/* Kernel name. If you change this, you're not
|
||||
* my friend any more. */
|
||||
char * __kernel_name = "toaru";
|
||||
|
||||
/* This really shouldn't change, and if it does,
|
||||
* always ensure it still has the correct arguments
|
||||
* when used as a vsprintf() format. */
|
||||
char * __kernel_version_format = "%d.%d.%d-%s";
|
||||
|
||||
/* Version numbers X.Y.Z */
|
||||
int __kernel_version_major = 0;
|
||||
int __kernel_version_minor = 0;
|
||||
int __kernel_version_lower = 1;
|
||||
|
||||
/* Kernel build suffix, which doesn't necessarily
|
||||
* mean anything, but can be used to distinguish
|
||||
* between different features included while
|
||||
* building multiple kernels. */
|
||||
char * __kernel_version_suffix = "testing";
|
||||
|
||||
/* The release codename.
|
||||
*
|
||||
* History:
|
||||
* * 0.0.X have the codename "uiharu"
|
||||
* * 0.1.X will have the codename "saten"
|
||||
* * 1.0.X will have the codename "mikoto"
|
||||
*/
|
||||
char * __kernel_version_codename = "uiharu";
|
||||
|
||||
/* Build architecture (should probably not be
|
||||
* here as a string, but rather some sort of
|
||||
* preprocessor macro, or pulled from a script) */
|
||||
char * __kernel_arch = "i686";
|
||||
|
||||
/* Rebuild from clean to reset these. */
|
||||
char * __kernel_build_date = __DATE__;
|
||||
char * __kernel_build_time = __TIME__;
|
||||
|
Loading…
x
Reference in New Issue
Block a user