#include <arch.h>
#include <process.h>
#include <sys/socket.h>
+#include <crxstd.h>
+#include <unistd.h>
void cpu_debug(void);
int arch_init(void*);
static void _init(void)
{
- process_t *stdio;
- process_t *net;
+ pid_t pid;
int err;
/*
* operation, and restart them in case they should die.
*/
+ pid = fork();
+
+ if(!pid) {
+ /* this is the child */
+ err = execfve(_stdio, NULL, NULL);
+
+ if(err < 0) {
+ /* FIXME: Print an error message */
+
+ for(;;);
+ }
+ } else if(pid < 0) {
+ /* FIXME: Print an error message */
+ for(;;);
+ }
+
+ pid = fork();
+
+ if(!pid) {
+ /* this is the child */
+ err = execfve(_net, NULL, NULL);
+
+ if(err < 0) {
+ /* FIXME: Print an error message */
+ for(;;);
+ }
+ } else if(pid < 0) {
+ /* FIXME: Print an error message */
+ for(;;);
+ }
+
+#if 0
+
err = process_create(&stdio, PID_STDIO, 3, (void*)_stdio);
if(err < 0) {
dbg_printf("Failed to start NET process [err=0x%08x]\n", err);
}
- /* For now, only start them once */
- _idle();
+#endif /* 0 */
+
+ wait(NULL);
return;
}
PANIC("Could not spawn idle process\n");
}
- err = process_create(&proc, PID_ANY, 0, (void*)_init);
+ err = process_create(&proc, PID_ANY, 3, (void*)_init);
if(err < 0) {
PANIC("Could not spawn init process\n");