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:
parent
33d6f72cfe
commit
3e5abada9b
17 changed files with 123 additions and 52 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#define REQUEST __attribute__((used, section(".limine_requests"))) volatile
|
||||
|
||||
REQUEST u64 _limine_requests_start[] = LIMINE_REQUESTS_START_MARKER;
|
||||
REQUEST u64 limine_base_revision[] = LIMINE_BASE_REVISION(6);
|
||||
|
||||
REQUEST struct limine_executable_address_request kern_addr_req = {.id = LIMINE_EXECUTABLE_ADDRESS_REQUEST_ID, .revision = 0};
|
||||
REQUEST struct limine_memmap_request memmap_req = {.id = LIMINE_MEMMAP_REQUEST_ID, .revision = 0};
|
||||
|
|
@ -12,7 +13,7 @@ REQUEST struct limine_hhdm_request hhdm_req = {.id = LIMINE_HHDM_REQUEST_ID, .re
|
|||
REQUEST struct limine_rsdp_request rsdp_req = {.id = LIMINE_RSDP_REQUEST_ID, .revision = 0};
|
||||
REQUEST struct limine_module_request module_req = {.id = LIMINE_MODULE_REQUEST_ID, .revision = 0};
|
||||
REQUEST struct limine_framebuffer_request fb_req = {.id = LIMINE_FRAMEBUFFER_REQUEST_ID, .revision = 0};
|
||||
REQUEST u64 limine_base_revision[] = LIMINE_BASE_REVISION(6);
|
||||
REQUEST struct limine_mp_request mp_req = {.id = LIMINE_MP_REQUEST_ID, .revision = 0};
|
||||
|
||||
REQUEST u64 _limine_requests_end[] = LIMINE_REQUESTS_END_MARKER;
|
||||
|
||||
|
|
@ -22,6 +23,7 @@ struct limine_hhdm_response *kern_hhdm_res = NULL;
|
|||
struct limine_rsdp_response *kern_rsdp_res = NULL;
|
||||
struct limine_module_response *module_res = NULL;
|
||||
struct limine_framebuffer_response *fb_res = NULL;
|
||||
struct limine_mp_response *mp_res = NULL;
|
||||
|
||||
vaddr_t hhdm_start = 0;
|
||||
|
||||
|
|
@ -33,6 +35,7 @@ void requests_init()
|
|||
kern_rsdp_res = rsdp_req.response;
|
||||
module_res = module_req.response;
|
||||
fb_res = fb_req.response;
|
||||
mp_res = mp_req.response;
|
||||
|
||||
hhdm_start = kern_hhdm_res->offset;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue