diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-15 13:01:37 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-15 13:02:17 -0400 |
commit | 76b4d4408ec450d8f8a3aee7223b67da1ce0e2cb (patch) | |
tree | 11217d920d871127d21ec50ae9b64c976264d3b4 /src/sys/arch/amd64/cpu | |
parent | 6bd92c969a6f4aefee258adc79a3ab0bde9443b2 (diff) |
kernel/amd64: Add task state segment logic
This commit implements the task state segment and splits up processor
initialization into two seperate stages. The cpu_conf() function is
apart of the first stage and sets up things that should be going by the
time the kernel is started / early init. The cpu_init() function runs
later functions that initialize further platform specific subsystems.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/arch/amd64/cpu')
-rw-r--r-- | src/sys/arch/amd64/cpu/cpu_conf.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sys/arch/amd64/cpu/cpu_conf.c b/src/sys/arch/amd64/cpu/cpu_conf.c index 7c1f5a0..ee3bb78 100644 --- a/src/sys/arch/amd64/cpu/cpu_conf.c +++ b/src/sys/arch/amd64/cpu/cpu_conf.c @@ -57,12 +57,17 @@ init_vectors(void) void cpu_conf(struct pcore *pcore) { + /* We use %GS to store the processor */ pcore->self = pcore; + wrmsr(IA32_GS_BASE, (uintptr_t)pcore); + init_vectors(); idt_load(); - platform_boot(); +} - /* We use %GS to store the processor */ - wrmsr(IA32_GS_BASE, (uintptr_t)pcore); +void +cpu_init(struct pcore *pcore) +{ lapic_init(); + platform_boot(); } |