processctl() PCTL_SPAWN cmd, scheduler embryo state, redirected pipes

This commit is contained in:
2025-09-10 01:11:22 +02:00
parent c4c26e0e19
commit 91c493c818
17 changed files with 183 additions and 28 deletions

View File

@ -3,6 +3,7 @@
#include <system/system.h>
#include <sysdefs/ioctl.h>
#include <sysdefs/ipcpipe.h>
#include <sysdefs/processctl.h>
#include <uprintf.h>
#include <ansiq/all.h>
@ -29,6 +30,11 @@ void main(void) {
uprintf("Hello world using uprintf\n");
int32_t tb = processctl(-1, PCTL_SPAWN, (uint64_t)"base:/bin/tb");
ipcpipe(tb, IPCPIPE_OUT, IPCPIPE_REPLACE, (uint8_t *)(uint64_t)processctl(-1, PCTL_GETPID, 0), IPCPIPE_OUT);
processctl(tb, PCTL_RUN, 0);
while(processctl(tb, PCTL_POLLSTATE, 0) != 2);
if (ipcpipe(IPCPIPE_SELFPID, 10, IPCPIPE_MAKE, NULL, 0) < 0) {
uprintf("failed to create 10th pipe\n");
}