smp: enable smp

This is a very large patch. Don't feel like splitting it up.

Change locking discipline for rbtrees. Most changes are this.

Fix stack init logic for application processors, and start them up.

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-13 14:07:55 -04:00
commit 3e5abada9b
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
17 changed files with 123 additions and 52 deletions

View file

@ -15,6 +15,7 @@
#include <kernel/slab.h>
#include <kernel/proc.h>
#include <kernel/driver.h>
#include <kernel/sched.h>
#include <arch/init.h>
@ -34,8 +35,6 @@
#include <lib/list.h>
#include <lib/rbtree.h>
#define P_STACK_SIZE 0x10000
typedef void (*initcall_t)(void);
struct tty *fbcon_init();
@ -94,6 +93,7 @@ static void kmain()
do_initcalls();
arch_ap_startup();
apic_init();
apic_enable_timer();
dirent_t *init;
res = vfs_open("/bin/init", &init);
@ -117,7 +117,6 @@ static void kmain()
kernel_init_ready = true;
init_thread->state = THREAD_STATE_RUNNING;
enter_userspace_init(init_thread, entry);
__builtin_unreachable();
}