mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-29 07:47:59 +00:00
Zero tss stack tables
This commit is contained in:
parent
a3634c3029
commit
ac88a1edb7
@ -115,6 +115,7 @@ namespace GlobalDescriptorTable
|
|||||||
: "memory", "rax");
|
: "memory", "rax");
|
||||||
|
|
||||||
CPUStackPointer[Core] = KernelAllocator.RequestPages(TO_PAGES(STACK_SIZE));
|
CPUStackPointer[Core] = KernelAllocator.RequestPages(TO_PAGES(STACK_SIZE));
|
||||||
|
memset(CPUStackPointer[Core], 0, STACK_SIZE);
|
||||||
debug("CPU %d Stack Pointer: %#lx", Core, CPUStackPointer[Core]);
|
debug("CPU %d Stack Pointer: %#lx", Core, CPUStackPointer[Core]);
|
||||||
|
|
||||||
uint64_t Base = (uint64_t)&tss[Core];
|
uint64_t Base = (uint64_t)&tss[Core];
|
||||||
@ -132,6 +133,9 @@ namespace GlobalDescriptorTable
|
|||||||
tss[Core].InterruptStackTable[0] = (uint64_t)KernelAllocator.RequestPages(TO_PAGES(STACK_SIZE)) + STACK_SIZE;
|
tss[Core].InterruptStackTable[0] = (uint64_t)KernelAllocator.RequestPages(TO_PAGES(STACK_SIZE)) + STACK_SIZE;
|
||||||
tss[Core].InterruptStackTable[1] = (uint64_t)KernelAllocator.RequestPages(TO_PAGES(STACK_SIZE)) + STACK_SIZE;
|
tss[Core].InterruptStackTable[1] = (uint64_t)KernelAllocator.RequestPages(TO_PAGES(STACK_SIZE)) + STACK_SIZE;
|
||||||
tss[Core].InterruptStackTable[2] = (uint64_t)KernelAllocator.RequestPages(TO_PAGES(STACK_SIZE)) + STACK_SIZE;
|
tss[Core].InterruptStackTable[2] = (uint64_t)KernelAllocator.RequestPages(TO_PAGES(STACK_SIZE)) + STACK_SIZE;
|
||||||
|
memset((void *)(tss[Core].InterruptStackTable[0] - STACK_SIZE), 0, STACK_SIZE);
|
||||||
|
memset((void *)(tss[Core].InterruptStackTable[1] - STACK_SIZE), 0, STACK_SIZE);
|
||||||
|
memset((void *)(tss[Core].InterruptStackTable[2] - STACK_SIZE), 0, STACK_SIZE);
|
||||||
|
|
||||||
CPU::x64::ltr(GDT_TSS);
|
CPU::x64::ltr(GDT_TSS);
|
||||||
asmv("mov %%rsp, %0"
|
asmv("mov %%rsp, %0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user