2 ; COPYRIGHT: See COPYING in the top level directory
3 ; PROJECT: ReactOS kernel
4 ; FILE: hal/halx86/mp/mpsboot.c
5 ; PURPOSE: Bootstrap code for application processors
6 ; PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
12 ; Memory map at this stage is:
13 ; 0x2000 Location of our stack
14 ; 0x3000 Startup code for the APs (this code)
18 ; Magic value to be put in EAX when multiboot.S is called as part of the
19 ; application processor initialization process
21 AP_MAGIC equ 12481020h
24 X86_CR4_PAE equ 00000020h
29 %define KERNEL_CS (0x8)
30 %define KERNEL_DS (0x10)
47 mov eax, 3000h + APgdt - _APstart
50 mov eax, [2004h] ; Set the page directory
64 or eax, 80010001h ; Turn on protected mode, paging and write protection
68 dw 3000h + flush - _APstart, KERNEL_CS
81 ; Setup a stack for the AP
86 ; Jump to start of the kernel with AP magic in ecx
94 ; Temporary GDT descriptor for the APs
100 dd 3000h + gdt - _APstart
103 dw 0x0 ; Null descriptor
108 dw 0xffff ; Kernel code descriptor
113 dw 0xffff ; Kernel data descriptor