thread: remove struct proc abstraction

struct proc was a redundant abstraction. everything can be tracked by
just threads

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-12 21:24:38 -04:00
commit e41877b268
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
16 changed files with 646 additions and 120 deletions

View file

@ -76,7 +76,7 @@ static void kmain()
/* "layer 2" kernel requirements */
devfs_init();
device_layer_init();
proc_init();
thread_init();
/* init main fallback tty */
struct tty *serial_tty = NULL;
@ -108,17 +108,17 @@ static void kmain()
if (res < 0)
panic("failed to read /bin/utest: %s\n", strerror(-res));
struct proc *init_proc = proc_create(NULL);
uaddr_t entry = proc_load_file(init_buf, init_proc);
struct thread *init_thread = thread_create();
uaddr_t entry = thread_load_file(init_buf, init_thread);
if ((ssize_t)entry < 0)
panic("failed to load /bin/utest: %s\n", strerror(-(ssize_t)entry));
kernel_init_ready = true;
init_proc->main_thread->state = PROC_STATE_RUNNING;
init_thread->state = THREAD_STATE_RUNNING;
enter_userspace_init(init_proc->main_thread, entry);
enter_userspace_init(init_thread, entry);
__builtin_unreachable();
}