processctl() PCTL_SPAWN cmd, scheduler embryo state, redirected pipes
This commit is contained in:
@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user