|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
|
|
|
|
|
#include <arch/multiboot.h>
|
|
|
|
|
#include <arch/page.h>
|
|
|
|
|
#include <arch/sched.h>
|
|
|
|
|
#include <arch/segment.h>
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -69,9 +70,12 @@ ENTRY(_setup)
|
|
|
|
|
* set up the stack
|
|
|
|
|
*/
|
|
|
|
|
movl $PADDR(stack_top), %esp
|
|
|
|
|
/* XXX use the APIC for reading the CPU number */
|
|
|
|
|
pushl $0 /* CPU number -- see include/arch/smp.h */
|
|
|
|
|
pushl $0 /* two longwords to keep the stack 8 byte aligned */
|
|
|
|
|
/* "previous" %rip (for ktrace) */
|
|
|
|
|
pushl $0
|
|
|
|
|
pushl $0
|
|
|
|
|
/* "previous" %rbp (for ktrace) */
|
|
|
|
|
pushl $0
|
|
|
|
|
pushl $0
|
|
|
|
|
movl %esp, %ebp
|
|
|
|
|
|
|
|
|
|
push %ebx /* temporarily stash multiboot tag address away */
|
|
|
|
@ -107,9 +111,12 @@ ENTRY(_setup)
|
|
|
|
|
*/
|
|
|
|
|
pushl $PADDR(_x86_kern_tss)
|
|
|
|
|
pushl $PADDR(_x86_gdt + X86_KERN_TSS)
|
|
|
|
|
/* _x86_write_tss_base(&_x86_gdt[X86_KERN_TSS / sizeof(_x86_gdt[0])], &_x86_kern_tss); */
|
|
|
|
|
call _x86_write_tss_base
|
|
|
|
|
|
|
|
|
|
pushl $PADDR(_x86_user_tss)
|
|
|
|
|
pushl $PADDR(_x86_gdt + X86_USER_TSS)
|
|
|
|
|
/* _x86_write_tss_base(&_x86_gdt[X86_USER_TSS / sizeof(_x86_gdt[0])], &_x86_user_tss); */
|
|
|
|
|
call _x86_write_tss_base
|
|
|
|
|
addl $16, %esp
|
|
|
|
|
|
|
|
|
@ -266,7 +273,7 @@ L_END(_setup_highmem)
|
|
|
|
|
.section .multiboot.data, "a", @progbits
|
|
|
|
|
|
|
|
|
|
.section .bootstrap_stack, "aw", @nobits
|
|
|
|
|
.align 16384
|
|
|
|
|
.align KERN_STACK_SIZE
|
|
|
|
|
stack_bottom:
|
|
|
|
|
.skip 16384 /* 16 K for the stack should be plenty for now */
|
|
|
|
|
.skip KERN_STACK_SIZE
|
|
|
|
|
stack_top:
|
|
|
|
|