summaryrefslogtreecommitdiff
path: root/kernel/src/scheduler/ap_startup.c
blob: 0d37a6c8a2cbeb0d2732bd43ed2edb5ba90bce67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <atomic.h>
#include <apic.h>
#include <libk/stdio.h>
#include <idt.h>
#include <gdt.h>
#include <paging.h>

void ap_startup(void) {
	load_idt(&idt_pointer);
	load_gdt(&gdt_pointer);
	load_pt_lvl4(page_table_lvl4);

	lock(cnt_lock);
	printf("curr_cpu_apic_id: 0x%x\n", curr_cpu_apic_id());
	cnt++;
	unlock(cnt_lock);

	for(;;) {
		__asm__ volatile ("hlt;");
	}
}