ish/main.c
Theodore Dubois 640017278e Fix locking issues with CPU refactor
There was a deadlock when cpu_run called cpu_step_to_interrupt with mem
read-locked, and it would write-lock mem to clean up jetsam.
2020-06-09 00:35:53 -07:00

20 lines
543 B
C

#include <stdlib.h>
#include <string.h>
#include "kernel/calls.h"
#include "kernel/task.h"
#include "xX_main_Xx.h"
int main(int argc, char *const argv[]) {
char envp[100] = {0};
if (getenv("TERM"))
strcpy(envp, getenv("TERM") - strlen("TERM") - 1);
int err = xX_main_Xx(argc, argv, envp);
if (err < 0) {
fprintf(stderr, "xX_main_Xx: %s\n", strerror(-err));
return err;
}
do_mount(&procfs, "proc", "/proc", "", 0);
do_mount(&devptsfs, "devpts", "/dev/pts", "", 0);
task_run_current();
}