Compare commits

..

2 Commits

Author SHA1 Message Date
b3c478f19e
init: Make the log stream line-buffered
All checks were successful
continuous-integration/drone/push Build is passing
Looks like log output stopped showing after buffering was implemented, since the log was not flushed properly.
2023-07-24 11:54:49 +02:00
ad3f3bf4db
kernel: Log the release name and build date in the boot log 2023-07-24 11:48:01 +02:00
3 changed files with 6 additions and 5 deletions

View File

@ -328,13 +328,15 @@ int main()
umask(022);
g_init_log = fopen("/dev/uart0", "w+");
g_init_log = fopen("/dev/uart0", "w");
check(g_init_log);
setlinebuf(g_init_log);
fcntl(fileno(g_init_log), F_SETFD, FD_CLOEXEC);
set_hostname();
if (signal(SIGTERM, sigterm_handler) == SIG_ERR) do_log("[init] failed to register handler for SIGTERM");
if (signal(SIGQUIT, sigquit_handler) == SIG_ERR) do_log("[init] failed to register handler for SIGQUIT");
if (signal(SIGTERM, sigterm_handler) == SIG_ERR) do_log("[init] failed to register handler for SIGTERM\n");
if (signal(SIGQUIT, sigquit_handler) == SIG_ERR) do_log("[init] failed to register handler for SIGQUIT\n");
start_services();

View File

@ -32,7 +32,7 @@ void reap_thread()
[[noreturn]] void init()
{
kinfoln("Starting Moon %s, built on %s at %s", MOON_VERSION, __DATE__, __TIME__);
kinfoln("Starting Moon %s %s", MOON_VERSION, MOON_RELEASE);
// Default hostname if nobody from userspace changes it
set_host_name("moon"_sv);

View File

@ -25,7 +25,6 @@ Result<u64> sys_uname(Registers*, SyscallArgs args)
strncpy(result.nodename, s_hostname.chars(), _UTSNAME_LENGTH);
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, MOON_RELEASE, _UTSNAME_LENGTH);
strncpy(result.machine, CPU::platform_string().chars(), _UTSNAME_LENGTH);