1 #include <parlib/parlib.h>
4 /* This runs a variety of process tests. For now, it just tests single-core
5 * yielding among a bunch of processes (which it creates). It needs the
6 * manager() to call schedule repeatedly (not panic at some weird point) for it
8 int main(int argc, char** argv)
11 /* first instance. this is ghetto, since it relies on being the first proc
12 * ever. fix this when we can pass arguments. (TODO) */
14 #define FILENAME "/bin/proctests"
15 int child_pid[NUM_KIDS];
17 for (int i = 0; i < NUM_KIDS; i++)
18 child_pid[i] = sys_proc_create(FILENAME, strlen(FILENAME), NULL, NULL, 0);
19 for (int i = 0; i < NUM_KIDS; i++) {
20 printf("U: attempting to spawn yielders (pid: %d)\n", child_pid[i]);
21 sys_proc_run(child_pid[i]);
24 printf("Process %x, Started and yielding.\n", pid);
26 printf("Process %x, Return from yield1, starting yield2.\n", pid);
28 printf("Process %x, Return from yield2, starting yield3.\n", pid);
30 printf("Process %x, Return from yield3, exiting.\n", pid);