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
+10
View File
@@ -120,6 +120,10 @@ namespace Montauk {
static constexpr uint64_t SYS_SETTZ = 90;
static constexpr uint64_t SYS_GETTZ = 91;
// User management
static constexpr uint64_t SYS_SETUSER = 92;
static constexpr uint64_t SYS_GETUSER = 93;
// Audio control commands (for SYS_AUDIOCTL)
static constexpr int AUDIO_CTL_SET_VOLUME = 0;
static constexpr int AUDIO_CTL_GET_VOLUME = 1;
@@ -306,6 +310,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;
};
struct ProcInfo {
int32_t pid;
int32_t parentPid;
+8
View File
@@ -120,6 +120,7 @@ struct DesktopState {
SvgIcon icon_procmgr;
SvgIcon icon_mandelbrot;
SvgIcon icon_volume;
SvgIcon icon_temperature;
// External apps discovered from 0:/apps/ manifests
ExternalApp external_apps[MAX_EXTERNAL_APPS];
@@ -141,6 +142,13 @@ struct DesktopState {
bool vol_dragging; // slider drag in progress
uint64_t vol_last_poll;
// Temperature monitoring
static constexpr int MAX_THERMAL_ZONES = 8;
Montauk::ThermalInfo thermal_zones[MAX_THERMAL_ZONES];
int thermal_zone_count;
uint64_t thermal_last_poll;
Rect temp_icon_rect;
int screen_w, screen_h;
// IDs of external windows we've sent a close event to but that haven't
+8
View File
@@ -402,6 +402,14 @@ namespace montauk {
// Kernel introspection
inline void memstats(Montauk::MemStats* out) { syscall1(Montauk::SYS_MEMSTATS, (uint64_t)out); }
// User management
inline int setuser(int pid, const char* name) {
return (int)syscall2(Montauk::SYS_SETUSER, (uint64_t)pid, (uint64_t)name);
}
inline int getuser(char* buf, uint64_t maxLen) {
return (int)syscall2(Montauk::SYS_GETUSER, (uint64_t)buf, maxLen);
}
// Window server
inline int win_create(const char* title, int w, int h, Montauk::WinCreateResult* result) {
return (int)syscall4(Montauk::SYS_WINCREATE, (uint64_t)title, (uint64_t)w, (uint64_t)h, (uint64_t)result);