summary refs log tree commit diff
path: root/sbin/init/init.c
blob: 168d011d34648afce01b79a5d0c434c8d220fa21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <unistd.h>
#include <signal.h>

int main() {
	sigset_t set;
	int status;
    write(1, "nyaOS init process started\n", 28);
	sigfillset(&set);
	sigprocmask(SIG_BLOCK, &set, 0);
    if (fork()) pause();
    //TODO - eventually add device scan
    if (!fork()) execve("/sbin/devscan", 0, 0);

    sigprocmask(SIG_UNBLOCK, &set, 0);

    // setsid();
    setpgid(0, 0);
    
    write(1, "press RETURN to\n\n", 17);
    char a[2] = {0};
    read(0, a, 1);
    // make tty1
    execve("/sbin/fdmaker", 0, 0);
    // execve("/sbin/devscan", 0, 0);
    // execve("/sbin/fdmaker", 0, 0);
}