feat: implement new IPC layer

This commit is contained in:
2026-04-01 13:11:03 +02:00
parent 6276f8b162
commit 346977a0f9
34 changed files with 3210 additions and 897 deletions
+11 -8
View File
@@ -15,10 +15,12 @@ namespace Montauk {
static void Sys_Print(const char* text) {
auto* proc = Sched::GetCurrentProcessPtr();
if (proc && proc->redirected) {
auto* target = GetRedirTarget(proc);
if (target && target->outBuf) {
for (int i = 0; text[i]; i++) {
RingWrite(target->outBuf, target->outHead, target->outTail, Sched::Process::IoBufSize, (uint8_t)text[i]);
Ipc::Stream* stream = GetRedirOutStream(proc);
if (stream != nullptr) {
int len = 0;
while (text[len]) len++;
if (len > 0) {
WriteAllToStream(stream, (const uint8_t*)text, len);
}
return;
}
@@ -31,9 +33,10 @@ namespace Montauk {
static void Sys_Putchar(char c) {
auto* proc = Sched::GetCurrentProcessPtr();
if (proc && proc->redirected) {
auto* target = GetRedirTarget(proc);
if (target && target->outBuf) {
RingWrite(target->outBuf, target->outHead, target->outTail, Sched::Process::IoBufSize, (uint8_t)c);
Ipc::Stream* stream = GetRedirOutStream(proc);
if (stream != nullptr) {
uint8_t byte = (uint8_t)c;
WriteAllToStream(stream, &byte, 1);
return;
}
}
@@ -41,4 +44,4 @@ namespace Montauk {
if (Kt::g_suppressKernelLog) return;
Kt::Putchar(c);
}
};
};