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
+21
View File
@@ -99,4 +99,25 @@ namespace Montauk {
static int Sys_Kill(int pid) {
return Sched::KillProcess(pid);
}
static int Sys_SetUser(int pid, const char* name) {
if (name == nullptr) return -1;
auto* target = Sched::GetProcessByPid(pid);
if (target == nullptr) return -1;
int i = 0;
for (; i < 31 && name[i]; i++)
target->user[i] = name[i];
target->user[i] = '\0';
return 0;
}
static int Sys_GetUser(char* buf, uint64_t maxLen) {
auto* proc = Sched::GetCurrentProcessPtr();
if (proc == nullptr || buf == nullptr || maxLen == 0) return -1;
int i = 0;
for (; i < (int)maxLen - 1 && proc->user[i]; i++)
buf[i] = proc->user[i];
buf[i] = '\0';
return i;
}
};
+10
View File
@@ -178,6 +178,10 @@ namespace Montauk {
static constexpr uint64_t SYS_SETTZ = 90;
static constexpr uint64_t SYS_GETTZ = 91;
/* Process.hpp */
static constexpr uint64_t SYS_SETUSER = 92;
static constexpr uint64_t SYS_GETUSER = 93;
static constexpr int SOCK_TCP = 1;
static constexpr int SOCK_UDP = 2;
@@ -371,6 +375,12 @@ namespace Montauk {
char name[64];
};
struct ThermalInfo {
char name[32]; // short zone name (e.g. "THRM", "TZ00")
int32_t temperature; // tenths of degrees Celsius, or -1 if unavailable
uint32_t _pad;
};
// Stack frame pushed by SyscallEntry.asm
struct SyscallFrame {
uint64_t r15, r14, r13, r12, rbp, rbx; // callee-saved