2 ; COPYRIGHT: See COPYING in the top level directory
3 ; PROJECT: ReactOS kernel
4 ; FILE: ntoskrnl/hal/x86/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 ; Base address of common area for BSP and APs
20 LOAD_BASE equ 00200000h
23 ; Magic value to be put in EAX when multiboot.S is called as part of the
24 ; application processor initialization process
26 AP_MAGIC equ 12481020h
31 %define KERNEL_CS (0x8)
32 %define KERNEL_DS (0x10)
49 mov eax, 3000h + APgdt - _APstart
53 or eax, 00010001h ; Turn on protected mode and write protection
57 dw 3000h + flush - _APstart, KERNEL_CS
70 ; Setup a stack for the AP
75 ; Jump to start of the kernel with AP magic in eax
77 jmp dword KERNEL_CS:(LOAD_BASE + 0x1000)
82 ; Temporary GDT descriptor for the APs
88 dd 3000h + gdt - _APstart
91 dw 0x0 ; Null descriptor
96 dw 0xffff ; Kernel code descriptor
101 dw 0xffff ; Kernel data descriptor