kernel: Add a system for release names in uname(), call alpha releases "Mercury"
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-07-22 12:21:01 +02:00
parent 5110d740b8
commit 358493a7bc
Signed by: apio
GPG Key ID: B8A7D06E42258954
3 changed files with 11 additions and 2 deletions

View File

@ -6,6 +6,7 @@ set(CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_CROSSCOMPILING true)
project(Luna LANGUAGES C CXX ASM ASM_NASM VERSION 0.4.0)
set(LUNA_RELEASE_NAME "Mercury") # Name for alpha releases
set(LUNA_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(LUNA_BASE ${CMAKE_CURRENT_LIST_DIR}/base)

View File

@ -3,4 +3,12 @@
#define MOON_VERSION "@CMAKE_PROJECT_VERSION@"
#define MOON_VERSION_MAJOR "@CMAKE_PROJECT_VERSION_MAJOR@"
#define MOON_VERSION_MINOR "@CMAKE_PROJECT_VERSION_MINOR@"
#define MOON_VERSION_PATCH "@CMAKE_PROJECT_VERSION_PATCH@"
#define MOON_VERSION_PATCH "@CMAKE_PROJECT_VERSION_PATCH@"
#ifndef STRINGIZE_VALUE_OF
#define STRINGIZE(x) #x
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
#endif
#define MOON_RELEASE_NAME "@LUNA_RELEASE_NAME@"
#define MOON_RELEASE STRINGIZE_VALUE_OF(MOON_RELEASE_NAME) " " __DATE__ " " __TIME__

View File

@ -26,7 +26,7 @@ Result<u64> sys_uname(Registers*, SyscallArgs args)
strncpy(result.release, MOON_VERSION, _UTSNAME_LENGTH);
// FIXME: Hardcode this at build time instead of in code (should be the short commit hash).
strncpy(result.version, "alpha", _UTSNAME_LENGTH);
strncpy(result.version, MOON_RELEASE, _UTSNAME_LENGTH);
strncpy(result.machine, CPU::platform_string().chars(), _UTSNAME_LENGTH);