that sounds very cool. i’d like to ask some “noobish” questions about potential applications of this:
if the parents process manages the syscalls of the supervised process, does that mean they don’t have to be Redox syscalls? that, for example, the parent process may offer syscalls for Linux, Windows, BSD, Haiku or whatever, and may provide libraries accordingly? i don’t know how Wine (for example) handles syscalls, but this looks like something that can make things like that easier or more transparent…?
and speaking of transparency, this is kindof another issue but it seems to fit the “theme”: what about cpu emulation and bytecode machines? i guess one can expose syscall interfaces to those as well… basically i recently saw Wine running on an Linux ARM machine, using qemu to run x86 windows programs and i thought it was very cool.
as i (kinda) said, i don’t know too much about operating systems. but it seems interesting enough to ask anyway.
If I’m not mistaken, this is only for Redox syscalls since you cannot call Windows syscalls on Redox. But if you want to run some process that emulates Windows and then run some process inside it and block its syscalls, then your emulator needs to do the "supervision " itself.
I found this question about wine and I think it answers few of your questions:
That’s sort of true. As long as the follow the same method for syscalling as Redox (INT 0x80 with fast-call and respond in RAX), you can customize the syscall interface as you want. So if the platform is similar enough (e.g. Linux), you can certainly use it for emulation. And that is one of the many motivations for introducing this syscall. It is faster than other methods for emulation, such as API translation or dynamic recompilation.
That is not really something for supervise. CPU-level emulation is a lot more than just system calls. It is not something that need a syscall (there would be near to zero advantages over having it in userspace). CPU-level emulation often requires some form of translation of the instruction, often through dynamic recompilation.