arch/i386/kernel/head.S is responsible for turning on paging mechnisam, and prepare execution envrionment for the first process. The virtual address is from PAGE_OFFSET + 0x100000, and physical address is from 0x100000.
/* enable the paging mechnism, so later address is all virtual address which is physical address + PAGE_OFFSET*/
movl $0x101000,%eax
movl %eax,%cr3 /* set the page table pointer.. */
movl %cr0,%eax
orl $0x80000000,%eax
movl %eax,%cr0 /* ..and set paging (PG) bit */
jmp 1f /* flush the prefetch-queue */
1:
movl $1f,%eax
jmp *%eax /* make sure eip is relocated */
1:
/* Set up the stack pointer */
lss stack_start,%esp
/* set gdtr and idtr to the final one. */
lgdt gdt_descr
lidt idt_descr
ljmp $(__KERNEL_CS),$1f
1: movl $(__KERNEL_DS),%eax # reload all the segment registers
movl %ax,%ds # after changing gdt.
movl %ax,%es
movl %ax,%fs
movl %ax,%gs
#ifdef __SMP__
movl $(__KERNEL_DS), %eax
mov %ax,%ss # Reload the stack pointer (segment only)
#else
lss stack_start,%esp # Load processor stack
/* move to start_kernel - the modern age. */
xorl %eax,%eax
lldt %ax
cld # gcc2 wants the direction flag cleared at all times
call SYMBOL_NAME(start_kernel)