Skip to content

Commit

Permalink
[Kernel] AP bootstrap loads a small stack
Browse files Browse the repository at this point in the history
  • Loading branch information
codyd51 committed Jan 10, 2023
1 parent f3eee5d commit 23b2e63
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ap_bootstrap.s.x86_64.arch_specific
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ ap_entry:
mov eax, [$idt_ptr]
lidt [eax]

; Load the stack pointer with the small stack we reserve in the bootstrap
; TODO(PT): This shares the same stack for all APs, we need a per-AP stack
mov rsp, $stack_top
mov rbp, $stack_top

; Spinloop in Long Mode!
.loop:
jmp $.loop
Expand All @@ -96,3 +101,7 @@ align 16
protected_mode_gdt_ptr: dd 0x9000
long_mode_gdt_ptr: dd 0x9100
pml4_ptr: dd 0x9200
idt_ptr: dd 0x9300
stack_bottom:
resb 256
stack_top:

0 comments on commit 23b2e63

Please sign in to comment.