feat: ACPI parsing improvements, username in process struct + syscalls

This commit is contained in:
2026-03-24 17:17:47 +01:00
parent f902ab48a1
commit 1542e80a3f
14 changed files with 176 additions and 43 deletions
+3
View File
@@ -546,6 +546,7 @@ static void handle_key(LoginState* ls, const Montauk::KeyEvent& key) {
// Spawn desktop with username
int pid = montauk::spawn("0:/os/desktop.elf", ls->username);
if (pid >= 0) {
montauk::setuser(pid, ls->username);
montauk::waitpid(pid);
}
// Desktop exited (logout) — clear session and fields
@@ -688,6 +689,7 @@ static void handle_mouse(LoginState* ls) {
if (try_login(ls)) {
int pid = montauk::spawn("0:/os/desktop.elf", ls->username);
if (pid >= 0) {
montauk::setuser(pid, ls->username);
montauk::waitpid(pid);
}
montauk::user::clear_session();
@@ -772,6 +774,7 @@ extern "C" void _start() {
// Launch desktop directly -- no login required
int pid = montauk::spawn("0:/os/desktop.elf", user);
if (pid >= 0) {
montauk::setuser(pid, user);
montauk::waitpid(pid);
}
// Desktop exited (reboot/shutdown expected in setup mode).
+8 -9
View File
@@ -9,15 +9,14 @@
#include <montauk/heap.h>
#include <montauk/config.h>
/*
Mar 24, 2026 - update to use getuser() syscall
*/
extern "C" void _start() {
auto doc = montauk::config::load("session");
const char* name = doc.get_string("session.username", "");
if (name[0]) {
montauk::print(name);
montauk::putchar('\n');
} else {
montauk::print("unknown\n");
}
doc.destroy();
char username[32] = { };
montauk::getuser((char*)&username, 32);
montauk::print((const char*)username);
montauk::print("\n");
montauk::exit(0);
}