feat: add userspace system logging, rename klog to syslog, rename relevant syscalls and API functions

This commit is contained in:
2026-08-14 18:37:27 +02:00
parent 8e45d43116
commit 724029cacb
26 changed files with 139 additions and 52 deletions
+3 -1
View File
@@ -60,7 +60,7 @@ namespace montauk::abi {
static constexpr uint64_t SYS_TERMSCALE = 43;
static constexpr uint64_t SYS_RESOLVE = 44;
static constexpr uint64_t SYS_GETRANDOM = 45;
static constexpr uint64_t SYS_KLOG = 46;
static constexpr uint64_t SYS_LOG = 46;
static constexpr uint64_t SYS_MOUSESTATE = 47;
static constexpr uint64_t SYS_SETMOUSEBOUNDS = 48;
static constexpr uint64_t SYS_SPAWN_REDIR = 49;
@@ -234,6 +234,8 @@ namespace montauk::abi {
static constexpr uint64_t SYS_WIFI_CONNECT_ASYNC = 164; // (ssid, password) -> 0 accepted, <0 on error
static constexpr uint64_t SYS_NETIFS = 165; // (NetIfInfo*, maxCount) -> count
static constexpr uint64_t SYS_LOG_WRITE = 176; // (componentName, logMessage) -> 0
// Tunable parameters (for SYS_SDR_SETPARAM / SYS_SDR_GETPARAM).
static constexpr int SDR_PARAM_FREQ = 0; // center frequency, Hz
static constexpr int SDR_PARAM_SAMPLE_RATE = 1; // sample rate, Hz
+2 -1
View File
@@ -69,7 +69,7 @@ extern "C" {
#define MTK_SYS_TERMSCALE 43
#define MTK_SYS_RESOLVE 44
#define MTK_SYS_GETRANDOM 45
#define MTK_SYS_KLOG 46
#define MTK_SYS_LOG 46
#define MTK_SYS_MOUSESTATE 47
#define MTK_SYS_SETMOUSEBOUNDS 48
#define MTK_SYS_SPAWN_REDIR 49
@@ -194,6 +194,7 @@ extern "C" {
#define MTK_SYS_WIFI_RESULTS 163
#define MTK_SYS_WIFI_CONNECT_ASYNC 164
#define MTK_SYS_NETIFS 165
#define MTK_SYS_LOG_WRITE 176
/* @SYSCALLS-END */
#define MTK_SOCK_TCP 1
+2 -2
View File
@@ -428,8 +428,8 @@ namespace montauk {
}
// Kernel log
inline int64_t read_klog(char* buf, uint64_t size) {
return syscall2(montauk::abi::SYS_KLOG, (uint64_t)buf, size);
inline int64_t read_log(char* buf, uint64_t size) {
return syscall2(montauk::abi::SYS_LOG, (uint64_t)buf, size);
}
// I/O redirection