1 /* 高半核入口点 - 0xC0000000 */
5 #include <sys/failsafe.h>
8 .global __kinit_stack_end
15 # This stack was too small that corrupt the ambient kernel structures.
16 # (took me days to figure this out!)
17 # We should spent more time to implement a good strategy to detect such
18 # run-over (we can check these invariants when we trapped in some non-recoverable
19 # state and provide good feedback to user)
27 movl $__kinit_stack_top, %esp
28 andl $stack_alignment, %esp
30 movl $__kinit_stack_end, %eax
31 movl $STACK_SANITY, (%eax)
32 movl $STACK_SANITY, 4(%eax)
33 movl $STACK_SANITY, 8(%eax)
34 movl $STACK_SANITY, 12(%eax)
40 P.s. 虽然GDT在分页后已变得不重要,甚至可以忽略不作。但为了保持完整性,还是选择加载他
41 这主要是为了保险起见,让GDTR有一个合法的值,否则多咱的粗心大意,容易出#GP
72 # perform arch-specific initialization before diving into kernel
79 movl $bhctx_buffer, (%esp) # mb_parser.c