fix: sync template sysroot, add script

This commit is contained in:
2026-06-12 11:56:20 +02:00
parent 22691c5c17
commit 44f86a8b19
33 changed files with 5172 additions and 147 deletions
+152 -12
View File
@@ -57,8 +57,6 @@ namespace Montauk {
static constexpr uint64_t SYS_FDELETE = 77;
static constexpr uint64_t SYS_FMKDIR = 78;
static constexpr uint64_t SYS_DRIVELIST = 79;
static constexpr uint64_t SYS_DRIVELABEL = 124;
static constexpr uint64_t SYS_NETSTATUS = 125;
static constexpr uint64_t SYS_TERMSCALE = 43;
static constexpr uint64_t SYS_RESOLVE = 44;
static constexpr uint64_t SYS_GETRANDOM = 45;
@@ -78,6 +76,7 @@ namespace Montauk {
static constexpr uint64_t SYS_WINPOLL = 57;
static constexpr uint64_t SYS_WINENUM = 58;
static constexpr uint64_t SYS_WINMAP = 59;
static constexpr uint64_t SYS_WINUNMAP = 97;
static constexpr uint64_t SYS_WINSENDEVENT = 60;
static constexpr uint64_t SYS_WINRESIZE = 64;
static constexpr uint64_t SYS_WINSETSCALE = 65;
@@ -123,14 +122,100 @@ namespace Montauk {
static constexpr uint64_t SYS_SETTZ = 90;
static constexpr uint64_t SYS_GETTZ = 91;
// Audio control commands (for SYS_AUDIOCTL)
static constexpr int AUDIO_CTL_SET_VOLUME = 0;
static constexpr int AUDIO_CTL_GET_VOLUME = 1;
static constexpr int AUDIO_CTL_GET_POS = 2;
static constexpr int AUDIO_CTL_PAUSE = 3;
static constexpr int AUDIO_CTL_GET_OUTPUT = 4; // 0=HDA, 1=Bluetooth
static constexpr int AUDIO_CTL_SET_OUTPUT = 5; // Switch audio output
static constexpr int AUDIO_CTL_BT_STATUS = 6; // Get Bluetooth connection status
// User management
static constexpr uint64_t SYS_SETUSER = 92;
static constexpr uint64_t SYS_GETUSER = 93;
static constexpr uint64_t SYS_FRENAME = 94;
static constexpr uint64_t SYS_GETCWD = 95;
static constexpr uint64_t SYS_CHDIR = 96;
static constexpr uint64_t SYS_DUPHANDLE = 98;
static constexpr uint64_t SYS_WAIT_HANDLE = 99;
static constexpr uint64_t SYS_STREAM_CREATE = 100;
static constexpr uint64_t SYS_STREAM_READ = 101;
static constexpr uint64_t SYS_STREAM_WRITE = 102;
static constexpr uint64_t SYS_MAILBOX_CREATE = 103;
static constexpr uint64_t SYS_MAILBOX_SEND = 104;
static constexpr uint64_t SYS_MAILBOX_RECV = 105;
static constexpr uint64_t SYS_WAITSET_CREATE = 106;
static constexpr uint64_t SYS_WAITSET_ADD = 107;
static constexpr uint64_t SYS_WAITSET_REMOVE = 108;
static constexpr uint64_t SYS_WAITSET_WAIT = 109;
static constexpr uint64_t SYS_PROC_OPEN = 110;
static constexpr uint64_t SYS_SURFACE_CREATE = 111;
static constexpr uint64_t SYS_SURFACE_MAP = 112;
static constexpr uint64_t SYS_SURFACE_RESIZE = 113;
// Shared library syscalls
static constexpr uint64_t SYS_LOAD_LIB = 114;
static constexpr uint64_t SYS_UNLOAD_LIB = 115;
static constexpr uint64_t SYS_DLSYM = 116;
static constexpr uint64_t SYS_GETLIBBASE = 117;
/* CrashReport */
static constexpr uint64_t SYS_CRASH_REPORT = 118;
static constexpr uint64_t SYS_CLIPBOARD_SET_TEXT = 119;
static constexpr uint64_t SYS_CLIPBOARD_GET_INFO = 120;
static constexpr uint64_t SYS_CLIPBOARD_GET_TEXT = 121;
static constexpr uint64_t SYS_CLIPBOARD_CLEAR = 122;
static constexpr uint64_t SYS_INPUT_WAIT = 123;
static constexpr uint64_t SYS_DRIVELABEL = 124;
static constexpr uint64_t SYS_NETSTATUS = 125;
static constexpr uint64_t SYS_DRIVEKIND = 127;
// Audio mixer enumeration
static constexpr uint64_t SYS_AUDIOLIST = 128;
// Block until the mixer state serial differs from the caller's snapshot.
static constexpr uint64_t SYS_AUDIOWAIT = 129;
// Threading
static constexpr uint64_t SYS_THREAD_SPAWN = 130;
static constexpr uint64_t SYS_THREAD_EXIT = 131;
static constexpr uint64_t SYS_THREAD_JOIN = 132;
static constexpr uint64_t SYS_THREAD_SELF = 133;
// Flush + unmount persistent volumes for power-off
static constexpr uint64_t SYS_FS_SYNC = 134;
// Cross-process graceful power-off request channel
static constexpr uint64_t SYS_POWER_REQUEST = 135;
// Paginated directory read (path, names, max, startIndex)
static constexpr uint64_t SYS_READDIR_AT = 136;
// Graceful power-off request actions (SYS_POWER_REQUEST). The desktop posts
// a pending action and exits; login.elf reads it, runs the shutdown stages,
// then issues the matching SYS_SHUTDOWN / SYS_RESET.
enum PowerRequestAction : int {
POWER_REQ_QUERY = 0, // read-and-clear the pending action
POWER_REQ_SHUTDOWN = 1,
POWER_REQ_REBOOT = 2,
};
static constexpr uint32_t CLIPBOARD_MAX_TEXT_BYTES = 256 * 1024;
static constexpr uint32_t IPC_SIGNAL_READABLE = 1u << 0;
static constexpr uint32_t IPC_SIGNAL_WRITABLE = 1u << 1;
static constexpr uint32_t IPC_SIGNAL_PEER_CLOSED = 1u << 2;
static constexpr uint32_t IPC_SIGNAL_EXITED = 1u << 3;
static constexpr uint32_t IPC_SIGNAL_READY = 1u << 4;
// Audio control commands (for SYS_AUDIOCTL).
//
// Commands 0..3 act on the stream named by the handle argument.
// Commands 7..12 act on the global master and ignore the handle.
static constexpr int AUDIO_CTL_SET_VOLUME = 0;
static constexpr int AUDIO_CTL_GET_VOLUME = 1;
static constexpr int AUDIO_CTL_GET_POS = 2;
static constexpr int AUDIO_CTL_PAUSE = 3;
static constexpr int AUDIO_CTL_GET_OUTPUT = 4; // 0=HDA, 1=Bluetooth
static constexpr int AUDIO_CTL_SET_OUTPUT = 5; // Switch audio output
static constexpr int AUDIO_CTL_BT_STATUS = 6; // Get Bluetooth status
static constexpr int AUDIO_CTL_SET_MASTER_VOLUME = 7; // 0-100
static constexpr int AUDIO_CTL_GET_MASTER_VOLUME = 8;
static constexpr int AUDIO_CTL_SET_MUTE = 9; // 0/1, per-stream
static constexpr int AUDIO_CTL_GET_MUTE = 10;
static constexpr int AUDIO_CTL_SET_MASTER_MUTE = 11;
static constexpr int AUDIO_CTL_GET_MASTER_MUTE = 12;
static constexpr int SOCK_TCP = 1;
static constexpr int SOCK_UDP = 2;
@@ -176,6 +261,7 @@ namespace Montauk {
char osVersion[32];
uint32_t apiVersion;
uint32_t maxProcesses;
uint32_t buildNumber; // monotonic kernel build number
};
struct KeyEvent {
@@ -194,6 +280,31 @@ namespace Montauk {
uint8_t buttons;
};
struct IpcWaitResult {
int32_t index;
uint32_t signals;
};
struct ClipboardInfo {
uint32_t textBytes;
uint32_t _pad;
uint64_t serial;
};
// One entry per active mixer stream; returned by SYS_AUDIOLIST.
struct AudioStreamInfo {
int32_t handle;
int32_t ownerPid;
char name[64];
uint32_t sampleRate;
uint8_t channels;
uint8_t bitsPerSample;
uint8_t volume; // 0-100
uint8_t muted; // 0/1
uint8_t paused; // 0/1
uint8_t _pad[7];
};
// Window server shared types
struct WinEvent {
uint8_t type; // 0=key, 1=mouse, 2=resize, 3=close, 4=scale
@@ -226,7 +337,7 @@ namespace Montauk {
};
struct DevInfo {
uint8_t category; // 0=CPU, 1=Interrupt, 2=Timer, 3=Input, 4=USB, 5=Network, 6=Display, 7=Storage, 8=PCI
uint8_t category; // 0=CPU, 1=Interrupt, 2=Timer, 3=Input, 4=USB, 5=Network, 6=Display, 7=Storage, 8=PCI, 9=Audio, 10=ACPI
uint8_t _pad[3];
char name[48];
char detail[48];
@@ -234,7 +345,7 @@ namespace Montauk {
struct DiskInfo {
uint8_t port; // block device index
uint8_t type; // 0=none, 1=SATA, 2=SATAPI, 3=NVMe
uint8_t type; // 0=none, 1=SATA, 2=SATAPI, 3=NVMe, 4=USB mass storage
uint8_t sataGen; // SATA gen (1/2/3)
uint8_t _pad0;
uint64_t sectorCount; // Total user-addressable sectors
@@ -322,6 +433,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;
@@ -339,4 +456,27 @@ namespace Montauk {
uint64_t pageSize;
};
// Crash report (filled by kernel on process fault, returned via SYS_CRASH_REPORT)
struct CrashReportInfo {
int pid;
char processName[64];
uint8_t exceptionVector;
char exceptionName[32];
uint64_t faultingAddress;
uint64_t instructionPointer;
uint64_t stackPointer;
uint64_t codeSegment;
uint64_t flags;
uint64_t stackSegment;
uint8_t pfPresent : 1;
uint8_t pfWrite : 1;
uint8_t pfUser : 1;
uint8_t pfReservedWrite : 1;
uint8_t pfInstructionFetch : 1;
uint8_t pfProtectionKey : 1;
uint8_t pfShadowStack : 1;
uint8_t pfSGX : 1;
uint64_t timestampTick;
};
}