mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
init: withx option
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
#include <kernel/devfs.h>
|
#include <kernel/devfs.h>
|
||||||
#include <kernel/jobctl.h>
|
#include <kernel/jobctl.h>
|
||||||
|
#include <kernel/cmdline.h>
|
||||||
|
|
||||||
#define QUANTUM_US 100000
|
#define QUANTUM_US 100000
|
||||||
#define SCHEDULER_STACK_SIZE PAGE_SIZE
|
#define SCHEDULER_STACK_SIZE PAGE_SIZE
|
||||||
@@ -291,7 +292,7 @@ void sched_inactiveproc(proc_t *proc) {
|
|||||||
// proc refcount 0, we can free the structure
|
// proc refcount 0, we can free the structure
|
||||||
// TODO remove from the pid list
|
// TODO remove from the pid list
|
||||||
|
|
||||||
printf("destroying proc!\n");
|
//printf("destroying proc!\n");
|
||||||
sched_destroyproc(proc);
|
sched_destroyproc(proc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -643,7 +644,7 @@ void sched_runinit() {
|
|||||||
proc->root = vfsroot;
|
proc->root = vfsroot;
|
||||||
VOP_HOLD(vfsroot);
|
VOP_HOLD(vfsroot);
|
||||||
|
|
||||||
char *argv[] = {"/init", "-l", NULL};
|
char *argv[] = {"/init", cmdline_get("initarg"), NULL};
|
||||||
char *envp[] = {NULL};
|
char *envp[] = {NULL};
|
||||||
|
|
||||||
void *stack = elf_preparestack(STACK_TOP, &auxv64, argv, envp);
|
void *stack = elf_preparestack(STACK_TOP, &auxv64, argv, envp);
|
||||||
|
|||||||
+3
-13
@@ -7,24 +7,14 @@ TIMEOUT=5
|
|||||||
:Astral
|
:Astral
|
||||||
PROTOCOL=limine
|
PROTOCOL=limine
|
||||||
KERNEL_PATH=boot:///astral
|
KERNEL_PATH=boot:///astral
|
||||||
KERNEL_CMDLINE=root=nvme0n1 rootfs=ext2
|
MODULE_PATH=boot:///initrd
|
||||||
|
KERNEL_CMDLINE=initrd rootfs=tmpfs initarg=withx
|
||||||
COMMENT="The Astral operating system"
|
COMMENT="The Astral operating system"
|
||||||
|
|
||||||
:Astral (initrd)
|
:Astral (console)
|
||||||
PROTOCOL=limine
|
PROTOCOL=limine
|
||||||
KERNEL_PATH=boot:///astral
|
KERNEL_PATH=boot:///astral
|
||||||
MODULE_PATH=boot:///initrd
|
MODULE_PATH=boot:///initrd
|
||||||
KERNEL_CMDLINE=initrd rootfs=tmpfs
|
KERNEL_CMDLINE=initrd rootfs=tmpfs
|
||||||
COMMENT="The Astral operating system"
|
COMMENT="The Astral operating system"
|
||||||
|
|
||||||
:Astral (debugging)
|
|
||||||
PROTOCOL=limine
|
|
||||||
KERNEL_PATH=boot:///astral
|
|
||||||
KERNEL_CMDLINE=root=nvme0n1 rootfs=ext2 e9 syscall_log
|
|
||||||
COMMENT="The Astral operating system"
|
|
||||||
|
|
||||||
:Astral (debugging, initrd)
|
|
||||||
KERNEL_PATH=boot:///astral
|
|
||||||
MODULE_PATH=boot:///initrd
|
|
||||||
KERNEL_CMDLINE=initrd rootfs=tmpfs e9 syscall_log
|
|
||||||
COMMENT="The Astral operating system"
|
|
||||||
|
|||||||
+7
-1
@@ -4,8 +4,9 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int main() {
|
int main(int argc, char *argv[]) {
|
||||||
printf("init: Welcome to Astral!\n");
|
printf("init: Welcome to Astral!\n");
|
||||||
|
|
||||||
// set up initial environmental variables
|
// set up initial environmental variables
|
||||||
@@ -66,6 +67,11 @@ int main() {
|
|||||||
close(rfd);
|
close(rfd);
|
||||||
close(wfd);
|
close(wfd);
|
||||||
|
|
||||||
|
// run the startwm script
|
||||||
|
// if that exits, we will fall back to the console shell
|
||||||
|
if (argc > 1 && strcmp(argv[1], "withx") == 0)
|
||||||
|
system("/usr/bin/startwm");
|
||||||
|
|
||||||
// start user shell
|
// start user shell
|
||||||
printf("init: running /usr/bin/bash\n");
|
printf("init: running /usr/bin/bash\n");
|
||||||
pid = fork();
|
pid = fork();
|
||||||
|
|||||||
Reference in New Issue
Block a user