721c919c7b
Changes: - kernel 6.0.2 - Broken init scripts - Switch to bun for better peroformance an easier ffi - Removed grup - Efi support without graphics (at least graphics werent tested) - Suppression de toutes les dépendance non libc - new splash - broken audio - typescript support - ls rewritten to be more reliable
37 lines
782 B
C
37 lines
782 B
C
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <limits.h>
|
|
#include <sys/mount.h>
|
|
//Chemin exacte de node (a changer aprés la creation d'un gestionnaire de packets)
|
|
#define BUN "/usr/bin/bun"
|
|
#define INIT "/core/index.js"
|
|
|
|
int main() {
|
|
printf("Booting \n");
|
|
|
|
if(access(INIT, F_OK) != 0) {
|
|
printf("/!\\ Core is missing \n");
|
|
sleep(INT_MAX);
|
|
} else {
|
|
printf("Core is present\n");
|
|
}
|
|
|
|
printf("Mounting /proc:");
|
|
if(mount("dummy", "/proc", "proc", MS_NODEV | MS_RDONLY | MS_NOSUID | MS_RELATIME | MS_NOEXEC, NULL) == 0) {
|
|
printf(": Success\n");
|
|
} else {
|
|
printf(": Failure\n");
|
|
}
|
|
|
|
if(access(BUN, F_OK) == 0) {
|
|
printf("Starting bun\n");
|
|
sleep(1);
|
|
execl(BUN, BUN, "run", INIT, NULL);
|
|
}
|
|
else {
|
|
printf("JS binary not found\n");
|
|
sleep(INT_MAX);
|
|
}
|
|
sleep(5);
|
|
}
|